Add ControlNet image file name to prompt when batch processing? #1046
Replies: 2 comments 1 reply
-
Try the extension sd_dynamic prompts. There's built in stuff like the x y z prompt stuff you can use too, but this is a really helpful extension, as it allows RANDOM inserts, too. You define your stuff in wildcard files, which work recursively, too. So you can use wildcards from other wildcard files: extensions\sd-dynamic-prompts\wildcards\vehicle.txt
extensions\sd-dynamic-prompts\wildcards\color.txt
extensions\sd-dynamic-prompts\wildcards\type.txt
Now you can add If you have "Combinatorial generation" enabled, it will generate images with ALL combinations by iterating over them. If you have it disabled as in the screenshot, it will just RANDOMLY pick one of each for how many images you generate. Even if you just generate ONE image, it will pick randomly, not just always the first one. So you would just use
for your usecase and enable Combinatorial generation to get an image generated for each vehicle type. |
Beta Was this translation helpful? Give feedback.
-
I just realized that I should not have suggested an idea for ControlNet here. I should post my idea over in the discussion forum for that specific extension. |
Beta Was this translation helpful? Give feedback.
-
Is there any way to add a checkbox to the ControlNet batch tab so that it adds the name of each file to the beginning of the prompt?
I am trying to generate a vast number of images that will subsequently be used as a dataset for a style. For example, I have three pictures that I want to batch process in ControlNet. One is a photo of a car, another of a truck, another of a bus. I want to render all of them with prompts that include, "[art by van gogh|art by greg rutkowski|art by alphonse mucha]" in order to combine those artist's styles. But I also need to include "car" or "truck" or "bus" in the prompts that use those images when they are each used by ControlNet.
I tried to use Prompts From File script but it doesn't work the way I expected. The text I fed to the script looked like this:
car, [art by van gogh|art by greg rutkowski|art by alphonse mucha]
truck, [art by van gogh|art by greg rutkowski|art by alphonse mucha]
bus, [art by van gogh|art by greg rutkowski|art by alphonse mucha]
The result is that it uses the car prompt three times. Once using the car image in ControlNet, then using the truck image, then using the bus image. It repeats this process for the truck prompt, and then again for the bus prompt. I only want to generate three images but it instead renders nine. Three of those nine images are exactly what I want but this is a huge waste of rendering time. Especially if I'm trying to process more than a hundred images.
If I could simply have ControlNet read the file name of each image in the batch and add it to the beginning of the prompt, I believe it would solve this problem. I suppose the question is whether or not such a feature would have use beyond the narrow scope of what I want to do.
Or is there another way to do what I'm trying to do?
Beta Was this translation helpful? Give feedback.
All reactions