MinusZone - HYDiTAdvConfig
The deepspeed-flavored tuning node for native Hunyuan DiT training
- advanced_config
MZ_HYDiTAdvConfig is the advanced-config node for the native Hunyuan DiT path, and it's a different animal from the kohya-family MZ_KohyaSSAdvConfig. Where that node mirrors sd-scripts flags, this one mirrors Tencent's HunyuanDiT training script arguments - deepspeed zero stages, flash attention, mT5 caption dropout, and target module selection. If you train Hunyuan DiT natively without this node, you get the script's defaults. With it, you're in the weeds of a DiT fine-tune.
The good news: defaults are sensible, and for a first native run you can skip this node entirely - MZ_HYDiTTrain treats it as optional. The bad news: this is where the pack gets most technical, and it's aimed at the specific architecture of Hunyuan DiT (a diffusion transformer with CLIP + mT5 dual text encoders, per Tencent's design).
Inputs that matter
lr(default"1e-5") andwarmup_min_lr("1e-6"),warmup_num_steps,weight_decay- the optimizer schedule. Strings for the LRs, because that's how the native script parses them.target_modules_Wqkv,target_modules_q_proj,target_modules_kv_proj,target_modules_out_proj- all defaultenable. These pick which attention modules get trained: the fusedWqkvpath, or the individual projections. For a LoRA on Hunyuan DiT you usually keep them all on; disablingWqkvand keeping the individual ones is the fine-grained alternative.qk_norm(enable) andnorm(rmsorlayer) - query-key normalization and the normalization layer type. These are architecture settings; the defaults match the stock script. Don't flip them casually.uncond_panduncond_p_t5(both 0.2) - caption dropout probability, separately for the CLIP feature extraction and the mT5 extraction. The script's own comment calls them "the probability of dropping training text." Higher = more unconditional training, generally not what you want for a likeness.use_flash_attn(disable default) - flash attention acceleration during training. Enabling it can speed things up if your setup supports it, but it's off by default for compatibility.use_zero_stage(default 2) - deepspeed ZeRO stage; the native trainer is built around deepspeed, and this is why the path needs it installed. Stage 2 is the safe default; 3 trades more.grad_accu_steps(default 1) - gradient accumulation; raise it to fake a bigger batch on small VRAM.extra_fp16(enable) - extra fp16 for VAE and text encoder. Leave on.rope_real(enable) - rotary position embedding. Architecture flag; leave alone.
Output is advanced_config (type MZ_TT_HYDiT_AdvConfig) - feed it into MZ_HYDiTTrain's optional advanced_config input.
Install & troubleshooting
cd ComfyUI/custom_nodes
git clone https://github.com/MinusZoneAI/ComfyUI-TrainTools-MZ
# restart ComfyUI
Nothing to install for the node itself, but remember what it configures: the native trainer needs deepspeed, and deepspeed needs to match your CUDA/torch - the pack explicitly refuses to auto-install it and tells you to pick the right version. And keep the mental model that this is a niche model's advanced panel: nearly every switch here corresponds to a parser.add_argument in Tencent's script (the node source literally annotates them), so when you're stuck, the HunyuanDiT repo's docs and issue tracker are the reference, not the pack README - which, like most of this pack, is thin and bilingual.
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| lr | STRING | 1e-5 | — |
| rope_real | COMBO | enable | 2 options: enable, disable |
| target_modules_Wqkv | COMBO | enable | 2 options: enable, disable |
| target_modules_q_proj | COMBO | enable | 2 options: enable, disable |
| target_modules_kv_proj | COMBO | enable | 2 options: enable, disable |
| target_modules_out_proj | COMBO | enable | 2 options: enable, disable |
| warmup_min_lr | STRING | 1e-6 | — |
| weight_decay | FLOAT | 0.00 | — |
| warmup_num_steps | FLOAT | 0.00 | — |
| uncond_p | FLOAT | 0.20 | — |
| uncond_p_t5 | FLOAT | 0.20 | — |
| use_flash_attn | COMBO | disable | 2 options: enable, disable |
| use_zero_stage | INT | 2 | — |
| grad_accu_steps | INT | 1 | — |
| extra_fp16 | COMBO | enable | 2 options: enable, disable |
| qk_norm | COMBO | enable | 2 options: enable, disable |
| norm | COMBO | layer | 2 options: rms, layer |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| advanced_config | MZ_TT_HYDiT_AdvConfig | — |