Sign In

FIX FP16 Errors SDXL - Lower Memory use! --- sdxl-vae-fp16-fix by madebyollin

573
14.3k
474k
106
Updated: Jan 30, 2024
base modelvaebasesdxl
Verified:
SafeTensor
Type
VAE
Stats
14,348
474,264
Reviews
Published
Jan 13, 2024
Base Model
SDXL 1.0
Hash
AutoV2
235745AF8D

"As good as SDXL VAE but runs twice as fast and uses significantly less memory." https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/discussions/7

"Same license on stable-diffusion-xl-base-1.0

same vae license on sdxl-vae-fp16-fix

Troubleshoot:

Do not use the refiner with VAE built in
Try launch param: --medvram --opt-split-attention --xformers

SDXL-VAE-FP16-Fix is the [SDXL VAE](https://huggingface.co/stabilityai/sdxl-vae, but modified to run in fp16 precision without generating NaNs.

Details:

SDXL-VAE generates NaNs in fp16 because the internal activation values are too big:

SDXL-VAE-FP16-Fix was created by finetuning the SDXL-VAE to:

  1. keep the final output the same, but

  2. make the internal activation values smaller, by

  3. scaling down weights and biases within the network

There are slight discrepancies between the output of SDXL-VAE-FP16-Fix and SDXL-VAE, but the decoded images should be close enough for most purposes." - bdsqlsz


NOT MY WORK - REUPLOADED HERE FOR EASE OF USE


COMMISSIONS NOW ACCEPTED!

I have been away saving to upgrade my pc, please help fund more work:

https://www.patreon.com/nucleardiffusion

https://ko-fi.com/nucleardiffusion

Discussion

JU
judas2991

Thanks. I didn't noticed any loading speed increase (idk why i expected this) but still nice to have lightweight one

TomTomorrow's Avatar
TomTomorrow

I've been using this for a couple of weeks and it has stopped the constant errors. I looked for quite a while before finding this. Thanks for hosting it on your site.

Jaidchen's Avatar
Jaidchen
404 Image Contest Participant

If this applies fixes and improved performance without any downsides, why did Stability AI decide to ship an FP32 VAE by default?

wyxzddsjj919's Avatar
wyxzddsjj919

Thank you there are many areas where access to HF is prohibited, and the download speed is much faster in CIVITAL, and don't worry about the download will be interrupted and lose response

DA
darko1297
Sleepless Nights

@blackvortex I've got a white gigabyte 4090 that's never been taken out of the box that Im selling if you're in the market. I would knock a couple hundred off of my ebay price if someone from civ wanted to buy it. It's still stupid expensive, I paid 2400 for it, and that's what I would want in return, cover my cost minus shipping which I'll cover. I know it's ridiculous. I will also I'll pay for shipping. DM me if interested.

blackvortex333366's Avatar
blackvortex333366

Man nVidia really screwed us hard this time with their stupid RTX 4090 ridiculous price. I want one.

Lewd_N_Geeky's Avatar
Lewd_N_Geeky
Elemental Extravaganza Contest Participant

Does anyone know if the scheduler is available for Forge yet?

AV
avain
Move