Instructions to use CompVis/stable-diffusion-v1-4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use CompVis/stable-diffusion-v1-4 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("CompVis/stable-diffusion-v1-4", dtype=torch.bfloat16, device_map="cuda") prompt = "A high tech solarpunk utopia in the Amazon rainforest" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
- Local Apps
- Draw Things
- DiffusionBee
How can I imput the negative prompt with the stable diffusion pipeline?
The negative prompt can be used like this: [black and white] in the txt2img.py, but if I use the pipeline how can I input the negative prompt? Does it have this function?
Install diffusors from git (or wait for the next release) and then use negative_prompt in the call.
Install
diffusorsfrom git (or wait for the next release) and then usenegative_promptin the call.
Thank you so much for replying! But I don't know that clearly, how to use the 'negative_prompt' after I install the diffusers, which file is it in?
In the script your're using you somewhere have something like
pipeline = StableDiffusionPipeline(...)
results = pipeline(prompt="my prompt", ...)
There you can add the new option. If you use a thirdparty project, you either have to patch it yourself or open a bug to ask the maintainer to add the feature.