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.01k stars 259 forks source link

[Feature Request] Randomize specific attention numbers in prompt #236

Open hcorion opened 1 year ago

hcorion commented 1 year ago

Basically, I want a more tunable attention grabber. If I could write something like (snowy peaked mountain range with glacier-fed lake:1.6) (wide shot:$$1.1-1.3$$) (epic, stunning, evocative, dramatic:$$1.1-1.6$$) which might produce something like (snowy peaked mountain range with glacier-fed lake:1.6) (wide shot:1.27) (epic, stunning, evocative, dramatic:1.12) The syntax here is just to get the point across, I haven't looked at how your parsing and don't know if that's feasible.

adieyal commented 1 year ago

There is a (somewhat clumsy) workaround right now

(snowy peaked mountain range with glacier-fed lake:{1.1|1.2|1.3}) 
(wide shot:{1.1|1.2|1.3})
(epic, stunning, evocative, dramatic:{1.1|1.2|1.3|1.4|1.5|1.6})

you can make it slightly less clumsy by creating a wildcard file, e.g. 1-6.txt

# 1.1 - 1.6
1.1
1.2
1.3
1.4
1.5
1.6

and then: (epic, stunning, evocative, dramatic:__1-6__)

Dedicated syntax would obviously be more convenient, but you can get pretty far with the standard syntax.

You could also use Jinja2 templates - they are a little more complicated to use but can do this pretty easily

space-nuko commented 1 year ago

I'd also want something like this, it'd be super convenient. I'm up for something like {1.0-1.5} or similar. Would also be nice to control the step size, like {1.0-1.5$$0.25}.

And of course support for integers and floats. I'd typically want a step of 1 for integers and 0.1 for floats.

Kenqr commented 5 months ago

Any news? I would like to see this feature as well. It will also work well in [from:to:when] prompts.

VL4DST3R commented 2 months ago

Bump! Came looking if this is already a thing and after going through documentation and coming up empty I found this! It would be very appreciated for stuff like LowRA which can add a bit of diversity from one prompt to another.