Nodes/Realtime LoRA Trainer/Realtime LoRA Trainer (Qwen Image - Musubi Tuner)
ComfyUI Node

Realtime LoRA Trainer (Qwen Image - Musubi Tuner)

Train Qwen-Image style and subject LoRAs in ComfyUI

By shootthesound·Created 8 months ago·Updated 2 months ago· 538
Realtime LoRA Trainer (Qwen Image - Musubi Tuner)
  • image_1
  • image_2
  • image_3
  • image_4
  • lora_path
inputcount4
images_path
musubi_path~/musubi-tuner
model_modeQwen-Image
dit_model
vae_model
text_encoder
captionphoto of subject
training_steps500
learning_rate0.0003
lora_rank16
vram_modeMedium (768px) fp8
blocks_to_swap30
keep_loratrue
output_nameMyQwenLora
custom_python_exe
caption_1
caption_2
caption_3
caption_4

What it is

MusubiQwenImageLoraTrainer trains a LoRA on Alibaba's Qwen-Image family - the 20B Apache 2.0 model best known for its text rendering and complex prompt adherence - right inside your ComfyUI graph. It runs on Musubi Tuner, Kohya's second trainer (the one that split off sd-scripts to chase newer architectures), and it's the plain generation-side trainer in this pack: no control images, no before/after pairs, just style or subject LoRAs from a set of reference images. If you want to teach the model an editing behavior instead of a look, that's a different node in this pack, MusubiQwenImageEditLoraTrainer.

Qwen-Image itself isn't most people's daily driver for text-to-image - it's heavier than Z-Image or Flux Klein - but its Apache 2.0 license means no platform will pull your LoRA for a licensing technicality, and the text-rendering strength carries through to fine-tunes. If your subject involves signage, labels, or in-image text, this is a reasonable place to put the training budget.

How it works

The node drives Musubi Tuner's own training pipeline against whichever Qwen-Image variant you point it at - the mode selector covers plain Qwen-Image as well as the Edit line's checkpoints, in case you want to train a style LoRA that happens to run on the edit model too. Musubi Tuner caches text embeddings once up front, which is the standard modern-trainer speed lever now that text encoders on current-gen models are frozen language models rather than something you'd fine-tune.

Inputs and outputs that matter

  • model_mode - Qwen-Image, Qwen-Image-Edit, or Qwen-Image-Edit-2509, all trainable from plain images through this node.
  • dit_model, vae_model, text_encoder - dropdowns populated from your local model folders; the README is explicit that you need the bf16 builds here, not the pre-quantized fp8 ones, which don't work for training.
  • inputcount plus image_N / caption_N pairs, or images_path for a folder.
  • training_steps (500 default), learning_rate (0.0003), lora_rank (16).
  • vram_mode - six presets from Max (1024px) down to Low (512px), each with an fp8 variant for lower memory use during inference-side ops.
  • blocks_to_swap - an enum from 0 up to 45, Musubi's block-offloading control: the higher the number, the more transformer blocks get pushed to CPU RAM to save VRAM, at a speed cost.

Output is a single lora_path string, ready for ApplyTrainedLora or the Qwen Selective Loader.

Installing it

The node itself installs with the rest of the pack - ComfyUI Manager (search "Realtime LoRA Trainer") or:

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

Restart ComfyUI. Training won't work until Musubi Tuner is installed separately and its path is set in musubi_path. You'll also need to download the specific models by hand: the bf16 DiT (qwen_image_bf16.safetensors from Comfy-Org, or the Edit variant), qwen_image_vae.safetensors, and qwen_2.5_vl_7b.safetensors as the text encoder. The example workflows link the exact files.

Common issues

Training silently underperforms or errors with fp8 models. This is the single most common trap the README flags directly: pre-quantized fp8 Qwen-Image models don't work for training, only bf16. If your dropdowns are empty or training behaves strangely, check you downloaded the right precision.

Running out of VRAM. Qwen-Image is a 20B model - raise blocks_to_swap before you drop resolution, and switch to an fp8 vram_mode preset if you're still tight. Musubi's own guidance recommends 12GB VRAM and 64GB system RAM as a reasonable floor for image models.

Python version. Same as this pack's other trainers: 3.10–3.12, skip 3.13.

Categoryloaders

Inputs (24)

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.
musubi_pathSTRING~/musubi-tunerPath to musubi-tuner installation.
model_modeCOMBOQwen-ImageModel type. Use Qwen-Image for text-to-image, Edit variants for image editing models. For edit training WITH control images, use the separate Edit trainer node.
dit_modelCOMBOQwen Image DiT model from diffusion_models folder. Match model to selected mode.
vae_modelCOMBOQwen Image VAE model from vae folder (qwen_image_vae.safetensors).
text_encoderCOMBOQwen2.5-VL text encoder from text_encoders or clip folder.
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.
learning_rateFLOAT0.00030.00001–0.1Learning rate. 3e-4 (0.0003) is recommended for Qwen Image training.
lora_rankINT164–128LoRA rank/dimension. 16 is recommended for Qwen Image.
vram_modeCOMBOMedium (768px) fp8VRAM optimization preset. Controls resolution, fp8, and gradient checkpointing.
blocks_to_swapCOMBO30Number of transformer blocks to offload to CPU (0-45). Higher = less VRAM but slower. 30 is a good balance.
keep_loraBOOLEANtrueIf True, keeps the trained LoRA file.
output_nameSTRINGMyQwenLoraCustom 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 musubi_path. The musubi_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 Qwen Image LoRA file.