Nodes/ComfyUI-TrainTools-MZ/MinusZone - HYDiTAdvConfig
ComfyUI Node

MinusZone - HYDiTAdvConfig

The deepspeed-flavored tuning node for native Hunyuan DiT training

By MinusZoneAI·Created 2 years ago·Updated 5 months ago· 67
MinusZone - HYDiTAdvConfig
    • advanced_config
    lr1e-5
    rope_realenable
    target_modules_Wqkvenable
    target_modules_q_projenable
    target_modules_kv_projenable
    target_modules_out_projenable
    warmup_min_lr1e-6
    weight_decay0.00
    warmup_num_steps0.00
    uncond_p0.20
    uncond_p_t50.20
    use_flash_attndisable
    use_zero_stage2
    grad_accu_steps1
    extra_fp16enable
    qk_normenable
    normlayer

    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") and warmup_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 default enable. These pick which attention modules get trained: the fused Wqkv path, or the individual projections. For a LoRA on Hunyuan DiT you usually keep them all on; disabling Wqkv and keeping the individual ones is the fine-grained alternative.
    • qk_norm (enable) and norm (rms or layer) - query-key normalization and the normalization layer type. These are architecture settings; the defaults match the stock script. Don't flip them casually.
    • uncond_p and uncond_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.

    CategoryMinusZone - TrainTools/HYDiT_native

    Inputs (17)

    NameTypeDefaultDescription
    lrSTRING1e-5
    rope_realCOMBOenable2 options: enable, disable
    target_modules_WqkvCOMBOenable2 options: enable, disable
    target_modules_q_projCOMBOenable2 options: enable, disable
    target_modules_kv_projCOMBOenable2 options: enable, disable
    target_modules_out_projCOMBOenable2 options: enable, disable
    warmup_min_lrSTRING1e-6
    weight_decayFLOAT0.00
    warmup_num_stepsFLOAT0.00
    uncond_pFLOAT0.20
    uncond_p_t5FLOAT0.20
    use_flash_attnCOMBOdisable2 options: enable, disable
    use_zero_stageINT2
    grad_accu_stepsINT1
    extra_fp16COMBOenable2 options: enable, disable
    qk_normCOMBOenable2 options: enable, disable
    normCOMBOlayer2 options: rms, layer

    Outputs (1)

    NameTypeDescription
    advanced_configMZ_TT_HYDiT_AdvConfig