Patchify Flux.2 Latent
Put a Flux.2 latent back into its 128-channel packing
- latent
- LATENT
Flux.2's VAE does something unusual at its final downscale step: instead of giving you a plain (B, 32, H, W) latent like SD and SDXL, it patchifies - a space-to-depth rearrange that folds each 2×2 block of spatial pixels into four extra channels. The result is a (B, 128, H, W) latent at 1/16 spatial resolution. That's the format the Flux.2 model actually consumes, and it's the reason this pair of nodes exists. This one is the "put it back" half.
The problem this solves: most latent-space operations in this pack (mesh drag, fractal noise, channel transforms) work on spatial neighborhoods - they assume adjacent pixels in H×W are truly adjacent. In a patchified Flux.2 latent they aren't; neighbors across a 2×2 patch boundary live in different channels, not adjacent pixels. Run a noise node straight on packed latents and you get 2×2 block artifacts and wrong spatial correlations. The fix is the pattern the README is explicit about:
Unpatchify Flux.2 Latent -> (your latent ops) -> Patchify Flux.2 Latent
Unpatchify Flux.2 Latent expands the 128-channel packed form into a 32-channel latent at double spatial resolution - (B, 128, H, W) → (B, 32, H*2, W*2) - where your noise/warp nodes finally see true neighbors. You do your thing. Then this node runs the inverse: (B, 32, H, W) → (B, 128, H//2, W//2), restoring the standard Flux.2 format the model and downstream nodes expect.
The inputs and expectations
One input: latent, the unpatchified latent to return to 2×2 patch form. One output: LATENT. It's the simplest node in the pack on paper - and it's the one you must not skip.
Two hard requirements from the source: the input must be 4D (or 5D video, handled frame-by-frame) with exactly 32 base channels for the patchify path, and the spatial height/width must be divisible by the patch size (2). Get it wrong and it raises a clear error rather than silently corrupting - which is the good kind of failure. If you're feeding it an unpatchified latent that came from anything other than the matching Unpatchify Flux.2 Latent, check your channel count first.
Installing and using it
Part of Skoogeer-Noise. ComfyUI Manager → search "Skoogeer-Noise", or:
cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise
Restart ComfyUI. No model downloads; deps are torch, numpy, einops, pyyaml - the patchify math itself is a one-liner rearrange on top of einops.
The honest framing
Flux.2 is the 32B-class model that wins benchmarks but demands big hardware - the KB panel for it notes it landed needing 18–24GB VRAM even quantized, and the lighter Klein variants changed the adoption math. If you're on Klein or Dev, this pair of nodes is mandatory for the rest of this pack: every latent noise or warp node in Skoogeer-Noise assumes spatial latents, and Flux.2's packed form will fight you otherwise. Worth one sanity check when you're troubleshooting: if your "blocky, pixelated" Flux.2 output persists even with the wrapper in place, confirm both nodes are actually on the path - a bypassed Unpatchify is a classic silent cause, because the op still runs, it just runs on the wrong layout.
Inputs (1)
| Name | Type | Default | Description |
|---|---|---|---|
| latent | LATENT | Unpatchified Flux.2 latent to patchify back to 2x2 format. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| LATENT | LATENT | — |