Lora Training in Comfy (Advanced)
Every kohya knob, still inside ComfyUI
This is the same trainer as the plain Lora Training in ComfyUI node - same underlying kohya-derived script, same "runs inside the graph, saves straight to your loras folder" behavior - but with the hood popped. Where the basic node gives you eight fields, this hands you the parameter surface community LoRA guides have been written against for years: network dimension and alpha, optimizer choice, LR scheduler, LyCORIS algorithm, the works. If you've read a Kohya settings dump on Reddit or CivitAI and wondered where to plug those numbers in inside ComfyUI, this node is the answer.
Worth knowing up front, in the author's own words: "The Advanced node is full of many recommended features... Not everything was tested, I personally don't even know what most of these do." That's an honest map of where to spend your attention. A handful of these fields decide the outcome of your run; the rest exist for people who already know why they're reaching for them. Change the first group deliberately, leave the second at default until a result tells you otherwise.
How it works
Same mechanism as the basic node - point it at a checkpoint and a captioned dataset, queue the prompt, and a kohya-style training run executes in the background, writing progress to your console and a finished .safetensors to disk. This node adds no output socket either; it's an endpoint, not a pass-through.
The inputs worth setting deliberately
ckpt_nameanddata_pathwork exactly as they do on the basic node - same folder-naming gotcha applies (data_pathis the folder above your[repeats]_[name]image directory, not the directory itself).algorithm- the LyCORIS method:lora(plain, the safest default),loha,lokr,ia3,dylora, orlocon. LoCon extends adaptation into convolution layers and is the classic pick for exact character/style reproduction on SD-lineage models; LoKr has become the go-to for character LoRAs on newer architectures elsewhere in the ecosystem, but that finding is from Flux/Z-Image-era training - on this SD 1.5/2.0 pack, plainloraorloconis the well-trodden path. To use anything beyond plain LoRA, also flipnetworkmodulefromnetworks.loratolycoris.kohya- that's the switch that actually unlocks the LyCORIS backend.networkdimension/networkalpha- rank and its scaling factor. Higher dimension means more capacity (and a bigger file); alpha scales the LoRA's effective strength. The defaults (32/32) are a reasonable SD 1.5 starting point.optimizerType-AdamW8bitis the safe default and still fine for this era of training.prodigyauto-tunes the learning rate for you (pair it withlearningrateText/learningrateUnetset to1) if you don't want to hand-tune LR. The others (Lion8bit,SGDNesterov8bit,AdaFactor) are for people already chasing a specific tradeoff.learningrateText/learningrateUnet- separate learning rates for the text encoder and the U-Net. This is SD 1.5/2.0-era architecture, where the text encoder is still trainable (unlike the newer LLM-encoder models, where it's frozen entirely) - so these two actually matter here.output_nameandoutput_dir- same as the basic node;output_dirdefaults tomodels/loras.
The rest - v2 (only flip to Yes if your checkpoint is genuinely SD 2.0), trainingresolution (512 for SD 1.5, bump to 768 for SD 2.0-class models), keeptokens, minSNRgamma, learningRateScheduler, lrRestartCycles, networkDropout, and clip_skip - are real kohya flags with real effects, but they're refinements. networkDropout in particular is a regularization dial worth nudging up a little if you're overfitting a very small dataset; leave everything else at its shipped default until a specific result tells you to change it.
How to install it
It ships in the same pack as the basic node, so one install covers both:
- ComfyUI Manager - search "Lora-Training-in-Comfy", install, restart.
- Manual:
then installcd ComfyUI/custom_nodes git clone https://github.com/LarryJane491/Lora-Training-in-Comfyrequirements_win.txt(Windows) or the equivalent, and restart. Activate your venv first if ComfyUI runs in one - that's the most common reason people see "module not found" right after install.
Common issues & troubleshooting
Everything on the basic node's list applies here too - dependency conflicts from the shared Python environment, CUDA/PyTorch mismatches, the data-path parent-folder trap. Two things specific to going Advanced:
Changing algorithm without changing networkmodule. Picking loha or lokr does nothing unless networkmodule is also set to lycoris.kohya. Left on networks.lora, you'll just train a plain LoRA regardless of what the algorithm dropdown says.
Tuning too many dials at once. With this many fields exposed, it's tempting to change everything in one run. Don't - if the result looks off, you won't know whether it was the optimizer, the rank, or the scheduler. Change one axis at a time, and lean on save_every_n_epochs so you can compare checkpoints instead of guessing from the final one.
Inputs (22)
| Name | Type | Default | Description |
|---|---|---|---|
| ckpt_name | COMBO | 0 options: | |
| v2 | COMBO | 2 options: No, Yes | |
| networkmodule | COMBO | 2 options: networks.lora, lycoris.kohya | |
| networkdimension | INT | 32 | — |
| networkalpha | INT | 32 | — |
| trainingresolution | INT | 512 | — |
| data_path | STRING | Insert path of image folders | — |
| batch_size | INT | 1 | — |
| max_train_epoches | INT | 10 | — |
| save_every_n_epochs | INT | 10 | — |
| keeptokens | INT | 0 | — |
| minSNRgamma | FLOAT | 0.0 | — |
| learningrateText | FLOAT | 0.0001 | — |
| learningrateUnet | FLOAT | 0.0001 | — |
| learningRateScheduler | COMBO | 6 options: cosine_with_restarts, linear, cosine, polynomial, constant, constant_with_warmup | |
| lrRestartCycles | INT | 1 | — |
| optimizerType | COMBO | 5 options: AdamW8bit, Lion8bit, SGDNesterov8bit, AdaFactor, prodigy | |
| output_name | STRING | Desired name for LoRA. | — |
| algorithm | COMBO | 6 options: lora, loha, lokr, ia3, dylora, locon | |
| networkDropout | FLOAT | 0.0 | — |
| clip_skip | INT | 2 | — |
| output_dir | STRING | models/loras | — |
Outputs (0)
No outputs