Anima Batch Train Config
Every training knob in this pack, in one node
- ANIMA_TRAIN_CONFIG
AnimaBatchTrainConfig is the control room for the whole batch. It's a wide node with ~25 inputs, and at first glance it looks like the worst kind of Kohya-era config sprawl - every field a network_dim, every dropdown a trap. It's actually less scary than it looks: the defaults are sane for Anima-Base, and it produces a single ANIMA_TRAIN_CONFIG object that AnimaBatchStartTrain turns into a real sd-scripts command. Most beginners only ever touch a handful of these.
How it works
The node doesn't train anything; it just packages your settings into a config dict. The interesting logic happens one node downstream, in train_runner.py: the config fields map onto sd-scripts flags, paths get resolved, and the repeat count gets calculated.
The two things worth understanding deeply:
Presets are defaults, not modes. training_preset has smoke_test, standard, strong, and style - but they don't reroute the training path. Per the code, each preset only fills in fields you've left empty (smoke_test = 500 target steps / 768² / rank 16, standard = 2000 steps / 1024² / rank 32, strong = 3000 / 3e-5, style = 4000 / 1e-5 at 768²). Since the node always sends concrete defaults, the preset only really bites if you clear fields. Think of it as a quick config loader, not a mode switch.
Repeat math keeps different folders at similar strength. With training_strength_mode = target_steps, it computes num_repeats = ceil(target_steps_per_lora * batch_size / image_count / max_train_epochs), then estimates actual_steps = ceil(image_count * repeats * epochs / batch_size). A 20-image folder and an 80-image folder therefore land near the same total step count, and the log warns if a folder's actual steps drift more than 70–180% of target. This is the pack's answer to the classic "big folder overtrains, small folder underachieves" problem. Set training_strength_mode = manual_epochs if you'd rather just pick num_repeats yourself.
The inputs that matter
- base_model_path - must point at
anima-base-v1.0.safetensors. The default resolves relative to your ComfyUI folder, so it usually just works. - python_executable and train_script_path - leave these blank and the pack auto-selects the Windows backend and wrapper. Only touch them if you moved things.
- resolution -
1024,1024for standard; thestyle/smoke_testpresets drop to 768². - network_dim / network_alpha - the classic Kohya pair, 32/32 in the README's tuned workflow. Anima is a 2B DiT, not SDXL: the KB's Anima notes say LoRAs plateau early (~1800 steps) and overfit past ~2400–3000 regardless of dataset size, so don't reach for huge rank.
- max_train_epochs, target_steps_per_lora, save_strategy - epochs (10 in the tuned workflow), your per-LoRA step budget, and whether to keep checkpoints every N epochs or only the final one.
- extra_args - the multiline box that carries Anima's special flags:
--network_module networks.lora_anima,--network_train_unet_only,--qwen3and--vaepaths,--timestep_sampling sigmoid --discrete_flow_shift 1.0, gradient checkpointing and cached latents. Leave it alone unless you know what you're changing. - shuffle_caption / keep_tokens -
shuffle_caption = truewithkeep_tokens = 1locks the trigger word as the first token while the rest of the tags shuffle. The README calls this "trigger word protection."
Installing it
It's a stock node in the AnimaForge Windows pack: ComfyUI Manager → "ComfyUI-AnimaForge-Windows", or
cd C:\ComfyUI\custom_nodes
git clone https://github.com/AI-KSK/ComfyUI-AnimaForge-Windows.git
cd ComfyUI-AnimaForge-Windows
powershell -ExecutionPolicy Bypass -File .\scripts\install_windows.ps1 -SetupBackend
Common issues
The biggest one is version blindness: this config is tuned for Anima-Base v1.0, and the community's rule of thumb is that LoRAs need a retrain after any Anima version bump - Preview 3 famously broke Preview 2 LoRAs. If you point the config at a different base, expect to rework extra_args and step budgets. And if you're new, run smoke_test first: confirming the whole batch pipeline works before committing to a 10-epoch run is the difference between a 2-minute smoke test and a wasted hour.
Inputs (24)
| Name | Type | Default | Description |
|---|---|---|---|
| train_script_path | STRING | /tmp/ComfyUI/custom_nodes/ComfyUI-AnimaForge-Windows/scripts/anima_train_network_wrapper.py | — |
| python_executable | STRING | /tmp/ComfyUI/custom_nodes/ComfyUI-AnimaForge-Windows/backend/sd-scripts/.venv/bin/python | — |
| base_model_path | STRING | /tmp/ComfyUI/models/diffusion_models/anima-base-v1.0.safetensors | — |
| output_dir | STRING | /tmp/ComfyUI/models/loras/anima_lora | — |
| resolution | STRING | 1024,1024 | — |
| train_batch_size | INT | 11–64 | — |
| max_train_epochs | INT | 101–10000 | — |
| save_every_n_epochs | INT | 11–10000 | — |
| network_dim | INT | 321–1024 | — |
| network_alpha | INT | 161–1024 | — |
| learning_rate | STRING | 1e-4 | — |
| mixed_precision | COMBO | bf16 | 3 options: bf16, fp16, no |
| optimizer_type | STRING | adamw8bit | — |
| shuffle_caption | BOOLEAN | true | — |
| keep_tokens | INT | 10–1000 | — |
| caption_separator | STRING | , | — |
| caption_extension | STRING | .txt | — |
| extra_args | STRING | --qwen3 /tmp/ComfyUI/models/clip/qwen_3_06b_base.safetensors --vae /tmp/ComfyUI/models/vae/qwen_image_vae.safetensors --save_model_as safetensors --network_module networks.lora_anima --network_train_unet_only --lr_scheduler constant --timestep_sampling sigmoid --discrete_flow_shift 1.0 --gradient_checkpointing --cache_latents --vae_chunk_size 64 --vae_disable_cache --max_data_loader_n_workers 0 | — |
| stop_on_error | BOOLEAN | true | — |
| training_preset | COMBO | standard | 4 options: smoke_test, standard, strong, style |
| training_strength_mode | COMBO | target_steps | 2 options: target_steps, manual_epochs |
| target_steps_per_lora | INT | 20001–1000000 | — |
| num_repeats | INT | 11–10000 | — |
| save_strategy | COMBO | final_only | 2 options: final_only, every_n_epochs |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| ANIMA_TRAIN_CONFIG | ANIMA_TRAIN_CONFIG | — |