Nodes/Realtime LoRA Trainer/Realtime LoRA Trainer
ComfyUI Node

Realtime LoRA Trainer

Train a LoRA on AI-Toolkit without leaving ComfyUI

By shootthesound·Created 8 months ago·Updated 2 months ago· 538
Realtime LoRA Trainer
  • image_1
  • image_2
  • image_3
  • image_4
  • lora_path
inputcount4
images_path
architectureZ-Image Turbo
ai_toolkit_path~/ai-toolkit
captionphoto of subject
training_steps500
learning_rate0.0005
lora_rank16
vram_modeLow (768px)
keep_loratrue
output_nameMyLora
custom_python_exe
caption_1
caption_2
caption_3
caption_4

What it is

RealtimeLoraTrainer is the node that lets you drop a handful of reference images into a ComfyUI workflow and come out the other side with a trained LoRA, no terminal, no YAML editing, no separate training UI to babysit. Under the hood it's a wrapper around Ostris's ai-toolkit - currently the dominant LoRA trainer in the community, having overtaken Kohya's sd-scripts through late 2025 precisely because it's first to support whatever model dropped last week. This node covers four of those: Z-Image Turbo, FLUX.1-dev, and Wan 2.2 in its High, Low, and Combo noise flavors.

One honest aside before you get excited about the name: a Redditor called the "Realtime" branding misleading in the pack's own release thread, since a ComfyUI node still queues and runs a training job like any other - it's not sub-second. The author left the name alone. Read "Realtime" as "no CLI round-trip," not "instant."

How it works

The node hands your images and captions to a local ai-toolkit install and lets it run its normal training loop - nothing about the underlying math changes just because it's wrapped in a node. What ComfyUI adds is the plumbing: dynamic image slots, a caching layer so identical inputs skip a re-train and just hand back the LoRA you already made, and a single lora_path output that snaps straight into ApplyTrainedLora downstream.

Inputs and outputs that matter

You'll actually touch a handful of the required fields:

  • architecture - pick the model family: Z-Image Turbo, FLUX.1-dev, Wan 2.2 High, Wan 2.2 Low, or Wan 2.2 Combo.
  • ai_toolkit_path - the folder where you installed ai-toolkit. The node doesn't need ai-toolkit's own UI running; it just needs to know where the code lives.
  • inputcount plus paired image_N / caption_N inputs (up to 100), or point images_path at a folder instead.
  • training_steps (default 500), learning_rate (default 0.0005), lora_rank (default 16), and vram_mode (Max 1256px down to Min 512px) - the knobs that actually move outcomes.
  • output_name and keep_lora control where the result lands and whether it sticks around after the run.

Output is a single lora_path string. Wire it into ApplyTrainedLora to test the result in the same workflow, or into one of the Selective LoRA Loaders' lora_path_opt input if you want per-block control on your very first test.

Installing it

Grab the node itself via ComfyUI Manager (search "Realtime LoRA Trainer") or manually:

cd ComfyUI/custom_nodes
git clone https://github.com/ShootTheSound/comfyUI-Realtime-Lora

Restart ComfyUI. That gets you the node - training won't run until ai-toolkit itself is installed separately per its own instructions, with the path pasted into ai_toolkit_path. First run on a fresh setup pulls the base model from Hugging Face into your local HF cache automatically; that's a multi-gigabyte download, so don't panic if the first queue takes a while.

Common issues

Wrong Python version. Both AI-Toolkit and sd-scripts (used by this pack's other trainers) want Python 3.10–3.12. 3.10 is the safest pick; skip 3.13 entirely for now.

RTX 50-series stalls on install. Blackwell cards need PyTorch 2.7+ with CUDA 12.8, and the standard ai-toolkit installer doesn't always get you there - the community fix is omgitsgb's installer script. Note this only applies to this particular node's backend; the Musubi Tuner trainers elsewhere in this pack aren't affected.

Overcooked results. The default learning rate here (0.0005) trains fast, and fast is also how you overshoot - the community's 2026 recipes for equivalent models run closer to 5e-5–1e-4. If your subject bleeds into everything or the LoRA looks burned in, drop the learning rate before you touch anything else.

Wan mode confusion. Training "High" or "Low" doesn't skip loading the other model - the example workflows still wire the LoRA into both, with the untrained one held at zero strength. That's deliberate: it stops ComfyUI from pulling the full base model into memory before training even starts.

Categoryloaders

Inputs (20)

NameTypeDefaultDescription
inputcountINT41–100Number of image inputs. Click 'Update inputs' button after changing.
images_pathSTRINGOptional: Path to folder containing training images. If provided, images from this folder are used instead of image inputs. Caption .txt files with matching names are used if present.
architectureCOMBOZ-Image TurboModel architecture to train on. Model is auto-downloaded from HuggingFace.
ai_toolkit_pathSTRING~/ai-toolkitPath to your AI-Toolkit installation. Changes are saved automatically.
captionSTRINGphoto of subjectDefault caption for all images. Per-image caption inputs override this.
training_stepsINT50010–5000Number of training steps. 500 is a good starting point. Increase for more images or complex subjects.
learning_rateFLOAT0.00050.00001–0.1Learning rate. 0.0005 trains fast but may overshoot. Experiment with lowering for more stable/slower training.
lora_rankINT164–128LoRA rank/dimension. 16-32 typical. Higher = more capacity but larger file and more VRAM.
vram_modeCOMBOLow (768px)VRAM optimization preset. Images are automatically resized to the specified resolution.
keep_loraBOOLEANtrueIf True, keeps the trained LoRA file. If False, deletes after use.
output_nameSTRINGMyLoraCustom name for the output LoRA. Timestamp will be appended.
custom_python_exeSTRINGAdvanced: Optionally enter the full path to a custom python.exe (e.g. C:\my-venv\Scripts\python.exe). If empty, uses the venv inside ai_toolkit_path. The ai_toolkit_path field is still required for locating training scripts.
image_1optIMAGETraining image (not needed if images_path is set).
caption_1optSTRINGCaption for image_1. Overrides default caption.
image_2optIMAGETraining image.
caption_2optSTRINGCaption for image_2. Overrides default caption.
image_3optIMAGETraining image.
caption_3optSTRINGCaption for image_3. Overrides default caption.
image_4optIMAGETraining image.
caption_4optSTRINGCaption for image_4. Overrides default caption.

Outputs (1)

NameTypeDescription
lora_pathSTRINGPath to the trained LoRA file. Connect to ApplyTrainedLora node.