I want to write a prompt modifying extension and need help understanding how #15538
Unanswered
TheHorscht
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to write an extension that modifies the prompt before it gets sent to the txt2img pipeline, kind of like how dynamic prompts works (which I took a look at but the code is way too complex for me to understand). I also tried to look at the https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards extension but there are some issues which I don't quite understand.
First of all, it seems that in my script's
process(self, p)
when I modifyp.all_prompts
, only the first element[0]
seems to get used and all the others ignored, not so inbefore_process_batch(self, p)
, where it seems to work correctly? But the wildcards extension usesprocess
, so wouldn't that also be broken?I tried this with batch count 2, batch size 2:
which correctly replaces the prompts and gives me 4 images with a purple, red, green and yellow dress.
However, some time later, when using this method in a real scenario (with a function that actually modifies the prompt randomly based on
p.all_seeds
), I could not replicate the results anymore and modifyingp.all_prompts
had no effect anymore. But it DID show in the generation params in the infotext under the gallery view, while still using the original prompt for the actual image generation.So that's where I'm really confused, what's the difference between these and which do I need to modify when? Which one gets written to the metadata? Which one gets output in the infotext and which one gets used for the actual generation?
Are there any more that I forgot?
I'm not even sure if the prompt I modified affected the the actual image generation, or just the text in the infotext, and if the modified prompt was written correctly into the image metadata or not. No idea where the non-reproducability issue lies. Please help, thanks :)
Beta Was this translation helpful? Give feedback.
All reactions