Realtime LoRA Trainer
Train a LoRA on AI-Toolkit without leaving ComfyUI
- image_1
- image_2
- image_3
- image_4
- lora_path
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.inputcountplus pairedimage_N/caption_Ninputs (up to 100), or pointimages_pathat a folder instead.training_steps(default 500),learning_rate(default 0.0005),lora_rank(default 16), andvram_mode(Max 1256px down to Min 512px) - the knobs that actually move outcomes.output_nameandkeep_loracontrol 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.
Inputs (20)
| Name | Type | Default | Description |
|---|---|---|---|
| inputcount | INT | 41–100 | Number of image inputs. Click 'Update inputs' button after changing. |
| images_path | STRING | Optional: 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. | |
| architecture | COMBO | Z-Image Turbo | Model architecture to train on. Model is auto-downloaded from HuggingFace. |
| ai_toolkit_path | STRING | ~/ai-toolkit | Path to your AI-Toolkit installation. Changes are saved automatically. |
| caption | STRING | photo of subject | Default caption for all images. Per-image caption inputs override this. |
| training_steps | INT | 50010–5000 | Number of training steps. 500 is a good starting point. Increase for more images or complex subjects. |
| learning_rate | FLOAT | 0.00050.00001–0.1 | Learning rate. 0.0005 trains fast but may overshoot. Experiment with lowering for more stable/slower training. |
| lora_rank | INT | 164–128 | LoRA rank/dimension. 16-32 typical. Higher = more capacity but larger file and more VRAM. |
| vram_mode | COMBO | Low (768px) | VRAM optimization preset. Images are automatically resized to the specified resolution. |
| keep_lora | BOOLEAN | true | If True, keeps the trained LoRA file. If False, deletes after use. |
| output_name | STRING | MyLora | Custom name for the output LoRA. Timestamp will be appended. |
| custom_python_exe | STRING | Advanced: 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_1opt | IMAGE | Training image (not needed if images_path is set). | |
| caption_1opt | STRING | Caption for image_1. Overrides default caption. | |
| image_2opt | IMAGE | Training image. | |
| caption_2opt | STRING | Caption for image_2. Overrides default caption. | |
| image_3opt | IMAGE | Training image. | |
| caption_3opt | STRING | Caption for image_3. Overrides default caption. | |
| image_4opt | IMAGE | Training image. | |
| caption_4opt | STRING | Caption for image_4. Overrides default caption. |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| lora_path | STRING | Path to the trained LoRA file. Connect to ApplyTrainedLora node. |