Nodes/ComfyUI-HyperLoRA/HyperLoRA Save LoRA
ComfyUI Node

HyperLoRA Save LoRA

Snag the face LoRA before it vanishes

By bytedance·Created about a year ago·Updated about a year ago· 498
HyperLoRA Save LoRA
  • lora
    filename_prefixlora/id_lora

    The whole clever thing about HyperLoRA is that it doesn't just condition on a face - it generates a real LoRA. And a real LoRA deserves to be a file on your disk, not a tensor living only inside the current graph. That's the job of this node: it takes the generated LORA and writes it out as a .safetensors you can reuse forever.

    Why you'd reach for it

    Three reasons, in order of usefulness.

    1. Reuse without re-running. Without this node, every time you want that person's face you have to re-run the face detection, the resampler, the whole hyper-network. Save once and you've got a regular LoRA file you can load with the standard Load LoRA node in any future workflow - no HyperLoRA nodes needed at all.
    2. It's a better starting point than a raw photo. The README says a generated ID LoRA makes a great initialization for actual LoRA training - you can get a better LoRA with only about 50 steps of finetuning. That starts with saving the file.
    3. Sharing. Drop the .safetensors in a zip, hand it to a friend, upload it. It's a normal SDXL LoRA at the end of the day, a few MB because rank is small.

    How it works

    This is a dead-simple output node. It takes the LORA tensor (a dict of alpha, lora_down.weight, lora_up.weight entries) and writes it with safetensors.save_file. The filename is built the same way ComfyUI names preview images - a counter is appended so you never clobber a previous save.

    Inputs

    Only two, and you'll only touch one:

    • filename_prefix - where the file lands, relative to your ComfyUI/output folder. The default is lora/id_lora, which gives you ComfyUI/output/lora/id_lora_00001_.safetensors. Change the prefix if you want it somewhere specific (say, the person's name).
    • lora - the generated LoRA from HyperLoRAGenerateIDLoRA or HyperLoRAUniGenerateIDLoRA.

    No outputs - it's a terminal node, and it returns nothing you wire anywhere.

    Installing the pack

    Same install as every other node here: ComfyUI Manager → search "ComfyUI-HyperLoRA" → install, or git clone https://github.com/bytedance/ComfyUI-HyperLoRA into custom_nodes, then pip install -r requirements.txt and restart. The pack brings in diffusers, insightface, onnxruntime, opencv-python, and transformers. This node itself needs none of the model downloads to run - but the nodes upstream of it do, so in practice you'll still be downloading the CLIP and HyperLoRA models and the antelopev2 InsightFace pack first.

    Gotchas

    The file lands in output, not models. If you then want to browse it in the normal Load LoRA picker, move or copy it into ComfyUI/models/loras/. Easy to forget, since it silently saves exactly where you pointed it.

    Also remember what you're saving: this is the face LoRA. The pack can optionally generate a separate base LoRA (background/clothing) via HyperLoRAGenerateBaseLoRA, and each needs its own save node if you want both on disk. In the released v1 weights the base LoRA is already distilled into the ID LoRA, so for most people one save is the whole story.

    CategoryHyperLoRA

    Inputs (2)

    NameTypeDefaultDescription
    filename_prefixSTRINGlora/id_lora
    loraLORA

    Outputs (0)

    No outputs