Nougan Tail RefMod
Nougan Tail RefMod
- images
- vae
- audio
- audio_vae
- mods
- info
- tail_frames
MiniMax H3 clips are four to fifteen seconds, which means the interesting videos are always several clips, and the hard part is that clip two doesn't know what clip one looked like. Tail RefMod is the cheapest fix: take the last second of the finished clip, encode it as an H3 reference, and hand it to the next generation so it at least looks like the same movie.
The author is refreshingly honest about what this is not. From the node's own description: "A reference, not a true continuation: expect the same look, not the same pose."
How it slices the tail
Your incoming images are decoded frames, [T,H,W,C]. The node takes the last tail_seconds worth - computed as round(tail_seconds × source_fps) frames off the end - then resamples that window to 24 fps, because that's what H3 runs at, and trims it to a valid H3 reference length. Those lengths are 5, 22, 39, 56, 73… a stride of 17 from a floor of 5, so ask for one second and you get 22 frames, not 24. Over-asking just gets you the next step up the ladder.
Then the frames are encoded through the H3 video VAE at ref_resolution (short edge, default 512) as a "Full Reference" identity mod, with a token budget you can cap via max_visual_tokens and enforce via visual_budget (truncate drops the excess, error refuses).
If you also hand it audio and an audio_vae, the last tail_seconds of the waveform is encoded too and bundled alongside - which matters a lot on H3, because it generates sound natively and a video continuation with a fresh voice every clip is uncanny.
Everything gets written as a bundle to models/refmods/_tail/<save_name>.safetensors, overwritten each run.
Inputs and outputs
Required: images, vae (the H3 video VAE - not audio, not Flux), tail_seconds (0.25–10, default 1), source_fps (the rate your frames were generated at, so the slice is honest), and strength (0–1, default 1) - a multiplier that stacks on top of whatever retention and curve settings you use in RefMod Apply.
Optional: audio, audio_vae, audio_type (a label only - voice, singing, music_style, sound_fx, ambience), ref_resolution, max_visual_tokens (0 = no cap), visual_budget, description (shows up in the prompt hint), save_name.
Outputs: mods (H3_REF_MODS, wire it into Nougan RefMod Apply's extra_mods), info (a readable summary - frame count, whether audio came along, token count, path), and tail_frames, the actual IMAGE batch that got encoded. Save that last one the first time you use this: seeing exactly which frames were chosen will teach you more about tail_seconds than any explanation.
Install
cd ComfyUI/custom_nodes
git clone https://github.com/Winnougan/Nougan_Nodes
# restart ComfyUI
Or ComfyUI Manager, search Nougan. The RefMod engine is vendored inside the pack (nougan_engine/) from Luisa's ComfyUI-MiniMaxH3Mod under MIT, in the same v5 bundle format - so files you make here open in her stock "Load H3 RefMods" node, and hers open here. Nothing else to install, but you do need a ComfyUI build with H3 support; without it only the RefMod family fails to load, not the rest of the pack.
One non-technical flag, since it's the model you're feeding: H3's Community License excludes the US, EU, UK and South Korea from its applicable territory, local weights included (minimax-h3.json). No node fixes that.
What goes wrong
"audio is connected but audio_vae is not." It raises rather than dropping your track. Attach the H3 audio VAE, or disconnect the audio.
"need at least 2 frames." You're feeding a single image, not a clip.
The next clip looks similar but the motion restarts. Expected. This is a visual/audio reference, not a continuation of latent state - the pose and action don't carry. If you need the actual last frame as the first frame, that's an image-to-video job, not a RefMod job.
A new tail every run overwrites the old one. tail_latest is a scratch name on purpose. Give it a unique name if you want to keep a particular tail as a normal, reusable RefMod.
It's slow and token-heavy. Twelve seconds of tail at 1024 ref resolution is a lot of reference tokens on every step. Drop ref_resolution to 384–512 and keep the tail to a second; the look survives, the token count doesn't.
For context: the whole open-video field is a pile of 5-second models pretending to be filmmakers, and every one of them has some version of this problem (wan-video.md). Chaining references is the same idea as character LoRAs and reference injection in stills - cheap, zero-shot, and about as good as zero-shot gets (character-consistency.md). Use it when you want the same world across clips. Don't use it expecting a cut-free continuation.
Inputs (13)
| Name | Type | Default | Description |
|---|---|---|---|
| images | IMAGE | Decoded frames of the clip you just made [T,H,W,C]. | |
| vae | VAE | MiniMax H3 VIDEO VAE. | |
| tail_seconds | FLOAT | 1.000.25–10 | How much of the end of the clip to use. Resampled to 24 fps and trimmed to a valid H3 length (5, 22, 39, 56 frames). |
| source_fps | FLOAT | 24.01–120 | fps of the incoming frames. |
| strength | FLOAT | 1.000–1 | Strength of the tail ref. Apply's retention and curve still act on top of this. |
| audioopt | AUDIO | Optional: audio of the same clip. Its last tail_seconds are used. | |
| audio_vaeopt | VAE | MiniMax H3 AUDIO VAE. Needed if audio is connected. | |
| audio_typeopt | COMBO | voice | Metadata label only. |
| ref_resolutionopt | INT | 512256–2048 | Short edge for the encode. Lower = fewer tokens. |
| max_visual_tokensopt | INT | 163840–2147483647 | 0 = no cap. |
| visual_budgetopt | COMBO | truncate | 2 options: truncate, error |
| descriptionopt | STRING | Optional. Shows up in the prompt_hint. | |
| save_nameopt | STRING | tail_latest | Scratch file in models/refmods/_tail, overwritten every run. Give it a unique name to keep the tail as a normal RefMod. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| mods | H3_REF_MODS | — |
| info | STRING | — |
| tail_frames | IMAGE | — |