Nodes/comfyui-glitch-lab-sampler/Latent Frame Interleave
ComfyUI Node

Latent Frame Interleave

Latent Frame Interleave shuffles your video's frames

By HitmanLoges·Created 3 months ago·Updated 3 months ago· 0
Latent Frame Interleave
  • latent
  • LATENT
intensity0.00
seed0

The video half of the glitch-lab pack is a single node with a brutally simple job: reorder the frames of your latent video before it gets decoded, so the output jumps and stutters in ways no model would ever generate on its own. It's the tool for "frame-salad" motion - the glitchy, VHS-headache look that makes a clip feel like the timeline was edited by someone having a seizure.

What it does, and how

LatentFrameInterleave takes a LATENT and returns a LATENT. It permutes the temporal axis (dim 2) of a 5-D (B, C, T, H, W) video latent - that's ComfyUI's native layout for Wan, LTX, and other direct video models. The output plugs between your sampler's latent output and VAEDecode, so what you see is genuinely out-of-order frames, not a filter painted on top.

Two modes, one intensity slider (0–1):

  • 0 to 0.5 - adjacent-pair swaps, each with probability 2 × intensity. Low settings give a subtle stutter, like frames hiccuping. This is the gentle end; useful if you want a flicker rather than a meltdown.
  • 0.5 to 1 - block-shuffle. Frames get cut into chunks of max(2, T × (1 − intensity)) and the chunks are reordered. High intensity = full temporal scramble.

And intensity 0 is identity - the latent passes through untouched. That's more useful than it sounds: it means one workflow can serve both stills and video, with the interleave switched off or on.

seed makes the shuffle reproducible, same as everywhere else in the pack. There are video presets in the repo - crawl, block-shuffle, frame-salad - at increasing intensity, if you want starting points instead of guessing.

The trap: which video layout are you on?

Here's where people get burned, and it's a real one, because it's historical. ComfyUI has two completely different video-latent layouts:

  • Native video models (Wan, LTX): 5-D (B, C, T, H, W) - time is its own axis. This node handles those natively.
  • AnimateDiff-Evolved: 4-D (B*T, C, H, W) - the batch axis is frames, there is no temporal axis.

The node's rule is simple: 5-D tensors get reordered, 4-D tensors pass through unchanged. Drop it on an AnimateDiff workflow and it silently does nothing - no error, no effect, just a confused hour wondering why your video isn't glitching. The README is upfront that AnimateDiff's layout is out of scope and tells you to reshape before the node. So if you're on AnimateDiff, either bring the latent into a 5-D shape first or find another tool.

Worth knowing: v0.1 had the axis wrong - it operated on channels instead of time, so it destroyed stills by shuffling channel data. That's fixed in v0.2 (now dim=2, with a test asserting per-channel sums survive interleaving), so git pull if you cloned early.

Install and notes

Ships with the comfyui-glitch-lab-sampler pack - same install as the rest, and still no extra Python dependencies:

cd ComfyUI/custom_nodes
git clone https://github.com/HitmanLoges/comfyui-glitch-lab-sampler.git

Restart, and it's under the glitch-lab category (ComfyUI Manager finds it by the pack title too).

A couple of practical notes. Start small - 0.1–0.2 intensity is a stutter, 0.6+ is a full scramble, and there's a lot of interesting space between. And like the rest of the pack, this is a diffusion-era tool: no flow-model support yet, so if you're glitching Wan output this node is fine as a post-sampler shuffle, but the README's jitter/dropout siblings won't behave on flow models. The node is lightweight, runs in milliseconds, and is honestly the most approachable entry point in the pack - worst case at intensity 0 it's a pass-through that costs you nothing.

Categoryglitch-lab

Inputs (3)

NameTypeDefaultDescription
latentLATENT
intensityFLOAT0.000–1
seedINT00–4294967295

Outputs (1)

NameTypeDescription
LATENTLATENT