Nodes/10S-Comfy-nodes/πŸ‘» Latent Temporal Inpainter
ComfyUI Node

πŸ‘» Latent Temporal Inpainter

Resampling your upsampled video turns interpolated frames into ghosts β€” this fixes them frame by frame

By TenStripΒ·Created 4 months agoΒ·Updated 26 days agoΒ· 244
πŸ‘» Latent Temporal Inpainter
  • latent
  • latent
β—„anchor_sigma0.05β–Ί
β—„ghost_sigma0.35β–Ί
β—„score_gamma2.00β–Ί
β—„anchor_blend0.40β–Ί
β—„seed0β–Ί
β—„debug_scoresfalseβ–Ί

When you temporally upsample a latent from 24 to 30fps, the new frames are interpolations - and LTX has a specific opinion about them. Give the whole clip a uniform denoise pass to "fix" those interpolated frames and the model regenerates at its native 24fps cadence anyway, retiming your content. Give it no denoise and the interpolated frames stay mushy, ghosted, half-formed. The standard approaches are both wrong for this problem.

LatentTemporalInpainter takes the smarter route: it works out which frames are ghosts, adds noise only to those, and locks the real anchor frames so the corrective sampler barely touches them. It's the difference between a blanket resample and surgery.

How it detects ghosts

The detection is elegant and cheap. A frame that was linearly interpolated satisfies f[t] β‰ˆ (f[t-1] + f[t+1]) / 2 almost exactly - that's what interpolation is. A real frame has high residual error against that prediction. So the node computes:

residual[t] = |f[t] - (f[t-1] + f[t+1])/2|
ghost_score[t] = 1 - normalized(residual)   # 1 = ghost, 0 = real

Then it builds a per-frame noise schedule: real frames get anchor_sigma (0.05, nearly untouched), ghosts get ghost_sigma (0.35, substantially re-noised). The output latent carries a noise_mask marking exactly the ghost frames, so LTX's inpainting sampler focuses its correction there. Edge frames are always treated as real - a deliberate, sensible default.

The dials

  • anchor_sigma (0.05) - noise floor for real frames. Low = anchors stay put.
  • ghost_sigma (0.35) - noise for ghost frames. Higher = more aggressive correction, but too high invites the model to retime content.
  • score_gamma (2.0) - how concentrated the treatment is. Raise to 3-4 for heavily upsampled latents with severe artifacts; drop below 1 to flatten so even mild ghosts get corrected.
  • anchor_blend (0.4) - re-blends real frames back toward their original state after injection, reinforcing the temporal locks.
  • seed - reproducibility for the injected noise.

The follow-up sampler is half the recipe

The node's description isn't shy about it: follow with KSampler at denoise 0.30-0.45, not 0.7. At 0.7 the model gets too much freedom and re-times your content - the exact failure this node exists to prevent. Ten to twenty steps is plenty. The noise_mask in the output latent guides the sampler to the ghosts and leaves the anchors alone.

Where it sits

It's the cleanup stage of the recommended fast-motion pipeline: KSampler @ 24fps β†’ Sharpener β†’ TemporalUpsampler β†’ TemporalInpainter β†’ KSampler (0.30-0.45 denoise) β†’ decode. Pure latent-space, no model changes, works on any LTX 5D latent.

Install is the pack-wide clone (10S_Nodes into custom_nodes, restart, or ComfyUI Manager β†’ "10S-Comfy-nodes"), no extra dependencies. If your 30fps upscale looks like it's haunted by half-formed frames, this is the exorcism.

Category10S Nodes/Latents

Inputs (7)

NameTypeDefaultDescription
latentLATENTβ€”
anchor_sigmaoptFLOAT0.050–0.3β€”
ghost_sigmaoptFLOAT0.350.05–0.8β€”
score_gammaoptFLOAT2.000.01–5β€”
anchor_blendoptFLOAT0.400–1β€”
seedoptINT00–2147483648β€”
debug_scoresoptBOOLEANfalseβ€”

Outputs (1)

NameTypeDescription
latentLATENTβ€”