Instructions to use stabilityai/stable-diffusion-xl-refiner-1.0 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use stabilityai/stable-diffusion-xl-refiner-1.0 with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline from diffusers.utils import load_image # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("stabilityai/stable-diffusion-xl-refiner-1.0", dtype=torch.bfloat16, device_map="cuda") prompt = "Turn this cat into a dog" input_image = load_image("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/diffusers/cat.png") image = pipe(image=input_image, prompt=prompt).images[0] - Notebooks
- Google Colab
- Kaggle
Only receiving black images?
#20
by SLRezarak - opened
Hi, everything is working fine but I'm only receiving black images.
When would a black image be returned?
I'm using an image and a prompt as input. However, might this be because the input image is a wrong size or something?
I also tried with the example on the model card but it did not work. There is no hint of NSFW or anything.
Any help is appreciated. Thanks!
me too
i have meet the same problem
are you solve it?
@SLRezarak @FortMinor0417 not sure if anyone still has this problem, but use this VAE https://huggingface.co/madebyollin/sdxl-vae-fp16-fix to solve that issue