adieyal / sd-dynamic-prompts

A custom script for AUTOMATIC1111/stable-diffusion-webui to implement a tiny template language for random prompt generation
MIT License
2.02k stars 261 forks source link

Wildcards Generating Twice When Using Hires Fix, "Hires Prompt" #773

Open Oriloceech opened 5 months ago

Oriloceech commented 5 months ago

On Automatic1111, wildcards appear to be generating once for the normal pass, and then a second time for the hires fix pass, even if you don't enter anything into the hires fix prompt field. (Which is supposed to make A1111 ignore that field and use only the main prompt). You can see the additional hires fix wildcard generation parameters in the .png files.

This can create some real Cronenbergs, depending on the complexity of one's prompt. In smaller prompts, it doesn't have much effect, but in larger and more complex prompts and wildcards, you may get fried images or artifacts if the generated wildcards are completely incompatible.

Weirdly, the first set of generations in a given batch size are not affected. Meaning if you do, say, batch count 5 with batch size 2, the first 2 images out of 10 will be free of this effect. This is confirmed by the .png metadata.

It's pretty easy to replicate this yourself, but here's an example prompt to make it even easier. Generate at least 2 batches, check the metadata and you'll see the wildcards generating twice for all images but the first batch.

(best quality, masterpiece, very aesthetic, absurdres:1.2), 1girl, {souryuu_asuka_langley from neon genesis evangelion|hakurei_reimu from touhou}, {facing viewer, looking at viewer|from behind, looking back|from below|from above}, {(scowl:1.2)|(smile:1.2)|(disgust:1.2)|(smug:1.2)}, {moonlight|sunlight}, {indoors|outdoors}

I did recently update to A1111 1.9.3, and I don't recall this behavior happening prior. The "Prompt for hires fix pass" field wasn't a thing in earlier versions.

It may also be worth noting that there are two options now in A1111:

Hires fix: show hires checkpoint and sampler selection Hires fix: show hires prompt and negative prompt

I have both of these disabled, and when I launch A1111 and open the Hires Fix menu, I don't see the hires fix sampler, checkpoint, or hires prompt fields. But when I generated using any wildcard, the .png's metadata still contains hires fix prompt information, and when I plug that into A1111 it activates overrides that enable those options, so this is happening regardless of how those options are set.

Finally, here's just a random generation with the double wildcard in the metadata. What is that Pikachu thinking...

00520-4230627163