VRGDG LTX LoRA Train Chunk
Train an LTX-2 LoRA From Inside ComfyUI, One Chunk at a Time
- model
- model
- latest_state_path
- log_path
- video_filename_prefix
- output_name
- completed_steps
- total_target_steps
VRGDG_LTXLoraTrainChunk runs one chunk of LTX-2 LoRA training using musubi-tuner, right from your workflow - train a few hundred steps, preview the result, then run the next chunk and keep going. It's the node that turns LoRA training into a ComfyUI graph instead of a separate terminal ritual.
This is the heaviest node in the pack, and the honest summary is: it's a wrapper around musubi-tuner (kohya-ss's trainer, the one the community has gravitated to for video and modern-architecture training). It shells out to musubi, manages the dataset config, caches the text-encoder embeddings, and hands you back a model with the freshly trained LoRA applied for a quick preview. Nothing about training is free - this needs the trainer installed, a 22B LTX-2 checkpoint, and a serious GPU (musubi's own guidance is 24GB VRAM for video training, 64GB system RAM). What the node buys you is the plumbing.
Inputs worth knowing
There are ~30, which is a lot, but they cluster into a few groups.
The paths - get these right first. musubi_root, ltx2_checkpoint, and gemma_root tell the node where musubi, the base checkpoint, and the Gemma text-encoder files live. The defaults are the author's own Windows machine (A:/MUSUBI/...) - you must repoint these to your install or nothing runs. This is the single most common reason this node fails for someone else.
The dataset. dataset_images_dir (your training images, captioned with sibling .txt files), workspace_dir (where cache, logs, configs, and checkpoints go), run_name/output_name, num_repeats. With create_captions on, the node writes caption files from caption_text, and add_trigger_word/trigger_text prepend a trigger word to each - which, per the LoRA training orthodoxy in the KB, is how you keep a character concept recallable at inference.
The training recipe. resolution_width/resolution_height (defaults 1920×1080; the tooltips suggest 960×540 for light tests), steps_per_run (how many steps this chunk trains - 250 default), total_target_steps (when to stop overall - 3000 default), network_dim (LoRA rank, default 64), network_alpha (default 32, "alpha at half the rank" per the tooltip and the community's modern default), learning_rate_preset (a picker: 1e-4 aggressive through 1e-5 gentle, default 7e-5), and blocks_to_swap (musubi's block swapping to trade VRAM for speed - 0 to disable, 4 balanced, 8–12 for lower-VRAM cards).
The memory dance. clear_memory_before_gemma unloads ComfyUI models before the Gemma text-encoder caching stage (keep it on if stage 2 stalls), gemma_load_in_4bit squeezes VRAM further, and gemma_recovery_mode is the experimental fallback if caching fails. cache_strategy (auto/force/skip) controls whether the cache rebuilds.
The outputs. model comes back with the latest LoRA applied at strength_model (0.0 disables the application) so you can run a preview generation right in the graph. copy_latest_to_comfy_loras drops the .comfy.safetensors file into your ComfyUI loras folder (and keep_only_comfy_lora cleans up the raw files). Plus latest_state_path, log_path, video_filename_prefix, output_name, and the two progress ints completed_steps and total_target_steps.
Why "chunked" training is the point
Train 250 steps, preview the LoRA on a real generation, and only then decide whether to keep going. If the preview is weak, tweak the recipe and run another chunk; if it's overfit, stop early. You're never committing to a 3,000-step run blind - which matters because LTX-2 LoRA training is expensive enough that a wasted full run is a real loss. The chunk model is genuinely the right way to train on video hardware.
Install
Same pack install:
cd ComfyUI/custom_nodes
git clone https://github.com/vrgamegirl19/comfyui-vrgamedevgirl
Restart ComfyUI; find it under VRGDG/Training. Then the real install: get musubi-tuner (the LTX-2 variant) onto disk, download the LTX-2/2.3 checkpoint and Gemma files, and point the three path inputs at them. The pack's requirements.txt (kornia, librosa, imageio) does not cover musubi's own dependencies - musubi is a separate project with its own environment.
Honest note
This node is the one I'd call "for the author's own machine first." The Windows absolute-path defaults, the musubi dependency, and the 24GB+ VRAM appetite mean it's not a beginner toy - but if you're already running musubi-tuner for LTX-2, this genuinely saves you the config-file drudgery and gives you the loop-training workflow for free. The single biggest gotcha (the A:/MUSUBI paths) is also the easiest to fix: repoint, verify the checkpoint loads, and start with 50 steps per chunk to smoke-test before spending real time.
Inputs (29)
| Name | Type | Default | Description |
|---|---|---|---|
| model | MODEL | Base model to return downstream with the latest trained LoRA optionally applied. | |
| dataset_images_dir | STRING | Folder containing your training images, or a parent folder that will be organized into an images subfolder. | |
| workspace_dir | STRING | Working folder for cache, logs, config files, checkpoints, and training state. | |
| run_name | STRING | LTXChunkRun | Name prefix used for the log file. |
| output_name | STRING | LTXChunkRun | Name prefix used for saved LoRA files and state folders. |
| resolution_width | INT | 192064–8192 | Training bucket width written to the musubi dataset config. Examples: 960 for lighter tests, 1280 for medium runs, 1920 for full HD style training. |
| resolution_height | INT | 108064–8192 | Training bucket height written to the musubi dataset config. Examples: 540 for lighter tests, 720 for medium runs, 1080 for full HD style training. |
| steps_per_run | INT | 2501–100000 | How many steps to train per run, and also when to save the LoRA/state at the end of that run. Examples: 50 for quick tests, 250 for normal preview cadence, 500 for longer chunks. |
| total_target_steps | INT | 30001–1000000 | Training stops once the latest saved step reaches this total. Examples: 1000 for a short experiment, 3000 for a normal run, 6000+ for longer training. |
| network_dim | INT | 641–2048 | LoRA rank. Higher values increase capacity and VRAM usage. Examples: 16 for very small tests, 32 for lighter runs, 64 as a common default, 128 for larger higher-capacity LoRAs. |
| network_alpha | INT | 321–2048 | LoRA alpha scaling value. A common pairing is alpha at half the rank. Examples: rank 16 -> alpha 8, rank 32 -> alpha 16, rank 64 -> alpha 32. |
| blocks_to_swap | INT | 40–64 | Higher values reduce VRAM usage but usually slow training. Use 0 to disable block swapping. Examples: 0 for max speed if VRAM is sufficient, 4 as a balanced default, 8 to 12 for lower VRAM cards. |
| clear_memory_before_gemma | BOOLEAN | true | Tries to unload ComfyUI models and clear VRAM/RAM before Gemma text encoder caching. Keep enabled if stage 2 tends to stall. |
| learning_rate_preset | COMBO | 7e-5 | Quick preset for the training learning rate. Examples: 1e-4 for aggressive training, 7e-5 as a common default, 5e-5 or 3e-5 for gentler training. Choose Custom to use the float input below. |
| learning_rate | FLOAT | 0.00011e-8–1 | Custom learning rate used only when the preset is set to Custom. Examples: 0.0001 = 1e-4, 0.00007 = 7e-5, 0.00005 = 5e-5, 0.00003 = 3e-5. |
| num_repeats | INT | 11–1000 | How many times each image-caption pair is repeated in the dataset. Examples: 1 for normal use, 2 to 4 if the dataset is very small, higher only when you intentionally want more repeats. |
| cache_strategy | COMBO | auto | Auto builds cache only when needed, Force always rebuilds it, Skip goes straight to training. |
| copy_latest_to_comfy_loras | BOOLEAN | true | Copies the latest Comfy-compatible LoRA into the ComfyUI loras folder after training. |
| keep_only_comfy_lora | BOOLEAN | false | If enabled, deletes the standard .safetensors LoRA files after a matching .comfy.safetensors file exists. Resume state folders are kept. |
| strength_model | FLOAT | 1.00-100–100 | Strength used if the node applies the latest LoRA back onto the output model. Examples: 1.0 for normal preview, 0.7 for a lighter effect, 0.0 to effectively disable applying the LoRA to the returned model. |
| create_captions | BOOLEAN | false | If enabled, missing caption txt files are created automatically using the caption text input. |
| caption_text | STRING | Base caption text used when create_captions is enabled and an image has no caption file. Example: woman portrait, cinematic close-up, soft natural light. | |
| add_trigger_word | BOOLEAN | false | If enabled, the trigger text is prepended to each caption. |
| trigger_text | STRING | Trigger word or phrase to prepend to captions when add_trigger_word is enabled. Examples: miranda, my_character, retro-future heroine. | |
| musubi_root | STRING | A:/MUSUBI/musubi-tuner-ltx2 | Root folder of your musubi-tuner-ltx2 install. |
| ltx2_checkpoint | STRING | A:/MUSUBI/models/ltx2/ltx-2.3-22b-dev.safetensors | Path to the base LTX-2 checkpoint used for caching and training. |
| gemma_root | STRING | A:/MUSUBI/models/gemma3 | Folder containing the Gemma model files used for text encoder caching. |
| gemma_recovery_mode | BOOLEAN | false | Experimental. If enabled, the node will keep the normal Gemma cache path first, then try alternate cache settings if that stage fails. |
| gemma_load_in_4bit | BOOLEAN | false | Loads Gemma in 4-bit mode during text encoder caching. This lowers VRAM more than 8-bit, but can be slower or less stable. |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| latest_state_path | STRING | — |
| log_path | STRING | — |
| video_filename_prefix | STRING | — |
| output_name | STRING | — |
| completed_steps | INT | — |
| total_target_steps | INT | — |