stable-diffusion-tensorflow icon indicating copy to clipboard operation
stable-diffusion-tensorflow copied to clipboard

Negative prompts

Open Juvuzux opened this issue 2 years ago • 3 comments

As implemented, is it currently possible to use negative prompts?

Juvuzux avatar Oct 08 '22 21:10 Juvuzux

I could second this question. Is there any way to use negative prompts?

sweetpalma avatar Oct 14 '22 16:10 sweetpalma

The negative prompt is simply the prompt that is used for the "unconditional" generation in Classifier-Free Guidance. In this implementation it is hardcoded to be an empty string (or rather, a sequence full of padding tokens, https://github.com/divamgupta/stable-diffusion-tensorflow/blob/master/stable_diffusion_tf/constants.py), which is how it was originally meant to be by the model developers.

It doesn't seem to be that hard to change the implementation to support any arbitrary prompt to be used for the unconditional guidance.

jorgemcgomes avatar Oct 17 '22 11:10 jorgemcgomes

If anyone could send a PR with a Coab example, that would be great.

divamgupta avatar Oct 27 '22 04:10 divamgupta