Nodes/ComfyUI-SocksLatentPatcher/VaceExt4fLatentPatcher
ComfyUI Node

VaceExt4fLatentPatcher

VACE extension that doesn't re-encode its own tail

By synystersocks·Created 11 months ago·Updated 11 months ago· 14
VaceExt4fLatentPatcher
  • NewSamples
  • PreviousSamples
  • LATENT
PrevGenFramesLength65

VACE is Alibaba's video extension framework for Wan, and the standard way to grow a clip past its native context is to feed the tail of what you have into VACE as the reference for the next chunk. That means the tail gets VAE-decoded to pixels, pushed through VACE's encode path, and re-compressed. Every cycle of that decompress/recompress round-trip costs you: a temporal compression of 4 means four frames get condensed into one latent frame, and when you re-inflate it, the color and detail have shifted. Do it twenty times and your video slowly bleaches itself.

VaceExt4fLatentPatcher is the "don't" version of that - it carries the tail across in latent space instead of pixel space. It's the 4-frame variant of three VACE patchers in synystersocks' ComfyUI-SocksLatentPatcher pack, and it's the lightest of the bunch.

What it actually does

Same shape as its siblings: it sits between the last KSampler of the previous generation and the first KSampler of the next, takes the previous latent, and stamps the tail into the reference slots of the new latent. Where the I2V patcher only touches a single reference frame, this one fills two leading latent frames with the tail of the previous generation - the author's framing is that it patches the last 4 frames of the previous clip in latent space. The code itself is pure tensor assignment: it reads index (PrevGenFramesLength - 1) // 4 (the last latent frame, given Wan's 4x time compression) and copies those values into the new latent's leading frames. No decode, no encode, no sampling - just a copy with a specific address book.

The inputs that matter

  • PreviousSamples - the LATENT from the last KSampler of the previous generation. This is where the tail gets read.
  • NewSamples - the latent you'd otherwise feed the next generation's first KSampler. It gets patched in place (well, in a copy of it).
  • PrevGenFramesLength (default 65, range 1–257, step 4) - the frame count of the previous generation. The tail-finder math depends on it, so set it to the actual length of the segment you're extending from.

The output is a single LATENT that feeds the next KSampler.

Install

No dependencies beyond what ComfyUI already has - no requirements.txt, no models to fetch. ComfyUI Manager, search "SocksLatentPatcher", or:

cd ComfyUI/custom_nodes
git clone https://github.com/synystersocks/ComfyUI-SocksLatentPatcher

Restart, done. The VACE checkpoint (e.g. Wan2.2-VACE-Fun-A14B GGUF quants, which is how the author runs it on 8GB) is your existing VACE setup, not part of this pack.

Where people get burned

Which patcher you pick needs to match what your VACE model expects for reference context. The 4f is the lightest touch and the natural starting point - lower reference cost, less to stabilize. But the author is upfront that all three VACE patchers "work decently for motion transfer yet require different parameters to stabilize," and the pack ships separate example workflows per variant for a reason. If you're new to VACE extension, use the matching workflow from the repo (i2vToVace examples) rather than swapping patchers blindly.

Also: the whole pack is EXPERIMENTAL WIP, and it's not a speed tool - the author's demo ran on an 8GB 3060 Ti and took two and a half hours. Its job is keeping the seam clean across a VACE extension chain, not making the chain quick. And note the tail isn't free of pixel-space work: the conditioning side of the workflow still decodes frames for VACE's conditional inputs; the patcher overwrites the latent reference on top of that, so you don't have to choose between the two paths - they coexist.

Categorylatent/video

Inputs (3)

NameTypeDefaultDescription
NewSamplesLATENT
PreviousSamplesLATENT
PrevGenFramesLengthINT651–257

Outputs (1)

NameTypeDescription
LATENTLATENT