Nodes/ComfyUI_RopeWrapper/RopeWrapper_SaveSwapInfo
ComfyUI Node

RopeWrapper_SaveSwapInfo

Freeze the detection pass so you never pay for it twice

By fssorc·Created 2 years ago·Updated 2 years ago· 26
RopeWrapper_SaveSwapInfo
  • detectResult
    fileNameTEMP_PKL

    RopeWrapper_SaveSwapInfo is a boring node that saves you real time. It takes the DETECTRESULT from DetectNode - that per-frame map of who's who in your video - and pickles it to disk so the LoadSwapInfo node can hand it back later. It exists because detecting faces is the slow, unchanging part of a face swap, and re-running it on every attempt is pure waste when you're iterating on swap settings.

    It has two inputs and no outputs: detectResult from the DetectNode, and fileName (default TEMP_PKL). That's the whole node. It's marked as an output/terminal node, so nothing wires out of it.

    Where the file actually goes

    This is the one detail everyone gets wrong the first time. It writes to ComfyUI/models/rope/<fileName> - ComfyUI's global models directory - not to the plugin's models/ folder where inswapper_128.onnx and friends live. Same story on the load side, so as long as SaveSwapInfo and LoadSwapInfo use the same name, you're fine. It's only confusing when you go hunting for the file later.

    Two behaviors worth knowing:

    • It never overwrites. If a file with that name already exists, it appends _1, _2, and so on. You can end up with a stack of TEMP_PKL, TEMP_PKL_1, TEMP_PKL_2 without noticing, and load the stale one.
    • No extension is added. Type the name exactly as you want it; myvideo and myvideo.pkl are different files.

    When you'd use it

    The workflow that justifies this node: detect once, save, then swap repeatedly. Every run after the first swaps from the saved map, which turns a minutes-long detection pass into a second or two. It also makes a ComfyUI restart painless - the map survives in models/rope, and LoadSwapInfo picks it right back up.

    The map is tied to one specific video, so don't reuse it across footage, and don't reuse it after re-encoding or cropping the video - the per-frame indices won't line up and you'll get a silent, wrong swap. When in doubt, re-detect and re-save.

    Install

    Same as the whole pack - ComfyUI Manager → search "ComfyUI_RopeWrapper", or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/fssorc/ComfyUI_RopeWrapper
    

    Restart. Requires ComfyUI-VideoHelperSuite and ComfyUI-KJNodes per the README, and the swap models in the plugin's models/ folder. Saved maps go to ComfyUI/models/rope/.

    CategoryRopeWrapper

    Inputs (2)

    NameTypeDefaultDescription
    fileNameSTRINGTEMP_PKL
    detectResultDETECTRESULT

    Outputs (0)

    No outputs