Nodes/Skoogeer-Noise/Latent Packed Slot Transform
ComfyUI Node

Latent Packed Slot Transform

Deliberately glitch a Flux-style packed latent

By ttulttul·Created 9 months ago·Updated 3 months ago· 14
Latent Packed Slot Transform
  • latent
  • mask
  • latent
operation
patch_size2
base_channels0
seed0
mix1.00
match_statsfalse

Some latents are "packed": before the model sees them, the tensor is space-to-depth rearranged so that each 2×2 block of spatial pixels becomes four extra channels. That's exactly what Flux.2's VAE does at its final downscale - 128 channels at 1/16 resolution, where 32 base channels × 4 slots make up the bundle. This node exists to do surgery on those slots. It permutes, rotates, or flips the P×P slots inside the channel dimension, producing deliberate digital artifacts: macro-blocking, moiré, checkerboard shimmer, chromatic-aberration-style shifts.

Why would you want that? Because "glitch" is a texture, and a genuinely structural one at that. The modes here give you different flavors of digital wrongness that survive the decoder much more coherently than random noise:

  • shuffle - randomly permutes slot ordering per base channel. The flagship glitch: digital macro-blocking, moiré micro-shifts, checkerboard artifacts.
  • rotate_cw / rotate_ccw - rotates the slot grid 90° either way. Directional, structured aliasing; pair them to create oscillation.
  • flip_h / flip_v - mirror the slots left-right or top-bottom. Chromatic-aberration-like shifts on horizontal, "digital shimmer" on vertical.

The inputs that matter

  • operation - the five modes above; shuffle is where you'll spend most of your time.
  • patch_size (default 2) - P for the P×P slot layout. 2 matches Flux.2's VAE packing; you'll rarely need anything else.
  • base_channels (default 0) - channels before packing, with 0 meaning "infer from the latent." Only set this if you're feeding something non-standard.
  • mix (1.0) - the crucial safety dial: 0 = original, 1 = full slot transform. Backing this off to 0.3–0.5 is how you get a hint of glitch rather than a full corruption event.
  • match_stats - restores per-channel mean/std after the transform. This is the "make the glitch look intentional" toggle; leave it off for raw chaos, on for something that sits in the image without blowing out its statistics.
  • seed for reproducible shuffles, optional mask to localize the corruption.

Output is a single LATENT, same shape as the input.

Installing and using it

Part of the Skoogeer-Noise pack - ComfyUI Manager, search "Skoogeer-Noise", or:

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

Restart ComfyUI. Deps are torch, numpy, einops, pyyaml, nothing to download.

The trap to avoid

The obvious trap is feeding it an unpacked latent. This node expects the packed form - the patch_size/base_channels combo is the layout, and if your latent is a normal (B, 32, H, W) SD-style tensor it isn't slot-organized the way this node assumes. That's also why it pairs so naturally with the Flux.2 nodes in this pack: if you're working on Flux.2, this slot transform is the one channel-space op you can run without unpatchifying first, because it's designed to operate on exactly that packed representation. For everything else in the pack (mesh drag, the fractal noises, channel linear transforms), the README's rule applies: Unpatchify Flux.2 Latent → op → Patchify Flux.2 Latent, or you get artifacts from acting on 2×2 patch blocks as if they were true neighbors.

One more practical note: at mix 1.0 with shuffle, the output can be extremely broken - that's the feature, but it's also why mix and match_stats exist. Start at mix 0.4, match_stats on, and dial up until the corruption reads as intentional. And remember this pack's channel transforms were originally built for the author's FlowMatching upscaler experiments, so don't be shy about treating them as an aesthetic toolbox rather than "correct" image processing - the whole pack is a sandbox for latent-level weirdness.

Categorylatent/channel

Inputs (8)

NameTypeDefaultDescription
latentLATENTPacked latent to transform per space-to-depth slot.
operationCOMBOSlot-space operation to apply.
patch_sizeINT21–8Patch size used in the packed latent (P for PxP).
base_channelsINT00–4096Base channels before packing. 0 infers from the latent.
seedINT00–18446744073709550000Seed for deterministic slot shuffles.
mixFLOAT1.000–1Blend factor for the transformed slots (0=off, 1=full).
match_statsBOOLEANfalseMatch per-channel mean/std after the transform (stabilizes latent stats).
maskoptMASKOptional mask to limit the transform to masked areas.

Outputs (1)

NameTypeDescription
latentLATENT