Nodes/VRGameDevGirl Video Enhancement Nodes/VRGDG Z-Image LoRA Train Chunk
ComfyUI Node

VRGDG Z-Image LoRA Train Chunk

Runs one Z-Image LoRA training chunk using musubi-tuner, optionally caches if needed, converts the latest LoRA to ComfyUI format, and can apply it to the returned MODEL.

By vrgamegirl19·Created about a year ago·Updated 22 days ago· 533
VRGDG Z-Image LoRA Train Chunk
  • model
  • model
  • latest_state_path
  • log_path
  • latest_comfy_lora_path
  • output_name
  • completed_steps
  • total_target_steps
dataset_images_dir
workspace_dir
run_nameZImageChunkRun
output_nameZImageChunkRun
resolution_width1024
resolution_height1024
steps_per_run250
total_target_steps3000
network_dim32
network_alpha32
blocks_to_swap4
clear_memory_before_text_encodertrue
learning_rate_preset1e-4
learning_rate0.0001
num_repeats1
cache_strategyauto
copy_latest_to_comfy_lorastrue
keep_only_comfy_lorafalse
strength_model1.00
create_captionsfalse
caption_text
add_trigger_wordfalse
trigger_text
musubi_rootA:/MUSUBI/musubi-tuner-ltx2
zimage_checkpointA:/MUSUBI/models/zimage/zimage-base.safetensors
vaeA:/MUSUBI/models/zimage/vae.safetensors
text_encoderA:/MUSUBI/models/qwen3
fp8_basetrue
fp8_scaledtrue
fp8_llmfalse
use_32bit_attentionfalse
CategoryVRGDG/Training

Inputs (32)

NameTypeDefaultDescription
modelMODELBase model to return downstream with the latest trained LoRA optionally applied.
dataset_images_dirSTRINGFolder containing your training images, or a parent folder that will be organized into an images subfolder.
workspace_dirSTRINGWorking folder for cache, logs, config files, checkpoints, and training state.
run_nameSTRINGZImageChunkRunName prefix used for the log file.
output_nameSTRINGZImageChunkRunName prefix used for saved LoRA files and state folders.
resolution_widthINT102464–8192Training bucket width written to the musubi dataset config.
resolution_heightINT102464–8192Training bucket height written to the musubi dataset config.
steps_per_runINT2501–100000How many steps to train per run, and also when to save the LoRA/state at the end of that run.
total_target_stepsINT30001–1000000Training stops once the latest saved step reaches this total.
network_dimINT321–2048LoRA rank.
network_alphaINT321–2048LoRA alpha scaling value.
blocks_to_swapINT40–28Higher values reduce VRAM usage but usually slow training.
clear_memory_before_text_encoderBOOLEANtrueTries to unload ComfyUI models and clear VRAM/RAM before text encoder caching.
learning_rate_presetCOMBO1e-4Quick preset for the training learning rate. Choose Custom to use the float input below.
learning_rateFLOAT0.00011e-8–1Custom learning rate used only when the preset is set to Custom.
num_repeatsINT11–1000How many times each image-caption pair is repeated in the dataset.
cache_strategyCOMBOautoAuto builds cache only when needed, Force always rebuilds it, Skip goes straight to training.
copy_latest_to_comfy_lorasBOOLEANtrueCopies the latest Comfy-compatible LoRA into the ComfyUI loras folder after training.
keep_only_comfy_loraBOOLEANfalseIf enabled, deletes the standard .safetensors LoRA files after a matching .comfy.safetensors file exists.
strength_modelFLOAT1.00-100–100Strength used if the node applies the latest LoRA back onto the output model.
create_captionsBOOLEANfalseIf enabled, missing caption txt files are created automatically using the caption text input.
caption_textSTRINGBase caption text used when create_captions is enabled and an image has no caption file.
add_trigger_wordBOOLEANfalseIf enabled, the trigger text is prepended to each caption.
trigger_textSTRINGTrigger word or phrase to prepend to captions when add_trigger_word is enabled.
musubi_rootSTRINGA:/MUSUBI/musubi-tuner-ltx2Root folder of your musubi-tuner-ltx2 install.
zimage_checkpointSTRINGA:/MUSUBI/models/zimage/zimage-base.safetensorsPath to the base Z-Image DiT checkpoint used for caching and training.
vaeSTRINGA:/MUSUBI/models/zimage/vae.safetensorsPath to the Z-Image VAE checkpoint.
text_encoderSTRINGA:/MUSUBI/models/qwen3Path to the Qwen3 text encoder checkpoint or directory.
fp8_baseBOOLEANtrueEnable fp8 base model weights during Z-Image training.
fp8_scaledBOOLEANtrueEnable scaled fp8 weights during Z-Image training. Requires fp8_base.
fp8_llmBOOLEANfalseLoads the text encoder in fp8 mode during caching to reduce VRAM usage.
use_32bit_attentionBOOLEANfalseUse 32-bit precision for attention computations in the Z-Image model.

Outputs (7)

NameTypeDescription
modelMODEL
latest_state_pathSTRING
log_pathSTRING
latest_comfy_lora_pathSTRING
output_nameSTRING
completed_stepsINT
total_target_stepsINT