Eden_LoRa_trainer
The LoRA trainer that runs inside ComfyUI β no separate GUI, no kohya config files
- sample_images
- lora_path
- embedding_path
- final_msg
Eden_LoRa_trainer is the one genuinely turnkey LoRA trainer you can drop straight into a ComfyUI graph. Point it at a folder of images, pick an SD1.5 or SDXL checkpoint, hit run, and it trains a LoRA - plus a textual-inversion embedding - entirely inside ComfyUI, then hands you back sample images and the file paths. It's built by the Eden.art team, the same trainer that powers their hosted app, and it's the reason you don't need to learn kohya or ai-toolkit to train your first LoRA.
The honest caveat up front: this is SDXL-era tech - SD1.5 and SDXL only, no Flux or newer - and it auto-captions with BLIP, which the community has been calling weak for years. For a character LoRA on a modern base, reach for ai-toolkit instead. But for a quick style or face LoRA on an SDXL model you already own, this is the least-friction path that exists, and it outputs plain .safetensors files both ComfyUI and A1111 load.
How it works
Under the hood it's a single training script that serves both SD1.5 and SDXL. The node auto-captions every training image, then - here's the clever bit - optionally calls OpenAI's API to clean up those captions and inject your trainable token (TOK) into them, so the model learns "this thing = TOK". That step needs a .env file in the repo root containing OPENAI_API_KEY=.... Everything works without it; the author says results are just better with it, especially for face and object modes.
It trains two things at once: a LoRA on the UNet (rank 16 by default) and a textual-inversion embedding on the text encoder, using the Prodigy optimizer. Every save_checkpoint_every_n_steps it generates a validation grid so you can watch it converge - that's the sample_images output.
The inputs that matter
Most of the 17 inputs are sensible training dials you can leave alone at first. Set these:
mode-style,face, orobject. This picks the captioning and token strategy. It's the first thing you decide.training_images_folder_path- where your images live. Default is.(the repo dir), so change it. For a face, 15β25 well-curated images; for a style, 30β100.ckpt_name- the SD1.5 or SDXL checkpoint from yourmodels/checkpointsfolder. Architecture lock-in applies: an SDXL LoRA won't run on SD1.5.max_train_steps- 300 by default; go up if it's underfit, down if it's copying your photos.lora_rank- 16 is a fine start. Raise for more capacity, lower for style.disable_ti- turns off the embedding side; relevant if you only want the LoRA.
n_tokens (how many learned tokens make up TOK), ti_lr/unet_lr, train_batch_size, and seed are all there and behave like you'd expect.
Outputs and where they go
The node returns four things: sample_images (the validation grids, as an IMAGE you can preview), lora_path and embedding_path (strings pointing at the saved .safetensors files), and final_msg with a training summary. Files land in the pack's output/ folder. To actually use the LoRA, wire lora_path into a Load LoRA node (or use embedding: in your prompt for the TI part) - the pack ships example train-to-infer workflows in ComfyUI_workflows/.
Installing it
Easiest route: ComfyUI Manager β Install Custom Nodes β search "Eden.art LoRa Trainer". Or by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/edenartlab/sd-lora-trainer
# restart ComfyUI
Then install the Python dependencies into your ComfyUI environment. This is the part that bites: the repo pins torch==2.1.0, diffusers==0.29.2, transformers==4.38.0 plus bitsandbytes, mediapipe, opencv - a heavy, version-locked stack that can clobber what other custom nodes expect. Do it in a venv you can rebuild. First run also downloads several HuggingFace models (BLIP captioner, Florence-2, CLIPSeg, an upscaler) into your ComfyUI model folders, so budget a few GB and some patience.
Where people get burned
- The OpenAI key thing. No
.envβ no token injection β face/object LoRAs come out noticeably weaker. Style still trains fine. - SD1.5 textual inversion is broken-ish. The author's own TODO says pure TI "does not seem to work well" for SD15 but works great for SDXL. On SD15, set
disable_tiand live on the LoRA alone. - It's ~3x slower than the standalone script. Running the same training through the node is slower than
python main.py train_configs/training_args.json- the author flagged it and doesn't know why. One-off run, use the node. Batch training, use the script. - Fixed resolution only. Aspect-ratio bucketing in the dataloader is broken, so don't feed it a mixed-resolution dataset and expect it to bucket.
- BLIP captioning is the ceiling. The node hardcodes BLIP even though the standalone config supports Florence or hand captions. If your face LoRA comes out weak, that's likely why - and the fix is the standalone script with
caption_model: "florence"or hand-written captions.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| training_images_folder_path | STRING | . | β |
| mode | COMBO | style | 3 options: style, face, object |
| lora_name | STRING | Eden_Token_LoRa | β |
| ckpt_name | COMBO | 0 options: | |
| training_resolution | INT | 512256β1024 | β |
| train_batch_size | INT | 41β8 | β |
| max_train_steps | INT | 30010β10000 | β |
| ti_lr | FLOAT | 0.00100β0.005 | β |
| unet_lr | FLOAT | 0.00050β0.005 | β |
| lora_rank | INT | 161β64 | β |
| disable_ti | BOOLEAN | false | β |
| n_tokens | INT | 31β5 | β |
| save_checkpoint_every_n_steps | INT | 20010β10000 | β |
| n_sample_imgs | INT | 42β10 | β |
| sample_imgs_lora_scale | FLOAT | 0.700β1.25 | β |
| plot_training_graphs_on_disk | BOOLEAN | false | β |
| seed | INT | 00β100000 | β |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| sample_images | IMAGE | β |
| lora_path | STRING | β |
| embedding_path | STRING | β |
| final_msg | STRING | β |