Empty SDXL Flux2 Latent
The Empty Latent That Lets SDXL Run on a Flux2 VAE
- LATENT
This node exists for one very specific reason: some SDXL checkpoints have been retrained to work with FLUX.2's VAE, and ComfyUI's normal empty latent quietly doesn't fit them. If you're loading one of those checkpoints - the NoobAI Flux2VAE line, continued as Mugen - this is the only node in the pack, and it's the one you actually need.
What's going on with "SDXL Flux2VAE" anyway
In December 2025, Anzhc and the Cabal Research crew dropped a proof of concept: an SDXL-base UNet (NoobAI) retrained natively to use the FLUX.2 autoencoder instead of SDXL's own. That's a bigger deal than it sounds. FLUX.2's VAE, which Black Forest Labs released standalone under Apache 2.0, encodes to a 128-channel latent - four times the depth of SDXL's 4-channel space, stored "packed" as 32 channels at half resolution. SDXL was never built for it, so running these checkpoints in stock ComfyUI is a shape mismatch on every boundary: the sampler, the VAE encode/decode, even the live preview.
That mismatch is what this pack patches. On import it registers an SDXL_flux2 model class inside ComfyUI, wraps the VAE loader, and monkeypatches the UNet's forward pass to pixel-shuffle between the 128-channel packed latents and the 32-channel latents the SDXL UNet actually eats. Flux2 and Klein behavior is left untouched - the patch only kicks in when it detects a Flux2VAE checkpoint. Installing the pack is the whole installation; it patches automatically.
Where the node fits
The sampler needs a blank starting latent. Stock EmptyLatentImage hands out 4-channel tensors, which is fine for ordinary SDXL and useless here - the patched KSampler path has to rescue a wrong channel count and can even trigger an unintended 0.5x resize via ComfyUI's downscale_ratio_spacial hints (that's exactly the legacy hint the pack strips out). EmptySDXLFlux2LatentImage skips the whole drama by producing the correct 32-channel latent at height/8 × width/8 directly. Wire its LATENT output straight into a KSampler's latent input, then VAE Decode as usual.
Only three inputs, and you'll set two:
- width / height - INT, default 1024, step 16, range 16–16384. Multiples of 16 matter; the latent is one-eighth of these on each side.
- batch_size - INT, default 1.
That's it. It's a one-output utility node, not a magic box.
Installing it
ComfyUI Manager (search "SDXL-Flux2VAE-ComfyUI-Node") or the plain route:
cd ComfyUI/custom_nodes
git clone https://github.com/Anzhc/SDXL-Flux2VAE-ComfyUI-Node
Then restart ComfyUI. No pip dependencies, no model downloads - the node itself is a few hundred lines that subclass comfy.latent_formats.Flux2, so you need a reasonably current ComfyUI with Flux2/Klein support. The checkpoints themselves come from HuggingFace (CabalResearch/NoobAI-Flux2VAE-RectifiedFlow, later CabalResearch/Mugen), not from this repo.
Troubleshooting
- "Flux2 latent format is not available in this ComfyUI build" on startup - update ComfyUI. The pack can't run without the Flux2 latent format to subclass.
- Grainy, fuzzy, noisy output - check the model card before you blame the node. This is an explicitly undertrained, budget-starved experiment ("expect output on the level of very early anime models"), and the model card says so in plain words.
- Wrong-looking colors or bad hands with the RF variants - these checkpoints are rectified flow, so the usual SDXL sampler wisdom goes out the window: skip Karras schedules, use Euler / Euler A / DPM++ SDE, 20–28 steps, CFG 6–9.
- Don't reach for this node with a normal SDXL checkpoint. A 32-channel empty latent fed to a stock SDXL model is just wrong - it's purpose-built for the Flux2VAE line, nothing else.
If the whole concept (128-channel packed latents, SDXL retrofitted onto a flow VAE) sounds like a science project, that's because it is - a genuinely clever one, and the door it opens is SDXL-speed generation with modern VAE depth.
Inputs (3)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 102416–16384 | — |
| height | INT | 102416–16384 | — |
| batch_size | INT | 11–4096 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |