Nodes/Skoogeer-Noise/Unpatchify Flux.2 Latent
ComfyUI Node

Unpatchify Flux.2 Latent

The one node to put in front of every Flux.2 latent edit

By ttulttul·Created 9 months ago·Updated 3 months ago· 14
Unpatchify Flux.2 Latent
  • latent
  • LATENT

If you've ever thrown noise, blur, or any spatial op at a Flux.2/Klein latent and gotten crisp 2x2 blocky artifacts where the edit should be smooth - this node is why, and it's the fix. Unpatchify Flux.2 Latent is a straight-up shape converter from Skoogeer-Noise that unpacks Flux.2's patchified latents into the plain spatial form that latent-space nodes actually expect.

What "patchified" even means

Flux.2's VAE does something older VAEs don't. SD and Flux.1 latents are just (B, C, H, W) at 1/8 resolution - neighboring pixels in the latent are neighboring pixels in the image. Flux.2's VAE adds a final space-to-depth step: at the last downscale it packs each 2x2 block of latent pixels into the channel dimension. The result is a 128-channel latent at 1/16 resolution (32 base channels × 2×2). It's the same information, just arranged so the transformer's attention can see it.

That's great for the model and quietly terrible for anyone doing latent-space edits. Blur, noise, swirls, and channel ops work on spatial neighborhoods - but in a patchified latent, the four values that should be neighbors of each other live in four different channels. So every 2x2 block gets treated as one unit, and you get block artifacts and wrong spatial correlations instead of an edit.

What the node does

Under the hood it's an einops rearrange - depth-to-space in disguise:

# (B, 128, H, W) -> (B, 32, H*2, W*2)
rearrange(z, "... (c pi pj) i j -> ... c (i pi) (j pj)", pi=2, pj=2)

It takes your Flux.2 latent, unpacks the patches back into real spatial resolution, and hands you a normal-feeling latent you can run any latent op on. It handles 5D video tensors too, unpacking frame-by-frame. The output is the same dictionary with "samples" replaced, so other latent keys survive the trip.

Inputs and outputs

There's exactly one input and one output here, which makes this node refreshingly hard to misconfigure:

  • latent (LATENT) - the patchified Flux.2 latent, straight off your VAE. Per the author's own tooltip: "Flux.2 latent to unpatchify from 2x2 patch format."
  • Output LATENT - the same latent at double spatial resolution, ready for noise/blur/channel nodes.

Wire it like this: VAE Encode → Unpatchify Flux.2 Latent → (your latent ops) → Patchify Flux.2 Latent → KSampler. The pair is a wrapper; you never skip one without the other.

Installing it

It ships in the Skoogeer-Noise pack, which is a grab-bag of latent/image/conditioning perturbation nodes. Install via ComfyUI Manager (search "Skoogeer-Noise"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/ttulttul/Skoogeer-Noise
# restart ComfyUI

Dependencies are torch, numpy>=1.26, einops>=0.7, and pyyaml>=6.0.3 - ComfyUI already brings most of those. No model downloads, nothing heavy. If einops is somehow missing you'll get an import error on load; pip install einops sorts it.

Where people get burned

  • Forgetting the return trip. Patchify back to 128 channels before the sampler. Feed a 32-channel latent to a Flux.2 KSampler and you'll hit a shape error or garbage. The two nodes are a matched set.
  • Feeding it the wrong latent. Unpatchify hard-checks for exactly 128 channels and raises a clear ValueError otherwise. SD, SDXL, and Flux.1 latents aren't patchified - don't route them through this, there's nothing to undo.
  • Chasing artifacts that aren't artifacts. If your latent edit already produced blocks, that ship has sailed; re-running the same edit after unpatchifying is the cure for next time.

Is this pack the most famous thing in the ecosystem? No. But this specific node solves a real, recurring Flux.2 pain with zero knobs, and it's worth grabbing just for it.

CategoryLatent/Flux

Inputs (1)

NameTypeDefaultDescription
latentLATENTFlux.2 latent to unpatchify from 2x2 patch format.

Outputs (1)

NameTypeDescription
LATENTLATENT