Greetings, I’m working on my first t2i generator, and I’m in need of a little assistance.

I want to output 4 images with 4 different attributes for one of the prompt terms. Let’s say shirt color. I understand that I could easily create 4 different outputs, but that would mean duplicating the whole prompt 4 times. I’d rather have it be more concise using one output and dynamically change on reload (with no duplicates).

A consumable list seems like what I would need, but it seems like this still requires 2 outputs?

This works, and outputs my 4 colors correctly with no dupes:

output1
  [c = shirtcolor.consumableList]
output2
  [c]

HTML:

[output1]
[output2]
[output2]
[output2]

I’d prefer it if I could get this to work with just one output. Thanks for any help or tips!

  • VioneTM
    link
    English
    31 year ago

    Try this snippet:

    output
      [e = ethnicity.consumableList, c = shirtColor.consumableList, ''] [new Array(4).fill(0).map(a => `<div>${t2i(prompt)}<br>${lastTextToImagePrompt}</div>`).joinItems("")]
    
    prompt
      prompt = [bodyType] [e] Woman wearing a [c] shirt
      resolution = 512x768
      guidanceScale = 5
    

    First we instantiate the consumable lists. Then, we create an Array with the size of the length of the consumable list (to prevent no more items), we then fill it with default items first, then map the items by changing them to host the t2i outputs then join them.

    • AshenthornOP
      link
      English
      11 year ago

      Wow! That looks perfect… This will also allow me to easily add use user inputs, and add the prompt parameters all in one place.

      Thanks so much for the help!

      I’ll be sure to post again if I run into any trouble. 🙂