LoadStableHairTransferModel
Loading the Stable-Hair transfer model
- model
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.bininto aRefHairUnetreference encoder. This reads the reference hairstyle and produces the appearance features. - adapter_model → loads
hair_adapter_model.bininto 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.binonto 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_model→hair_encoder_model.binadapter_model→hair_adapter_model.bincontrol_model→hair_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 -
AUTOorCPU.
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.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| ckpt_name | COMBO | The name of the checkpoint (model) to load. | |
| encoder_model | COMBO | 0 options: | |
| adapter_model | COMBO | 0 options: | |
| control_model | COMBO | 0 options: | |
| device | COMBO | 2 options: AUTO, CPU |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| model | HAIR_MODEL | — |