Nodes/ComfyUI-MAINodes/H3 Protect Prefix (alpha)
ComfyUI Node

H3 Protect Prefix (alpha)

Stop the de-rope from retiming the continuity anchor you're carrying over

By matlowai·Created 17 days ago·Updated about 17 hours ago· 112
H3 Protect Prefix (alpha)
    • hold_map
    • report
    hold_map
    plan

    Alpha node from the extension/continuation side of the pack, and it solves a subtle one. When you chain segments - carrying the tail of one clip into the next as its init - the carried prefix is the continuity anchor: it's what tells the model where things were and how fast they were moving. If the de-rope's hold map reaches into that prefix and starts holding its frames, the anchor gets retimed and the join breaks. H3 Protect Prefix forces hold 1 over the carried prefix so the de-rope may not retime it. The oracle still saw it, so it still knows the incoming velocity - it just can't slow the anchor down.

    How it works

    It's a pure hold-map rewrite. Wire in the hold_map (from the oracle or wherever) and the plan (the continuation plan that knows where the prefix lives), and it returns the same hold map with every prefix frame forced to hold 1, plus a report. The mechanism is the same idea as the handle frames of H3 Segment Crop and the window overlap in the rolling-window graphs - a protected band of real-time frames around the join so the model has clean context instead of a retimed one.

    The distinction worth keeping straight, from the node's own description: this protects the prefix from retiming. Background freeze on H3 V2V Init is a separate, independent decision - that's about what regenerates vs. what's frozen in place, not about the clock.

    Inputs: hold_map and plan, both strings. Outputs: the rewritten hold_map and a report.

    Where it fits

    Pair it with H3 PrefixFreezeMask, which is the companion piece for the regeneration side: ProtectPrefix makes sure the map doesn't slow the prefix, and PrefixFreezeMask makes sure pass 2 doesn't re-texture it (its description notes the seam got re-textured when protected by hold-1 alone - measured handle MAE 20/255). Used together, the prefix rides through the de-rope as a genuine anchor: same clock, same texture, and the model still knows how fast the world was moving when it arrived.

    Install

    cd ComfyUI/custom_nodes
    git clone https://github.com/matlowai/ComfyUI-MAINodes
    

    or ComfyUI Manager → ComfyUI-MAINodes, restart. Category MAINodes/alpha. No extra deps.

    Common gotchas

    This only does what it says if the plan it's given actually locates the prefix correctly - a plan from a different clip, or a hand-built plan with the wrong prefix geometry, silently produces a map that doesn't protect the right frames. And remember it's a timing protection, not a freeze: if your join still shows the prefix getting regenerated, you're looking at the mask side (PrefixFreezeMask), not the clock side.

    CategoryMAINodes/alpha

    Inputs (2)

    NameTypeDefaultDescription
    hold_mapSTRING
    planSTRING

    Outputs (2)

    NameTypeDescription
    hold_mapSTRING
    reportSTRING