LongCat VAE Loader
The 16-channel VAE that LongCat's edit flow insists on
- vae
LongCat rides a Flux-style autoencoder: 16 latent channels instead of the 4 you're used to from SD and SDXL, still 8× downsample per side. That's why you can't just reach for the VAE you already have in ComfyUI. LongCatVAELoader loads the actual LongCat VAE and wraps it so the rest of the pack knows how to talk to it.
The wrapper matters more than you'd think. It reads the latent-channel count and the scale factor off the VAE config and exposes them, and the sampler in this pack checks specifically for this wrapper - if your edit conditioning carries reference images but you fed it a plain ComfyUI VAE instead, LongCatSampler raises a ValueError rather than silently producing garbage. Feeding a 4-channel VAE into a 16-channel model would give you noise or flat color anyway, so the check is doing you a favor.
Inputs are the loader trio: model_name (a dropdown populated from your models/vae folder - it expects a diffusers-format directory with a vae/ subfolder), dtype (default bf16; drop to fp16 on pre-Ampere GPUs), and device (auto or cpu). Output is a single vae socket.
Where does it plug in? Two places. Most obviously into TextEncodeLongCatImageEdit, which requires a VAE whenever you pass reference images - leave it disconnected with images attached and you get an immediate error. And the VAE rides along inside the conditioning to the sampler, which uses it to encode your reference image into the image latents that get concatenated into the denoise loop. For pure text-to-image you don't strictly need it, but the moment you add a reference, it's mandatory.
One nice touch: the pack bundles a VAE config, so the loader can build the model from config and stuff a single-file .safetensors into it even if you didn't grab a full diffusers folder. Missing or unexpected keys get printed as a warning rather than killing the load - usually fine, but glance at the console the first time you load.
The usual install caveats apply (git clone into custom_nodes, pip install -r requirements.txt, restart). Weights aren't bundled - you download the LongCat VAE from the model's Hugging Face page and drop it where models/vae can see it. And a reminder that this pack is a young port: as of now there's no decode node exposed, so the VAE's decode side is used by the pipeline internals, but a graph of these nodes ends at a latent until the roadmap catches up.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| model_name | COMBO | 0 options: | |
| dtype | COMBO | bf16 | 3 options: bf16, fp16, fp32 |
| device | COMBO | 2 options: auto, cpu |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| vae | VAE | — |