Nodes/Eden.art LoRa Trainer/Eden_LoRa_trainer
ComfyUI Node

Eden_LoRa_trainer

The LoRA trainer that runs inside ComfyUI β€” no separate GUI, no kohya config files

By edenartlabΒ·Created 2 years agoΒ·Updated about a year agoΒ· 70
Eden_LoRa_trainer
    • sample_images
    • lora_path
    • embedding_path
    • final_msg
    β—„training_images_folder_path.β–Ί
    β—„modestyleβ–Ί
    β—„lora_nameEden_Token_LoRaβ–Ί
    β—„ckpt_nameβ–Ύβ–Ί
    β—„training_resolution512β–Ί
    β—„train_batch_size4β–Ί
    β—„max_train_steps300β–Ί
    β—„ti_lr0.0010β–Ί
    β—„unet_lr0.0005β–Ί
    β—„lora_rank16β–Ί
    β—„disable_tifalseβ–Ί
    β—„n_tokens3β–Ί
    β—„save_checkpoint_every_n_steps200β–Ί
    β—„n_sample_imgs4β–Ί
    β—„sample_imgs_lora_scale0.70β–Ί
    β—„plot_training_graphs_on_diskfalseβ–Ί
    β—„seed0β–Ί

    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, or object. 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 your models/checkpoints folder. 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_ti and 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.
    CategoryEden 🌱

    Inputs (17)

    NameTypeDefaultDescription
    training_images_folder_pathSTRING.β€”
    modeCOMBOstyle3 options: style, face, object
    lora_nameSTRINGEden_Token_LoRaβ€”
    ckpt_nameCOMBO0 options:
    training_resolutionINT512256–1024β€”
    train_batch_sizeINT41–8β€”
    max_train_stepsINT30010–10000β€”
    ti_lrFLOAT0.00100–0.005β€”
    unet_lrFLOAT0.00050–0.005β€”
    lora_rankINT161–64β€”
    disable_tiBOOLEANfalseβ€”
    n_tokensINT31–5β€”
    save_checkpoint_every_n_stepsINT20010–10000β€”
    n_sample_imgsINT42–10β€”
    sample_imgs_lora_scaleFLOAT0.700–1.25β€”
    plot_training_graphs_on_diskBOOLEANfalseβ€”
    seedINT00–100000β€”

    Outputs (4)

    NameTypeDescription
    sample_imagesIMAGEβ€”
    lora_pathSTRINGβ€”
    embedding_pathSTRINGβ€”
    final_msgSTRINGβ€”