Nodes/ComfyUI-LTX-Attention-Toolkit/LTX Attn — RF-Inv Forward (x0→xT)
ComfyUI Node

LTX Attn — RF-Inv Forward (x0→xT)

Take a clean video to noise, controllably

By g-raw·Created 3 months ago·Updated 2 months ago· 2
LTX Attn — RF-Inv Forward (x0→xT)
  • model
  • latents
  • positive
  • negative
  • inverted_latents
  • source_latents
steps30
cfg1.00
eta0.80
eta_trendconstant
start_step0
end_step30
schedulersimple
seed0

If you've ever wanted to edit an AI-generated video rather than regenerate it, you need inversion - running a clip forward through the model to find the noise it came from, so a later generation can be steered back toward it. RF-Inv Forward is the "add the noise" half of that, built for LTX-2.3's rectified-flow architecture. Feed it a clean latent, and it runs the model backwards along the denoising direction, turning x0 into xT - the noise state from which the original video would be sampled.

Rectified flow (the family LTX-2.3 and most 2026 models belong to) trains the model to predict a velocity along a near-straight line from noise to image. That near-straight trajectory is exactly what makes inversion practical: the forward pass is just Euler integration in reverse, and the pack adds a strength-scaled "pull toward the source" term - the eta - that keeps the inverted latent faithful to your starting clip. Higher eta = tighter reconstruction; lower = more freedom for the edit later.

How it works

It flips the sigma schedule (small→large), disables noise injection (sample_custom with a zero noise tensor), and runs Euler forward: at each step it denoises, derives the velocity v, steps up in noise, and - during the [start_step, end_step) window - injects eta × (source − x0_est) to drag the trajectory toward your clip. The eta_trend shape schedules that strength: constant, or ramping up/down (linear_increase/linear_decrease). There's also a smoothstep warmup so the correction term fades in instead of slamming in on step one - which the code comments explicitly note avoids a "shock" when the RF term first kicks in.

The two LATENT outputs: inverted_latents (the xT you feed to the Reverse sampler) and source_latents (a passthrough copy of your input, for convenience).

The inputs that matter

  • latents - the clean video latent you want to invert.
  • steps, scheduler - 30 and simple defaults are fine; this is not the place to get fancy with schedulers since flow trajectories don't need much shaping.
  • cfg - default 1.0. LTX-2.3 (especially distilled) runs guidance-free; CFG above 1 here mostly wastes time.
  • eta (default 0.8), eta_trend, start_step/end_step - the inversion strength knobs. Tune eta first.
  • positive/negative, seed - conditioning and reproducibility.

Install

cd ComfyUI/custom_nodes
git clone https://github.com/g-raw/ComfyUI-LTX-Attention-Toolkit.git

Restart ComfyUI. No extra dependencies beyond ComfyUI's own torch/numpy. This sampler is LTX-2.3-specific in intent - it's built against the model's x-prediction formulation and patch_size=1 token layout, so don't expect it to behave on other architectures. Pack is work-in-progress.

Common issues

The forward pass can't reconstruct what wasn't there: if the source latent's resolution differs from what the reverse pass later samples at, the node auto-resizes the source (with a warning) but the inversion quality drops - keep the same resolution across forward and reverse. And if your "inverted" latents produce garbage in the reverse pass, your eta was likely too low to pin the trajectory, or too high and you've overfit the noise - start at the 0.8 default and move ±0.2 at a time.

Categoryg_raw/LTX/RFInversion

Inputs (12)

NameTypeDefaultDescription
modelMODEL
latentsLATENT
positiveCONDITIONING
negativeCONDITIONING
stepsINT301–200
cfgFLOAT1.000–10
etaFLOAT0.800–1.5
eta_trendCOMBOconstant3 options: constant, linear_decrease, linear_increase
start_stepINT00–200
end_stepINT300–200
schedulerCOMBOsimple9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3
seedINT00–18446744073709550000

Outputs (2)

NameTypeDescription
inverted_latentsLATENT
source_latentsLATENT