Stability-AI / stablediffusion

High-Resolution Image Synthesis with Latent Diffusion Models
MIT License
38.83k stars 5.01k forks source link

Negative prompt? #94

Closed tonydavis629 closed 1 year ago

tonydavis629 commented 1 year ago

How do we input negative prompts when using the scripts?

jamesthesnake commented 1 year ago

I think that's just a parameter?

tonydavis629 commented 1 year ago

It is not. There is only the option for prompt. The negative conditioning in the scripts are filled in with an empty string, telling me that maybe negative prompts are not meant to be used?

jamesthesnake commented 1 year ago

https://huggingface.co/stabilityai/stable-diffusion-x4-upscaler it is here I'll go through the code

mattmdjaga commented 1 year ago

The examples here https://stability.ai/blog/stablediffusion2-1-release7-dec-2022, the post about 2.1 ,seem to imply negative prompts are added at the end of the prompt with a ": -2" to specify those prompts being negative. An example that they show is "a portrait of a beautiful blonde woman, fine - art photography, soft portrait shot 8 k, mid length, ultrarealistic uhd faces, unsplash, kodak ultra max 800, 85 mm, intricate, casual pose, centered symmetrical composition, stunning photos, masterpiece, grainy, centered composition : 2 | blender, cropped, lowres, poorly drawn face, out of frame, poorly drawn hands, blurry, bad art, blurred, text, watermark, disfigured, deformed, closed eyes : -2 ". When i tested this on the 2.1 checkpoint I had good results. This is just a guess tho.

EDIT : Read a bit more about negative prompts, mainly from https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Negative-prompt which shows how to add negative prompts, and the summary is that you input them into the unconditional conditioning argument of the sampler sample function. See the link for an easy explanation and example.