- ae.safetensors is the VAE (variational autoencoder) weight file shipped with Black Forest Labs’ FLUX.1 image models. It decodes FLUX’s latents into RGB pixels and encodes images back to latents for img2img.
- Download it from the official safetensors" rel="noopener" target="_blank">black-forest-labs/FLUX.1-schnell or FLUX.1-dev repos on Hugging Face. The file is ~335 MB.
- In ComfyUI place it in
ComfyUI/models/vae/and load it with the Load VAE node. In Forge/A1111 place it inmodels/VAE/. - The same
ae.safetensorsworks for FLUX.1-dev, FLUX.1-schnell and most FLUX finetunes — you do not need a separate VAE per checkpoint.
ae.safetensors is the autoencoder (VAE) weights file that ships alongside Black Forest Labs’ FLUX.1 diffusion models. FLUX generates images in a compressed latent space; ae.safetensors is the decoder that turns those latents into visible pixels (and the encoder used for image-to-image and inpainting). Without it, ComfyUI, Forge, SwarmUI or diffusers cannot render a final image from a FLUX checkpoint.
The file is stored in the safetensors format — a memory-mappable, tensor-only container that cannot execute arbitrary Python on load, unlike legacy .ckpt pickles. That is why nearly every modern model release ships weights as .safetensors.
What Exactly Is in ae.safetensors
FLUX.1 is a rectified-flow transformer that operates on 16-channel latents at 1/8 spatial resolution. The ae.safetensors file contains only the VAE weights — no transformer, no text encoders. Approximate specs:
| Property | Value |
|---|---|
| File size | ~335 MB (fp16) |
| Latent channels | 16 |
| Spatial compression | 8× (a 1024×1024 image → 128×128×16 latent) |
| Format | safetensors (tensor-only, no pickle) |
| Compatible checkpoints | FLUX.1-dev, FLUX.1-schnell, FLUX.1-pro (API), most FLUX finetunes and LoRAs |
| License | Non-commercial for FLUX.1-dev VAE; Apache-2.0 for FLUX.1-schnell VAE |
The FLUX VAE is not the same file as the SD 1.5 or SDXL VAEs. Its 16-channel latent space is incompatible with those models — do not swap them.
Where to Download ae.safetensors
Get it from Black Forest Labs’ official Hugging Face repos. Both files are the same architecture; the schnell repo is Apache-2.0 licensed and freely redistributable, which is why most third-party bundles link to it.
- black-forest-labs/FLUX.1-schnell → ae.safetensors (Apache-2.0)
- black-forest-labs/FLUX.1-dev → ae.safetensors (FLUX.1-dev non-commercial license; requires accepting the gate)
Command-line download with the Hugging Face CLI:
pip install -U "huggingface_hub[cli]"
huggingface-cli login # only needed for gated FLUX.1-dev
huggingface-cli download black-forest-labs/FLUX.1-schnell ae.safetensors --local-dir .
Verify the SHA-256 against the hash shown on the file’s Hugging Face page before using it.
Installing ae.safetensors by Tool
ComfyUI (Windows, macOS, Linux)
ComfyUI is the reference UI for FLUX. Place the file in the VAE folder:
# Linux / macOS
mv ae.safetensors ~/ComfyUI/models/vae/
# Windows (PowerShell)
Move-Item .ae.safetensors $HOMEComfyUImodelsvae
In the graph, add a Load VAE node and select ae.safetensors from the dropdown, then wire its VAE output into the VAE Decode node before the Save Image node. If you are using the all-in-one FLUX checkpoint (weights + VAE + text encoders in one file) from Comfy-Org, you do not need ae.safetensors separately — the VAE is baked in.
Forge / Automatic1111 / reForge
Put the file in stable-diffusion-webui-forge/models/VAE/ (Forge auto-detects it). In the Forge UI, set UI mode to flux, then in the VAE / Text Encoder selector at the top, pick ae.safetensors alongside the CLIP-L and T5-XXL encoders. Vanilla Automatic1111 does not officially support FLUX; use Forge instead.
SwarmUI / StableSwarmUI
Drop the file into Models/VAE/. Swarm auto-detects FLUX checkpoints and will select ae.safetensors automatically if it is the only FLUX-compatible VAE present.
diffusers (Python)
If you are loading the full FLUX repo from Hugging Face, the VAE is included and you do not touch ae.safetensors directly. To load a standalone ae.safetensors:
from diffusers import AutoencoderKL, FluxPipeline
import torch
vae = AutoencoderKL.from_single_file(
"ae.safetensors", torch_dtype=torch.bfloat16
)
pipe = FluxPipeline.from_pretrained(
"black-forest-labs/FLUX.1-schnell",
vae=vae,
torch_dtype=torch.bfloat16,
).to("cuda")
Check the current diffusers FLUX pipeline docs — the exact class name for the FLUX VAE has changed between diffusers releases, so pin your version.
VRAM and Performance Notes
The VAE itself is tiny (~335 MB in fp16, ~168 MB in fp8) — it is not what makes FLUX heavy. The transformer is the cost driver: FLUX.1-dev is ~23 GB in bf16 and ~12 GB in fp8. On a 24 GB card (RTX 3090/4090) you can run FLUX with the VAE resident; on 12 GB cards you typically offload the VAE to CPU between decode calls.
For a general sense of how much GPU memory diffusion and LLM checkpoints consume, use the Convly VRAM calculator and the best GPUs for local models guide.
Decoding at High Resolution
The FLUX VAE peaks in VRAM at decode time proportional to output resolution. A 2048×2048 decode roughly quadruples the peak versus 1024×1024. If you hit OOM only at the final decode step, enable tiled VAE:
- ComfyUI: replace VAE Decode with VAE Decode (Tiled).
- diffusers:
pipe.vae.enable_tiling()before inference. - Forge: tick Tiled VAE in the settings panel.
Common ae.safetensors Errors
| Error | Cause | Fix |
|---|---|---|
Error while deserializing header: HeaderTooLarge |
Truncated download | Re-download; verify SHA-256 |
| Black / green output image | Wrong VAE (SDXL VAE loaded for FLUX) | Confirm ae.safetensors is selected, not sdxl_vae.safetensors |
Missing key(s) in state_dict |
Loading FLUX VAE into SD 1.5/SDXL pipeline | Use FluxPipeline/AutoencoderKL.from_single_file, not StableDiffusionPipeline |
| File is 335 MB but rejected as invalid | Downloaded HTML gate page instead of file | Accept the license on the model page or use huggingface-cli with a token |
ae.safetensors vs the All-in-One FLUX Checkpoint
You will see two distribution styles on Hugging Face and Civitai:
- Split files (official BFL layout):
flux1-dev.safetensors(transformer) +ae.safetensors(VAE) +clip_l.safetensors+t5xxl_fp16.safetensors. Preferred for diffusers, ComfyUI advanced graphs and finetuning — you can swap the transformer without re-downloading 20 GB of text encoders. - All-in-one (Comfy-Org repackage, e.g.
flux1-dev-fp8.safetensors): every component bundled into one file. Simpler for one-click ComfyUI workflows; you do not needae.safetensorsas a separate file.
Where FLUX Fits in the Broader Model Landscape
FLUX is a local, self-hosted image model. If you are choosing between running it on your own GPU versus calling a hosted image or video API — Sora 2, Veo 3.1, Kling 2.5, Wan 2.5 — the trade-off is fixed hardware cost vs per-second billing. See the self-hosting vs API break-even calculator to estimate the crossover, and the Convly models database for current API pricing across providers.
For text models, similar VAE-style file splits do not apply — LLMs ship transformer weights only. If you are also running local LLMs alongside FLUX, tools like Ollama and LM Studio handle model management the way ComfyUI handles diffusion assets.
Frequently Asked Questions
Is ae.safetensors the same file for FLUX.1-dev and FLUX.1-schnell?
Yes — the VAE architecture and weights are identical between FLUX.1-dev and FLUX.1-schnell. The two repos ship the same ae.safetensors, only under different licenses (schnell is Apache-2.0, dev is non-commercial). You can use either copy interchangeably.
Can I use the SDXL VAE with FLUX to save VRAM?
No. FLUX uses a 16-channel latent space; SDXL uses 4 channels. Loading the SDXL VAE against FLUX latents produces solid-color or noise output, and diffusers will usually raise a shape mismatch error. Use ae.safetensors.
Is ae.safetensors safe to download from third parties?
The safetensors format itself cannot execute code on load, so a corrupt or malicious file cannot pwn your machine the way a pickled .ckpt could. That said, a tampered VAE could produce degraded images. Prefer the official Black Forest Labs repos and verify the SHA-256 hash.
Do I need ae.safetensors if I only use FLUX via an API?
No. Hosted APIs (Replicate, fal.ai, BFL’s own API, Together) run the full pipeline server-side. You only need ae.safetensors when running FLUX locally in ComfyUI, Forge, SwarmUI or diffusers.
Why is it named “ae” and not “vae”?
Black Forest Labs’ internal naming uses “ae” (autoencoder) rather than the more common “vae” label from the Stable Diffusion ecosystem. Functionally it plays the same role: encoding pixels to latents and decoding latents back to pixels. The FLUX autoencoder is technically closer to a plain KL-regularized AE than the SD 1.5 VAE, but every UI treats it as a VAE.
Can I finetune ae.safetensors?
You can, but it is almost never worth it. The VAE is trained on billions of images and finetuning it typically degrades the transformer’s alignment with the latent space, hurting quality. Community FLUX finetunes and LoRAs modify only the transformer and reuse the stock ae.safetensors.
