Nodes/ComfyUI-HyperLoRA/HyperLoRA Config
ComfyUI Node

HyperLoRA Config

Set-and-forget settings for the face LoRA factory

By bytedance·Created about a year ago·Updated about a year ago· 498
HyperLoRA Config
    • HYPER_LORA_CONFIG
    image_processor
    image_encoder
    resampler.dim1024
    resampler.dim_head64
    resampler.heads12
    resampler.depth4
    resampler.ff_mult4
    encoder_types
    face_analyzer
    id_embed_dim512
    num_id_tokens4
    hyper_dim128
    lora_rank4
    has_base_lorafalse

    HyperLoRAConfig looks intimidating - thirteen knobs, several with names like resampler.dim_head - and it's almost entirely set-and-forget. Its one job is to produce the HYPER_LORA_CONFIG object that HyperLoRALoader uses to decide what to load. The defaults are tuned to match the released ByteDance models, and for the stock v1 weights you basically only care about the three dropdowns at the top and one boolean at the bottom.

    What it's for

    HyperLoRA's hyper-network isn't a fixed-size blob; the resampler shape, the number of ID tokens, the LoRA rank, and the encoder combination are all architecture decisions. Rather than hardcode them, the pack exposes them here. You wire config into HyperLoRALoader, and the loader instantiates everything accordingly. That's the whole graph relationship.

    The knobs that actually matter

    • image_processor and image_encoder - dropdowns populated from models/hyper_lora/clip_processor/ and models/hyper_lora/clip_vit/. Pick the CLIP ViT-L/14 processor and model you downloaded. "Not found!" means you haven't set up the model folders.
    • face_analyzer - dropdown from models/insightface/models/. Pick antelopev2. This only matters if encoder_types includes arcface.
    • encoder_types - clip, arcface, or clip + arcface. The default (clip + arcface) is what the released models expect and gives the best likeness. Drop to clip and you lose the ArcFace embedding path (and don't need the InsightFace models); it'll be weaker on identity.
    • has_base_lora - the boolean that switches on the base-LoRA machinery (base_resampler). Default false. The shipped v1 weights already distilled the base LoRA into the ID LoRA, so unless you have a model that actually ships a separate base resampler, leave it off. Turning it on makes the loader demand a base_resampler.safetensors it may not have.

    Everything else - resampler.dim, heads, depth, ff_mult, id_embed_dim, num_id_tokens, hyper_dim, lora_rank - is architecture plumbing. The defaults (num_id_tokens 4, lora_rank 4, etc.) match the released checkpoints. If you change them, you're building a hyper-network shape the weights weren't trained for, and you'll either get a load-time shape error or silent garbage.

    Installing and wiring it

    Standard pack install: ComfyUI Manager → "ComfyUI-HyperLoRA", or git clone https://github.com/bytedance/ComfyUI-HyperLoRA into custom_nodes + pip install -r requirements.txt (diffusers, insightface, onnxruntime, opencv-python, transformers) + restart. Then make sure the model folders exist:

    mkdir -p models/hyper_lora/clip_processor/clip_vit_large_14_processor
    mkdir -p models/hyper_lora/clip_vit/clip_vit_large_14
    mkdir -p models/insightface/models
    

    Drop the CLIP processor config in the first, CLIP ViT config.json + model.safetensors (from openai/clip-vit-large-patch14) in the second, and unzip antelopev2 from the InsightFace model zoo into the third. The HyperLoRA model folder lives under models/hyper_lora/hyper_lora/ and is picked by the loader, not this node.

    Should you use it at all?

    Honest take: if you're a beginner, skip it and grab HyperLoRAUniLoader instead. The Uni loader folds this node and the loader together with the correct defaults hardcoded - one node, three dropdowns, done. Use HyperLoRAConfig when you want to see what you're doing, tune has_base_lora for a variant model, or swap encoders. If the example workflow won't build, though, this is often the node people report as "still missing" - that's the Manager install failing to register the pack, not a config error, and a restart fixes it.

    CategoryHyperLoRA

    Inputs (14)

    NameTypeDefaultDescription
    image_processorCOMBO1 options: Not found!
    image_encoderCOMBO1 options: Not found!
    resampler.dimINT102464–2048
    resampler.dim_headINT6432–512
    resampler.headsINT124–32
    resampler.depthINT44–16
    resampler.ff_multINT42–8
    encoder_typesCOMBO3 options: clip, arcface, clip + arcface
    face_analyzerCOMBO1 options: Not found!
    id_embed_dimINT512128–1024
    num_id_tokensINT44–128
    hyper_dimINT12832–1024
    lora_rankINT42–32
    has_base_loraBOOLEANfalse

    Outputs (1)

    NameTypeDescription
    HYPER_LORA_CONFIGHYPER_LORA_CONFIG