Nodes/ComfyUI_StableHair_ll/LoadStableHairTransferModel
ComfyUI Node

LoadStableHairTransferModel

Loading the Stable-Hair transfer model

By lldacing·Created 2 years ago·Updated about a year ago· 80
LoadStableHairTransferModel
    • model
    ckpt_name
    encoder_model
    adapter_model
    control_model
    device

    This is the most error-prone node in the Stable-Hair pack, and it's the one that makes ApplyHairTransfer possible. It loads the full hair-transfer pipeline: a reference encoder, an attention-level hair adapter, and a ControlNet, all stacked on top of your SD1.5 base checkpoint. Get the files right and the transplant works; get one slot wrong and you'll get a face that doesn't look like anyone.

    What it does

    Like its sibling loader, it assembles a diffusers pipeline on the fly from your SD1.5 single-file checkpoint, using the SD1.5 configs bundled inside the pack. Then it adds three learned components:

    • encoder_model → loads hair_encoder_model.bin into a RefHairUnet reference encoder. This reads the reference hairstyle and produces the appearance features.
    • adapter_model → loads hair_adapter_model.bin into custom attention processors injected into the UNet (adapter_injection). This is the mechanism that carries the reference hair through sampling - same family as IP-Adapter's attention injection, tuned for hair.
    • control_model → loads hair_controlnet_model.bin onto a ControlNet built from a copy of the UNet. This holds the target's face and head geometry during generation.

    It finishes with the scheduler swap to UniPCMultistepScheduler, fp16 on CUDA / fp32 on CPU.

    The inputs that matter

    • ckpt_name - an SD1.5 base checkpoint from models/checkpoints. Non-negotiable; the whole pipeline is built on it.

    • encoder_model, adapter_model, control_model - three dropdowns that all list the same files. This is the trap. You must match each slot to its file:

      • encoder_modelhair_encoder_model.bin
      • adapter_modelhair_adapter_model.bin
      • control_modelhair_controlnet_model.bin

      Swap any two and the pipeline still runs - it just silently produces garbage. Nothing validates that you picked the right file per slot.

    • device - AUTO or CPU.

    The output is a single model (HAIR_MODEL) connection, feeding ApplyHairTransfer.

    Install

    ComfyUI Manager → search ComfyUI_StableHair_ll, or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/lldacing/ComfyUI_StableHair_ll
    

    Restart. Grab all four files from HuggingFace lldacing/StableHair and drop them in ComfyUI/models/diffusers/StableHair/ (the README shows the exact layout). The pack declares only numpy in its pyproject.toml and ships no requirements.txt, so diffusers and torch need to already be in your ComfyUI environment or the pack won't even import.

    Gotchas

    First run is genuinely slow - three weight files plus a full pipeline build, so give it a minute before assuming it hung. If ApplyHairTransfer outputs a face that blends the reference and target, check your three dropdowns before touching any strength slider; a misassigned file produces exactly that symptom. And keep the shared pack rules in mind: SD1.5 base only, both cropped images the same size and multiples of 8, and front-facing photos. This is a small, barely-documented pack, so when something's wrong the README and the example workflow image in the repo are your entire support system.

    Categoryhair/transfer

    Inputs (5)

    NameTypeDefaultDescription
    ckpt_nameCOMBOThe name of the checkpoint (model) to load.
    encoder_modelCOMBO0 options:
    adapter_modelCOMBO0 options:
    control_modelCOMBO0 options:
    deviceCOMBO2 options: AUTO, CPU

    Outputs (1)

    NameTypeDescription
    modelHAIR_MODEL