Nodes/IAMCCS-nodes/LTX-2 First/Last ? Latent (noise_mask) ??
ComfyUI Node

LTX-2 First/Last ? Latent (noise_mask) ??

Lock your start and end frames inside the latent

By IAMCCS·Created 11 months ago·Updated 7 days ago· 113
LTX-2 First/Last ? Latent (noise_mask) ??
  • vae
  • latent
  • first_image
  • last_image
  • middle_frames
  • latent
  • report
first_strength1.00
last_strength1.00

This is the latent-level first/last-frame lock, and it's the one that actually does the work in LTX-2 extension workflows. Where FirstLastFramesController edits the image conditioning tensor, this node VAE-encodes your start and end frames straight into the latent samples and sets a noise_mask so the sampler has to preserve them. That's the mechanism that makes "continue from this exact frame" stick. It's IAMCCS's native equivalent of TTP's LTXVFirstLastFrameControl_TTP - same idea, clean-room reimplementation, and it slots into the IAMCCS extension pipeline that the helper-module chain uses for reanchoring.

How it works

The core is a two-step trick. First, your first_image / last_image get VAE-encoded and injected into the head and tail of the latent's temporal dimension. Then - this is the part that matters - the corresponding noise_mask region is set to 1 - strength, so at sampling time those latent slots are partially locked to the encoded frames rather than re-noised from scratch.

  • first_strength and last_strength (default 1.0) control the lock: 1.0 fully replaces and locks, 0.5 blends, 0 does nothing. This is the "how hard do I pin this frame" dial.
  • The first_image/last_image references get collapsed to a single frame if you pass a multi-frame batch - the node is built to lock one frame per end, even though the frames you feed it (like the pack's 8n+1 start frames) often arrive as a stack.
  • There's also an optional middle_frames input (anytype): a small accumulator of {image, position, strength} entries for locking frames in the middle of the clip - niche, but it's how you pin a specific beat without running three copies of the node.

Output is the modified latent (with noise_mask) and a report STRING. The report is honest: if no images are connected, it returns the latent untouched and says no-op.

The inputs and outputs that matter

  • vae and latent - the encode target and the latent to modify.
  • first_image / last_image (optional) - your anchors.
  • first_strength / last_strength - lock strength per end.

That's the whole set for 95% of usage: wire your empty latent, connect your start frame to first_image, set strength ~1.0, and sample. The latent output then goes to your sampler.

Installing it

Ships in IAMCCS-nodes. ComfyUI Manager → "IAMCCS" → install, or:

cd ComfyUI/custom_nodes
git clone https://github.com/IAMCCS/IAMCCS-nodes.git

Restart ComfyUI, under IAMCCS/LTX-2. It needs your LTX VAE (which you have if you're running LTX) and comfy.utils - both present in any stock ComfyUI.

Common issues

The classic mistake is connecting this after the sampler instead of before - it must run on the latent before sampling so the noise_mask takes effect during the denoise. Second: a noise_mask set to 1 - strength is only respected if your downstream sampler path actually uses the mask; SamplerCustomAdvanced does, but a pipeline that rebuilds the latent from samples alone will drop it. And if you see the start of your clip "frozen" or over-constrained - the video stuck on the anchor frame for a beat - that's over-locking, which is exactly the problem the _Pro variant's slot caps were built to fix. If that's biting you, use FirstLastLatentControl_Pro.

CategoryIAMCCS/LTX-2

Inputs (7)

NameTypeDefaultDescription
vaeVAE
latentLATENT
first_strengthFLOAT1.000–1
last_strengthFLOAT1.000–1
first_imageoptIMAGEOptional first frame image
last_imageoptIMAGEOptional last frame image
middle_framesopt*Optional middle-frame accumulator (anytype)

Outputs (2)

NameTypeDescription
latentLATENT
reportSTRING