divamgupta / stable-diffusion-tensorflow

Stable Diffusion in TensorFlow / Keras
Other
1.57k stars 227 forks source link

Add Support for Negative Prompts #54

Closed adietrichs closed 1 year ago

adietrichs commented 1 year ago

Implements support for an optional negative prompt that is used to initialize the unconditional context. This is a feature that has been added to many sd forks, and has been requested in https://github.com/divamgupta/stable-diffusion-tensorflow/issues/48.

Example Colab: https://colab.research.google.com/drive/1QsTve3BTzOUZDIAdzrzur487USloZvjX?usp=sharing Note that tf.random.set_seed(0) in the colab examples is required to make seeds consistent across generations (see https://github.com/divamgupta/stable-diffusion-tensorflow/issues/25)

Also updates text2image.py and img2img.py to expose a --negative-prompt argument. Example usage:

python text2image.py --prompt="hilly landscape" --negative-prompt="grass"
ju-popov commented 1 year ago

😎