adieyal / sd-dynamic-prompts

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

Enhancement: enrich csv export #783

Open sfxn opened 1 month ago

sfxn commented 1 month ago

I find the "prompts to file" feature very useful but would be happy about these improvements:

  1. add an index column. When using Combinatorial generation with several iterations, it would be helpful to have an index in the CSV, representing the nth iteration of the very image that was created. I myself use [generation_number] in the Images filename pattern. So when comparing good with bad results, it's easier to identify the row that matches the generated image.
  2. for each variant add a separate column that represents its specific value that has been used within that specific prompt.

When using one random sampler and two combinatorial samplers within the positive prompt, the result might look like this:

index positive_prompt negative_prompt variant_1 variant_2 variant_3
0 a {~hot|cold|mild} {summer|spring} is coming to {mexico|germany} ugly {~hot|cold|mild} {summer|spring} {mexico|germany}
1 a mild summer is coming to mexico ugly mild summer mexico
2 a hot summer is coming to germany ugly hot summer germany
3 a hot spring is coming to mexico ugly hot spring mexico
4 a cold spring is coming to germany ugly cold spring germany