Instant Reference LoRA
Train a reference LoRA and apply it without leaving the graph
- model
- clip
- images
- vae
- tagging_options
- train_options
- model
- clip
- lora_path
- lora_stack
- tags
This node does the thing most ComfyUI users only dream about: you drop a handful of reference images in, it writes the captions, trains a small LoRA, and applies it to your model and clip - all inside the graph. No separate Python install, no kohya GUI, no command line. It's the "I have three good images of this character, I need them in the next five generations" button.
The name is optimistic. "Instant" only really applies after the first run, because the first one does a whole lot of setup. But once that's done, the node caches aggressively, and rerunning the same images is genuinely fast.
How it works
Under the hood this is a full sd-scripts (kohya) training run, wrapped up and pointed at a tiny dataset. The pipeline: your images batch gets exported to PNGs, a WD14 tagger auto-generates captions, the captions get cleaned up, and then a LoRA is trained with a short profile - 50 steps by default. Then the trained file is loaded and applied to your model and clip right there, using your model_strength and clip_strength.
The caching is the clever part. It hashes your images, the checkpoint, the profile, the captions, and every training option into a key. Same key, same images, same checkpoint → it just reuses the LoRA from its output folder. Change anything - one image, a threshold - and it retrains.
The inputs that matter
Only a few are worth your attention on day one:
- images - your reference batch. 5–15 clean images of the character or style is the sweet spot; more isn't automatically better, and 50 steps is a rough pass, not a polished model.
- model and clip - these must come out of a checkpoint loader. The node recovers the checkpoint path from the model object to train against; a model that's been merged or built up some other way will throw an error asking you to load it with a checkpoint loader first.
- profile - the enum with
sdxlandanima. SDXL uses a LoCon-style network at 1024², bf16, UNet-only.animais for the Anima anime model and additionally exposesvae(and expects the qwen3 text encoder via your clip). There's no Flux or Z-Image profile, so don't try to feed those in. - model_strength / clip_strength - how hard the trained LoRA is pushed. Default 1.0 is fine; the full ±10 range is there if you want to abuse it.
The optional tagging_options and train_options sockets take the pack's two helper nodes - you can get far without them.
Outputs
You get the patched model and clip (wire them into your sampler), the lora_path as a string (where the file landed), a lora_stack you can thread into another node, and tags - the actual captions that were generated, useful if you want to see what the tagger thought your character was.
Install
ComfyUI Manager, search "Instant Reference", install, restart. Or manually:
cd ComfyUI/custom_nodes
git clone https://github.com/cstria0106/comfyui-instant-reference
Then restart ComfyUI.
Where people get burned
First run is heavy: the node git-clones kohya-ss/sd-scripts into its own runtime folder, builds a separate Python venv, and installs a big pinned dependency list - torch, onnxruntime-gpu, bitsandbytes, the works. It also downloads the SmilingWolf WD14 tagger model. On Windows it demands Python 3.12 specifically. Budget several minutes and some disk before your first generation completes.
The author is upfront that this is "still fairly rough" and only tested on simple workflows. At 50 steps you're getting adaptation, not a production character LoRA - this is the "quick and dirty" lane, and it sits well next to the KB advice that dataset curation beats every training knob. Trained files land in models/loras/instant-reference-generated/, so you can grab them for the regular LoraLoader afterwards if one comes out better than expected.
Inputs (9)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | — | |
| clip | CLIP | — | |
| images | IMAGE | — | |
| model_strength | FLOAT | 1.00-10–10 | — |
| clip_strength | FLOAT | 1.00-10–10 | — |
| profile | COMBO | 2 options: anima, sdxl | |
| vaeopt | VAE | — | |
| tagging_optionsopt | TAGGING_OPTIONS | — | |
| train_optionsopt | TRAIN_OPTIONS | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| clip | CLIP | — |
| lora_path | STRING | — |
| lora_stack | LORA_STACK | — |
| tags | STRING | — |