Nodes/Nougan Nodes/Nougan Tail Capture
ComfyUI Node

Nougan Tail Capture

Nougan Tail Capture

By Winnougan·Created 4 months ago·Updated 3 days ago· 31
Nougan Tail Capture
  • images
  • vae
  • audio
  • audio_vae
    ◄tail_seconds1.00►
    ◄source_fps24.0►
    ◄audio_typevoice►
    ◄ref_resolution512►
    ◄max_visual_tokens16384►
    ◄visual_budgettruncate►
    ◄description►
    ◄save_nametail_latest►

    Here's the problem Nougan Tail Capture solves, and it's a graph-theory problem more than a model problem. You want clip two to reference the tail of clip one. Wire Nougan Tail RefMod into Nougan RefMod Apply and you've built a cycle: the reference needs a clip that hasn't been generated yet. ComfyUI will not run that, and it's right not to.

    Capture's answer is cheeky: don't pass the tail through the graph, pass it through the disk between runs. Capture is a sink on your decoded frames that saves the tail after the clip finishes. Nougan Tail Load picks up the newest saved tail at the start of the next queue. One graph, two runs, and continuity without a loop.

    What it's doing

    Mechanically it's the same encoding work as Nougan Tail RefMod: slice the last tail_seconds of frames, resample to H3's 24 fps, trim to a valid reference length (5, 22, 39, 56…), encode as a Full Reference mod through the H3 video VAE, and optionally bundle the matching slice of audio through the audio VAE. Then it writes a bundle into models/refmods/_tail/.

    The one genuinely clever detail: it writes to two alternating slots, <save_name>_a and <save_name>_b, always choosing whichever is not currently the newest. The reason is Windows - memory-mapped safetensors files can still be held open by a Load on the previous run, and overwriting one under a live handle is how you get a mysterious failure. Alternating means the file the loader might be holding is never the file you're writing.

    It's an output node with no output sockets at all. Its result is a side effect, and the info line ("captured tail: 22 frames @ 24 fps + audio, N tokens → path") goes to the node's text panel and the console.

    Inputs

    images - the decoded frames of the clip you just made. vae - the H3 video VAE. tail_seconds (0.25–10, default 1) and source_fps (the fps the clip was actually generated at; get this wrong and you slice the wrong amount).

    Optional, and mostly shared with the rest of the family: audio + audio_vae to carry sound forward (one without the other raises a clear error), audio_type as a metadata label, ref_resolution (short edge for the encode, default 512), max_visual_tokens and visual_budget (truncate or error), description, and save_name - which must match the Tail Load node or the next run finds nothing.

    Install

    Part of the Nougan pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/Winnougan/Nougan_Nodes
    # restart ComfyUI
    

    Or ComfyUI Manager, search Nougan. The RefMod engine is vendored in-pack, so there's no separate dependency - but it needs a ComfyUI build with MiniMax H3 support, and without that only the RefMod family fails while everything else still loads. Note the H3 weights carry a territory-restricted licence excluding the US, EU, UK and South Korea (minimax-h3.json).

    The rhythm, and what trips people up

    Nothing happens on the first run. Correct. Capture saves a tail, it doesn't use one. The tail only affects a generation from the second queue onward. If capture and load sit in the same graph, run it twice before judging the result.

    The tail is stale, from the last clip you made. That's literally the design, but it stops being cute when you start a fresh sequence and inherit the previous video's ending. Either set enabled to off on the Load node for the first clip, or clear models/refmods/_tail/.

    save_name mismatch. Capture writes tail_latest by default and Load reads tail_latest by default, so it works until you rename one of them. Keep the pair in sync, and give each project its own name if you run more than one - the default name is shared global state.

    You can't see anything in the graph. No outputs means no preview, no passthrough to inspect. If you want to look at what got captured, use Nougan Tail RefMod instead, which gives you tail_frames to save.

    It's a hack, and it's the right kind: side-effecting through disk to break a cycle is how most "state" in ComfyUI actually works (comfyui-node-plumbing.md is a good tour of that layer). Just treat the tail folder as real state - name it, clear it, don't expect magic from defaults shared across every workflow you own.

    CategoryNougan/RefMod

    Inputs (12)

    NameTypeDefaultDescription
    imagesIMAGEPlug the decoded frames of the clip being made. Runs after the clip finishes.
    vaeVAEMiniMax H3 VIDEO VAE.
    tail_secondsFLOAT1.000.25–10—
    source_fpsFLOAT24.01–120—
    audiooptAUDIOOptional: the clip's audio. Needs audio_vae.
    audio_vaeoptVAEMiniMax H3 AUDIO VAE.
    audio_typeoptCOMBOvoice5 options: voice, singing, music_style, sound_fx, ambience
    ref_resolutionoptINT512256–2048—
    max_visual_tokensoptINT163840–2147483647—
    visual_budgetoptCOMBOtruncate2 options: truncate, error
    descriptionoptSTRING—
    save_nameoptSTRINGtail_latestMust match Nougan Tail Load. Files go to models/refmods/_tail/<name>_a / _b.

    Outputs (0)

    No outputs