HunyuanVideo Inverse Sampler
The first half of prompt-driven video-to-video
- model
- hyvid_embeds
- samples
- samples
This node is one half of a pair, and it doesn't do anything useful on its own - you'll always use it together with HyVideoReSampler. Together they're how you do prompt-driven video editing on an existing video without ControlNet: keep the motion and structure of a source clip, but change what's actually in it based on a new prompt.
The trick is diffusion inversion, and it's a well-worn technique from image editing (DDIM inversion) applied to video. Normally a sampler starts from noise and denoises toward a video. Inversion runs that process backwards: feed it an existing video (as latents), and it recovers the noise trajectory that would have produced that video if you'd generated it forward normally. That recovered trajectory is what carries the original's structure and motion - and it's what HyVideoReSampler uses afterward to generate a new video that follows the same path but conditioned on different hyvid_embeds, i.e. a new prompt.
Required inputs: model and hyvid_embeds like any sampler, plus samples - the tooltip is explicit that this is your "init Latents to use for video2video process," meaning your source video, already VAE-encoded to latent space, goes in here. steps, seed, and force_offload behave like you'd expect from any sampler node. embedded_guidance_scale and flow_shift are the model's own guidance and flow-matching scheduler parameters - this node's defaults (embedded_guidance_scale 0, flow_shift 1) are deliberately mild compared to a normal generation sampler, which makes sense: you're not trying to generate something new here, you're trying to accurately recover a trajectory, so you don't want strong guidance fighting that.
The fields that actually matter for how the inversion behaves are gamma, gamma_trend, start_step, and end_step. gamma (0–1, default 0.5) is the overall strength of the inversion effect. gamma_trend decides whether that strength stays flat (constant), ramps up (linear_increase), or ramps down (linear_decrease) across the step range you set with start_step/end_step - the same windowed-strength pattern that shows up across this pack's more advanced samplers. There's also an optional interpolation_curve (0–1), whose tooltip specifies it controls "the strength of the inversed latents along time, in latent space" - meaning it can vary the effect across the frame/temporal axis rather than just across sampling steps, worth touching only if the beginning and end of your clip need different amounts of preserved structure.
Output is samples - a LATENT, same type as the input, but conceptually now the inverted trajectory. That output is exactly what plugs into HyVideoReSampler's inversed_latents input.
Practical starting point: leave gamma_trend at constant and the step range at its defaults until you have a reason to change it. The dial you'll actually reach for first is gamma - higher keeps more of the original structure locked in, lower loosens it up. This is the video2video equivalent of denoise strength in image img2img, just split across a slightly more elaborate set of controls.
Installing the pack: ComfyUI Manager (search "HunyuanVideoWrapper"), or manually cd ComfyUI/custom_nodes && git clone https://github.com/kijai/ComfyUI-HunyuanVideoWrapper then pip install -r requirements.txt inside that folder before restarting - that pip step is where most "half the nodes are missing" installs go wrong. No extra models beyond the diffusion checkpoint, VAE, and text encoder you're already running for any Hunyuan wrapper workflow - this node is sampling logic, not a separate weight file. Video2video work does mean you need your source clip encoded to latents first, so make sure your workflow has a video-load-and-VAE-encode chain feeding into samples before this node.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| model | HYVIDEOMODEL | — | |
| hyvid_embeds | HYVIDEMBEDS | — | |
| samples | LATENT | init Latents to use for video2video process | |
| steps | INT | 30 | — |
| embedded_guidance_scale | FLOAT | 0.000–30 | — |
| flow_shift | FLOAT | 1.001–30 | — |
| seed | INT | 00–18446744073709550000 | — |
| force_offload | BOOLEAN | true | — |
| gamma | FLOAT | 0.500–1 | — |
| start_step | INT | 0 | — |
| end_step | INT | 18 | — |
| gamma_trend | COMBO | constant | 3 options: constant, linear_increase, linear_decrease |
| interpolation_curveopt | FLOAT | 0.000–1 | The strength of the inversed latents along time, in latent space |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| samples | LATENT | — |