Run this model with HF Jobs
Run madebyollin/sdxl-vae-fp16-fix on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/madebyollin/sdxl-vae-fp16-fix. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/madebyollin/sdxl-vae-fp16-fix on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
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
Any way to make it work with SD v1 properly?
Any way to make it work with SD v1 properly?
No. SDXL-VAE was retrained from scratch, and it's not compatible with SD-VAE:
SDXL-VAE Encoder → SDXL-VAE Decoder: Happy dog
SD-VAE Encoder → SD-VAE Decoder: Happy dog
SDXL-VAE Encoder → SD-VAE Decoder: Sad dog
SD-VAE Encoder → SDXL-VAE Decoder: Angry dog
The SD-VAE internal activations explode slower than the SDXL-VAE, so you can often run SD-VAE in fp16 without NaNs as-is:
Still, to make SD-VAE work 100%-reliably in fp16, you'd need a sd-vae-fp16-fix - which I don't think anyone has made.
No. SDXL-VAE was retrained from scratch, and it's not compatible with SD-VAE:
SDXL-VAE Encoder → SDXL-VAE Decoder: Happy dog
SD-VAE Encoder → SD-VAE Decoder: Happy dog
SDXL-VAE Encoder → SD-VAE Decoder: Sad dog
SD-VAE Encoder → SDXL-VAE Decoder: Angry dog
The SD-VAE internal activations explode slower than the SDXL-VAE, so you can often run SD-VAE in fp16 without NaNs as-is:
Still, to make SD-VAE work 100%-reliably in fp16, you'd need a
sd-vae-fp16-fix- which I don't think anyone has made.
thank u for great work~
what tool did u use for showing internal activations?
it is very cool~
@bdsqlsz https://gist.github.com/madebyollin/e6e217a77db94e2a960ab6ccbd627db9 I'm just printing them by hand
