Nodes/Facerestore CF (Code Former)/FaceRestoreModelLoader
ComfyUI Node Runs on cloud

FaceRestoreModelLoader

FaceRestoreModelLoader – ComfyUI Node

By mav-rik·Created 3 years ago·Updated about a year ago· 339
FaceRestoreModelLoader
    • FACERESTORE_MODEL
    model_name

    What it is

    FaceRestoreModelLoader does exactly one job: it points at a .pth file on disk and hands you back a model object the rest of the Facerestore CF pack can use. That's it. If you've used loader nodes anywhere else in ComfyUI - checkpoint loaders, LoRA loaders, upscale model loaders - this is the same pattern, just for face restoration. The reason it's split out as its own node instead of being baked into the restore node is the usual ComfyUI reasoning: loading is slow-ish and you don't want to redo it every run, so you load once and wire the output into as many restore passes as you need.

    This node is worthless on its own - it's the setup step for FaceRestoreCFWithModel, which is where the actual face-fixing happens. Think of the two together: this one says "here's the model," the other says "here's the image, go use it."

    Face restoration itself is a different animal from the identity-preservation tools you've probably already run into (IP-Adapter, InstantID, PuLID). Those are generative - they steer a diffusion model toward a face during generation. Facerestore CF is post-process: it takes a face that's already blurry, low-res, or artifacted (from an old photo, an aggressive upscale, or a face-swap tool like ReActor) and runs it through a dedicated repair network. No prompt, no sampler, no checkpoint involved.

    Inputs and outputs

    There's exactly one input worth knowing about:

    • model_name - a dropdown populated from whatever restoration model files you've actually placed on disk. There's no hardcoded list; if the folder's empty, the dropdown's empty.

    And one output:

    • FACERESTORE_MODEL - a custom type that only FaceRestoreCFWithModel understands. Plug it straight into that node's facerestore_model input.

    Installing it

    Grab the pack through ComfyUI Manager by searching "Facerestore CF (Code Former)," or do it by hand:

    cd ComfyUI/custom_nodes
    git clone https://github.com/mav-rik/facerestore_cf.git
    

    Here's the part people skip and then wonder why nothing works: this pack ships platform install scripts, and you're supposed to run one. Windows portable users run embedded_install.bat, regular Windows install runs install.bat, Linux/Mac runs install.sh. On Python 3.12+, use requirements_312.txt instead of the default requirements file. Dropping the folder in and just restarting ComfyUI - the thing that works for a lot of pure-Python node packs - isn't reliably enough here.

    Then, separately, you need the actual restoration model weights. The pack supports two: codeformer.pth (from the CodeFormer releases) and GFPGANv1.4.pth (from TencentARC's GFPGAN releases). Neither auto-downloads - you fetch them yourself and drop them in models/facerestore_models. That's different from the face detection models the restore node also needs, which do auto-download on first use. Easy to mix up which one is missing when something's not working.

    Common issues

    model_name dropdown is empty. You haven't put anything in models/facerestore_models yet. Download codeformer.pth or GFPGANv1.4.pth and restart ComfyUI - the dropdown only populates from files that were there at startup.

    Node shows up red / "not found" after loading someone else's workflow. This is the single most common complaint around this pack, and it's not really a bug - it's a dependency people don't realize they have. A lot of ReActor face-swap workflows chain a Facerestore CF pass onto the end for cleanup, so the workflow JSON references FaceRestoreModelLoader even though ReActor itself is a separate install. If you installed ReActor and got red boxes for this node, install Facerestore CF directly rather than assuming Manager's "install missing nodes" will catch the whole chain - it doesn't always.

    Which model should I even pick? CodeFormer is the one this pack is really built around - it's in the name - and it's the one with the tunable fidelity dial over in FaceRestoreCFWithModel. GFPGAN is there as an option but doesn't get that same control; if you want to fine-tune the quality/fidelity trade-off, CodeFormer is the one to reach for.

    Windows install acting weird after a git clone. Don't skip the .bat step above - a bare pip install from requirements alone can leave native bits half-set-up, and that's usually what's actually broken, not ComfyUI itself.

    Categoryfacerestore_cf

    Inputs (1)

    NameTypeDefaultDescription
    model_nameCOMBO0 options:

    Outputs (1)

    NameTypeDescription
    FACERESTORE_MODELFACERESTORE_MODEL