Nodes/ComfyUI_RopeWrapper/RopeWrapper_LoadModels
ComfyUI Node

RopeWrapper_LoadModels

The node that loads the face-swap brains (and why there's a fp16 toggle)

By fssorc·Created 2 years ago·Updated 2 years ago· 26
RopeWrapper_LoadModels
    • ROPE_MODEL
    • ROPE_VM
    inswap_type

    Every RopeWrapper workflow starts here. This node loads the ONNX face models and the VideoManager that actually performs the swap, and hands them to the rest of the graph as two outputs: ROPE_MODEL and ROPE_VM. DetectNode takes the model; SwapNode and FaceRestore take both. Without it, nothing downstream has anything to work with.

    It has exactly one input, and it's the one the author got personally burned by: inswap_type, either Original or fp16.

    The fp16 story, because it matters

    Rope's classic default is inswapper_128.fp16.onnx - the half-precision build of the inswapper, smaller and faster. The pack author runs it fine on his Windows machine. But when he moved the same setup to Linux, the swaps came out ugly, and he never quite figured out why. His fix: switch to the full-precision inswapper_128.onnx and expose the choice as this dropdown. If you're on Linux and swaps look wrong, flip this to Original before you blame your settings. Windows users can generally leave it on fp16. Either way, the file it loads has to be sitting in the plugin's models folder with the exact name the code expects.

    What it actually does

    Under the hood it instantiates the vendored Rope Models class, points it at ComfyUI/custom_nodes/ComfyUI_RopeWrapper/models/, and spins up onnxruntime inference sessions on CUDA (with CPU as fallback). Three models matter for a basic swap:

    • det_10g.onnx - the RetinaFace detector that finds faces in each frame
    • w600k_r50.onnx - the ArcFace recognition model that turns a face into an identity embedding
    • inswapper_128.onnx or inswapper_128.fp16.onnx - the actual swapper

    Grab the first two from the original Rope repo (the README points there for links); inswapper_128.onnx is also on Hugging Face, e.g. ezioruan/inswapper_128.onnx. If you plan to use restorers, you'll also want GFPGANv1.4.onnx or the GPEN variants in the same folder.

    Gotchas

    • Loading is not cached. Every queue run rebuilds the sessions, so expect a few seconds of startup each time before detection begins. Annoying, not fatal.
    • Missing model = onnxruntime error. If a file isn't found you'll get an error about opening an ONNX file, not a friendly "model missing." Double-check filenames - inswapper_128.onnx vs inswapper_128.fp16.onnx must match the dropdown exactly.
    • CUDA, but tolerant. It prefers CUDAExecutionProvider and falls back to CPU, so it won't hard-crash on machines without a GPU - it'll just be slow.

    Install

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

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

    Restart ComfyUI. The README requires ComfyUI-VideoHelperSuite and ComfyUI-KJNodes as companion packs. Then download the three models above into the plugin's models/ folder and you're in business.

    CategoryRopeWrapper

    Inputs (1)

    NameTypeDefaultDescription
    inswap_typeCOMBO2 options: Original, fp16

    Outputs (2)

    NameTypeDescription
    ROPE_MODELROPE_MODEL
    ROPE_VMROPE_VM