sd-dynamic-prompts
sd-dynamic-prompts copied to clipboard
Write prompt to metadata do not work fully
Hello, first thank for this helpful extension. In settings I checked "Save template to metadata: Write prompt template into the PNG metadata"
When I write a inline template like {value1|value2] the saved metadata is the result for value1 or value2 but not the template with {}
For a more complete example of the problem, this is my inline template :
`` (masterpiece, black hair, ponytail, hair ribbon, ribbon, very long hair, purple eyes, shiny eyes, blush, closed mouth, {smile, parted lips|smile}, detailed face), { jester, jester cap, hat, puffy sleeves, short sleeves, pom pom clothes, bridal gauntlets, pajamas, star print, shuriken, navel, pants| white shirt, green vest, green skirt, plaid skirt, school uniform, bowtie| yellow shirt, pink skirt, pleated skirt| bare shoulders, white shirt, off-shoulder shirt, cleavage, navel, shorts, gym shorts }
And the saved metadata is
`` (masterpiece, black hair, ponytail, hair ribbon, ribbon, very long hair, purple eyes, shiny eyes, blush, closed mouth, smile), jester, jester cap, hat, puffy sleeves, short sleeves, pom pom clothes, bridal gauntlets, pajamas, star print, shuriken, navel, pants
What is needed is to save the original prompt in metadata
It's not writing the raw positive and negative prompts. I've had this problem for a while. I've done a fresh install of A1111 and DP and it still happens. It was working for a really long time, 6+ months, but stopped about 2-3 weeks ago. "Write prompts to file: Create a new .txt file for every batch containing the prompt template as well as the generated prompts." This option creates a CSV file but also does not include the raw prompt
Yes I see same thing, it worked before but break after an update to a new version
Do you have adetailer installed? I have the same issue of the template being written as the chosen wildcard values and not the initial wildcard prompt itself. However, when I disable adetailer it seems to save the wildcard/variant prompt correctly as a template.
How to get them to both work together again though is the problem...
Do you have adetailer installed? I have the same issue of the template being written as the chosen wildcard values and not the initial wildcard prompt itself. However, when I disable adetailer it seems to save the wildcard/variant prompt correctly as a template.
How to get them to both work together again though is the problem...
Yes you are right. Without Adetailer it saves the raw prompt. Not where it used to save it at the end but in the middle of the Steps information paragraph.
Do you have adetailer installed? I have the same issue of the template being written as the chosen wildcard values and not the initial wildcard prompt itself. However, when I disable adetailer it seems to save the wildcard/variant prompt correctly as a template.
How to get them to both work together again though is the problem...
So THATS where this is coming from. It's random for me like every once in 4/5 gens, it will just spit out the raw prompt like you said, instead of activating the wildcards/variables.
Also I want to add, if you are generating in batches, the entire batch is affected by this as well.
Can confirm this is still a thing all this time later and it has simply not been fixed.
This is extremely unfortunate, as I like to deal with a lot of wildcards, and it basically means if I ever generate more than one image in a batch, saving the data to/from the image or to a CSV is 100% useless, effectively making any image besides the first one unable to be reproduced since I literally do not know what settings, seed, etc. was chosen.
Basically I can either generate a bunch of really nice images but not know what the parameters were that made it, or I can generate middling image quality and then am forced to use ADetailer after the fact in img2img.
Can confirm this is still a thing all this time later and it has simply not been fixed.
This is extremely unfortunate, as I like to deal with a lot of wildcards, and it basically means if I ever generate more than one image in a batch, saving the data to/from the image or to a CSV is 100% useless, effectively making any image besides the first one unable to be reproduced since I literally do not know what settings, seed, etc. was chosen.
Basically I can either generate a bunch of really nice images but not know what the parameters were that made it, or I can generate middling image quality and then am forced to use ADetailer after the fact in img2img.
What are you talking about? Go to SETTINGS >INFOTEXT>Write infotext to metadata of the generated image "" >Create a text file with infotext next to every generated image
Go to SETTINGS>DYNAMIC PROMPTS>Save template to metadata: Write prompt template into the PNG metadata
While this DOES NOT save the raw wildcards, it saves all creation data. To save the raw wildcard, generate one picture with ADETAILER disabled.
What are you talking about? Go to SETTINGS >INFOTEXT>Write infotext to metadata of the generated image "" >Create a text file with infotext next to every generated image
Go to SETTINGS>DYNAMIC PROMPTS>Save template to metadata: Write prompt template into the PNG metadata
While this DOES NOT save the raw wildcards, it saves all creation data. To save the raw wildcard, generate one picture with ADETAILER disabled.
I already have that on, which is how I figured out there's a problem, since as you said, it generates fine if you do one image, and one image ONLY.
- I create a template. I set up a batch image generation based on that template. I run it.
- What I expect: CSV stores both the template, and for each image in the batch that's rolled, the individual prompt that gets derived from the template. Each image has the generation data embedded in the image as well as a fallback (which yes, I have enabled). This is how it usually works without ADetailer, or at least, it's how it used to work on old Forge.
- What happens: CSV stores no template (more accurately, it gets overwritten by the first generated image's info), and instead stores whatever the first image was that it rolled (n+1) times over. If I tell it to do 50 images, it writes 51 prompts that are identical to the first rolled image to the CSV, not the actual generation information, and the template itself gets overwritten by the first generated image's information as well. Info embedded into the generated image is also of this first prompt, regardless of what the actual generation parameters are.
Needless to say, this is a problem. Right now the only workaround is to not use ADetailer on txt2img at all and only use it on img2img, which is kind of a hacky workaround.
Granted, from what I see elsewhere, this might be due to how ADetailer "works" in that it calls things in a way that Dynamic Prompts doesn't like.
Either way, the issue is known (https://github.com/adieyal/sd-dynamic-prompts/issues/730) and fixed (https://github.com/adieyal/sd-dynamic-prompts/pull/790), but it's waiting for someone to approve it and merge it into the codebase for months. For now I'm resorting to overwriting the files manually...