Instructions to use madebyollin/sdxl-vae-fp16-fix with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Diffusers
How to use madebyollin/sdxl-vae-fp16-fix with Diffusers:
pip install -U diffusers transformers accelerate
import torch from diffusers import DiffusionPipeline # switch to "mps" for apple devices pipe = DiffusionPipeline.from_pretrained("madebyollin/sdxl-vae-fp16-fix", dtype=torch.bfloat16, device_map="cuda") prompt = "Astronaut in a jungle, cold color palette, muted colors, detailed, 8k" image = pipe(prompt).images[0] - Notebooks
- Google Colab
- Kaggle
No overflow if using the whole sdxl pipeline
Hi, many thanks for your contribution to sdxl ~~~
when I use sdxl vae encoder + sdxl vae decoder in fp16 precision, i get black image, while if I use AutoPipelineForImage2Image pipeline or StableDiffusionXLPipeline to generate image with sdxl vae in fp16 precision, the images are fine. I wonder if the overflow in fp16 precision only occurs when the vae is used only?
The SDXL VAE in diffusers automatically forces upcasting to fp32 (see the documentation for force_upcast), so you won't notice overflows when the original SDXL VAE is used as part of a Diffusers pipeline (things will just run slower)
The SDXL VAE in diffusers automatically forces upcasting to fp32 (see the documentation for
force_upcast), so you won't notice overflows when the original SDXL VAE is used as part of a Diffusers pipeline (things will just run slower)
I see, thanks a lot !!