ComfyUI Node

TTM Latent Add

The quiet glue that carries your reference into sampling

By GiusTex·Created 9 months ago·Updated 5 months ago· 8
TTM Latent Add
  • latent
  • reference_latents
  • ref_masks
  • latent
ttm_start_step0
ttm_end_step3

TTM Latent Add doesn't generate anything, and that's the point. In a TimeToMove workflow, the sampler never talks to the reference video directly - it only sees a latent with a bunch of extra data stuffed inside. This node is what stuffs it in.

TimeToMove (TTM), for context: you give Wan 2.2 a crude driving video of the motion you want (a cutout of your subject puppeteered through a scene in After Effects or whatever), plus a mask of the subject, and Wan re-renders it as a smooth photoreal clip that tracks that motion. This is the middle node of GiusTex's native-ComfyUI port of Kijai's WanVideoWrapper TTM nodes. It takes the reference latents from Encode WanVideo, a mask, and a step window, and bundles all of it into the latent dict that TimeToMove Guider will later read.

How it works

Mechanically it's a packer. It copies the reference latents into the latent dict under ttm_reference_latents, downscales your mask to match the latent resolution (by a factor of 8, or 16 if the reference latent has 48 channels - the 16x VAE variant), and stores the ttm_start_step/ttm_end_step window. When the guider runs, it reads those keys and injects the reference during denoising. That's the entire data path: encode → pack → guide.

Inputs and outputs

All four are required, plus a fifth:

  • latent - the base generation latent (in the example workflow it comes from a first-frame/last-frame node). This is the latent that actually gets sampled.
  • reference_latents - the output of Encode WanVideo. "Reference image to encode," per the tooltip.
  • ttm_start_step (default 0) - first step where the reference gets injected.
  • ttm_end_step (default 3) - the step where injection stops. This is the knob that decides how strongly the reference's motion dictates the output: a wider window means the whole sequence hews to the driving video; a narrow one is a light touch.
  • ref_masks - the motion mask, and notice it's required, not optional. You need an actual mask covering the subject (the example workflow loads a mask video and runs it through an ImageToMask node). No mask, no TTM - don't leave it dangling.

Output: one latent, which splits to both TimeToMove Guider's latent input and the sampler's latent input.

Installing

Same as its siblings - zero third-party deps in this pack:

cd ComfyUI/custom_nodes
git clone https://github.com/GiusTex/ComfyUI-Wan-TimeToMove.git

Restart ComfyUI and the nodes appear under "Wan22 TimeToMove" (ComfyUI Manager works too, by pack title). You supply the Wan 2.2 model, VAE and text encoder; the example workflow additionally leans on ComfyUI-MoreEfficientSamplers for the CFG scheduler and Kijai's WanVideoWrapper for the first/last-frame node, but none of that is needed just to run this node.

Where people get burned

  • Forgetting ref_masks. It's in the required list, so the node won't even validate without it, but it's the easiest thing to overlook when you copy a workflow. The mask defines what region gets animated; get it wrong and the reference bleeds across the whole frame.
  • ttm_end_step below ttm_start_step. The node raises a hard ValueError telling you exactly that. It's a sanity check, not a mystery crash.
  • Treating this as the sampler input. The latent this outputs is also what you feed the sampler - the reference data rides along invisibly. If you wire the sampler to your original latent instead, TTM silently never happens, because the packed keys never reach the guider.
CategoryWan22 TimeToMove

Inputs (5)

NameTypeDefaultDescription
latentLATENTwanvideo latent
reference_latentsLATENTReference image to encode
ttm_start_stepINT00–1000Start step to apply TTM latent guide
ttm_end_stepINT31–1000The step to stop applying TTM
ref_masksMASKReference mask to encode

Outputs (1)

NameTypeDescription
latentLATENT