CivArchive
    FIX FP16 Errors SDXL - Lower Memory use! --- sdxl-vae-fp16-fix by madebyollin - v1.0
    Preview 2369135

    "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

    Description

    FAQ

    Comments (28)

    TigonTXSep 5, 2023
    CivitAI

    I get errors now

    nucleardiffusion
    Author
    Sep 6, 2023

    in that case, try apply settings or use the default one, sorry!

    - Do not use the refiner with VAE built in


    Try launch param: --medvram --opt-split-attention --xformers

    neoraozSep 7, 2023
    CivitAI

    Error

    nucleardiffusion
    Author
    Sep 7, 2023

    in that case, try apply settings or use the default one, sorry!
    - Do not use refiner with VAE built in


    My Launch param: --medvram --opt-split-attention --xformers

    DerD4nnYSep 12, 2023· 1 reaction
    CivitAI

    working fine

    123456795Sep 13, 2023
    CivitAI

    错误

    123456795Sep 13, 2023
    CivitAI

    错误

    123456795Sep 13, 2023
    CivitAI

    错误

    ze_thrillerSep 16, 2023
    CivitAI

    Edit: the one from HF works

    I have lots of errors trying to load this one.

    RuntimeError: Error(s) in loading state_dict for AutoencoderKL: Missing key(s) in state_dict: "encoder.down.0.block.0.norm1.weight", "encoder.down.0.block.0.norm1.bias", "encoder.down.0.block.0.conv1.weight", "encoder.down.0.block.0.conv1.bias", "encoder.down.0.block.0.norm2.weight", "encoder.down.0.block.0.norm2.bias" [and a lot more]

    nucleardiffusion
    Author
    Sep 16, 2023

    try change yaml to in_channels: 9

    it;'s the SAME file!

    Good luck

    kylekennedykkSep 29, 2023
    CivitAI

    I have not been able to get this to work, just get "TypeError: 'NoneType' object is not iterable"

    Is this something I am doing wrong?

    rumina001May 30, 2024

    try more type

    ebony3dJun 18, 2024

    @rumina001 

    what does that mean?

    ExpedientFalconOct 22, 2023· 2 reactions
    CivitAI

    Is it possible to add the file as a download directly on this Civitai page? I'd like to be able to pull this in automatically with Stability Matrix, but have to do it manually because the download is only on huggingface

    nucleardiffusion
    Author
    Oct 24, 2023· 1 reaction

    It was there but somehow dissapeared, it's back uploaded here now!

    JaidchenDec 18, 2023· 6 reactions
    CivitAI

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

    fenix5fireMar 1, 2024· 2 reactions

    Cuz fp16 is less precise and just a bit worse. Thats all. In case of low-end configuration small inaccuracies are the sacrifice that worth the 2x speed and free VRAM

    nofiltermanJul 24, 2024· 2 reactions

    If code was written with native 32 bit math, and expects 32 bit numbers when data is passed from one step to another, that's why you would put 32 bit versions of the files and code all together in your release. "That's the precision the worked with from the beginning and what's "expected" or "native" to the program(s). However, you can cast/convert to other data types. Which have different precision (total number of possible values) and obviously 8 bits has less precision than 16, and that's got less than 32. 32 bit float is pretty darn big in terms of possible values--it's fucking huge, but 64 bit or 128 bit numbers as data types. And obviously the bigger data types take more RAM or VRAM. As fenix5fire noted, for "low end" amounts of memory in hardware, casting down to the smaller data type doesn't incur much penalty at all in terms of the result--for this purpose--but takes HALF the amount of RAM or VRAM!

    TomTomorrowDec 24, 2023· 8 reactions
    CivitAI

    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.

    wyxzddsjj919Jan 13, 2024· 10 reactions
    CivitAI

    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

    judas2991May 1, 2024· 5 reactions
    CivitAI

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

    blackvortex333366May 14, 2024· 23 reactions
    CivitAI

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

    avainMay 22, 2024· 2 reactions
    CivitAI
    Move
    3061252May 30, 2024

    But where? 🤔

    Lewd_N_GeekyJun 27, 2024· 9 reactions
    CivitAI

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

    4809817Oct 12, 2024· 2 reactions
    CivitAI

    is it possible to train a VAE to encode text into images?

    dragonlizardwings829Feb 8, 2025· 4 reactions
    CivitAI

    Works wonders on my RTX 3050 ^^

    MlaofmdAug 17, 2025· 1 reaction
    CivitAI

    it works with qdiffusion?

    VAE
    SDXL 1.0

    Details

    Downloads
    47,134
    Platform
    CivitAI
    Platform Status
    Available
    Created
    9/5/2023
    Updated
    5/14/2026
    Deleted
    -

    Files

    Available On (1 platform)

    Same model published on other platforms. May have additional downloads or version variants.