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

MinusZone - HYDiTTrain

Auto-downloads weights, needs deepspeed by hand

By MinusZoneAI·Created 2 years ago·Updated 5 months ago· 67
MinusZone - HYDiTTrain
  • workspace_config
  • advanced_config
  • has_no_effect
    unet_pathauto
    ema_to_moduleenable
    vae_ema_pathauto
    text_encoder_pathauto
    tokenizer_pathauto
    t5_encoder_pathnone
    resolution1024
    batch_size1
    epochs50
    ckpt_every500
    rank8
    base_loralatest
    sample_generateenable
    sample_prompt
    workspace_images_dir

    MZ_HYDiTTrain is the flagship of the pack's native Hunyuan DiT path - the node that runs LoRA training against Tencent's own HunyuanDiT repo, with the whole pipeline (auto-downloaded model components, CSV building, deepspeed training, per-save sample generation) handled for you. It's the most "train a real model in ComfyUI" node the pack offers, and it carries the most prerequisites.

    Hunyuan DiT being a niche model, this is also the node where the pack's rougher edges show up. It's doable - people do run it - but plan for a setup session, not a five-minute install.

    How it works

    The full chain: MZ_HYDiTInitWorkspace → MZ_HYDiTDatasetConfig → this node, optionally with MZ_HYDiTAdvConfig on advanced_config.

    On start, the node does a few things in order. It auto-installs its dependency list (pandas, pyarrow, diffusers, transformers, timm, peft, accelerate, loguru, einops, sentencepiece, polygraphy, protobuf) via pip, then raises if deepspeed isn't already installed - that one it refuses to auto-install because the right version depends on your CUDA/torch. Then, if your model paths are auto, it downloads the Hunyuan DiT components from ModelScope into ComfyUI/models/hunyuan/ (several GB - the DiT module plus CLIP plus VAE; t5_encoder_path is none by default here, so no mT5 unless you ask for it). Then it walks the workspace images, builds the image_text.csv the native repo trains from (captions read from .txt/.caption files next to each image), and runs training.

    Inputs that matter

    • workspace_config (native MZ_TT_HYDiT_WorkspaceConfig) and the optional workspace_images_dir (from MZ_HYDiTDatasetConfig; falls back to train_images/).
    • unet_path, vae_ema_path, text_encoder_path, tokenizer_path, t5_encoder_path - all auto by default → downloads. Set any to a real path if you already have weights.
    • ema_to_module (enable) - use the EMA weights as the module. Keep on.
    • resolution (1024), batch_size (1), epochs (50), ckpt_every (500) - the run shape. Note ckpt_every here counts steps; drop it if you want frequent saves.
    • rank (8) - LoRA rank. Same logic as everywhere: 8 for likenesses, up for styles.
    • base_lora - latest resumes from the newest checkpoint in the workspace output; empty starts fresh; or pick any scanned LoRA. The resume behavior is the pack's signature and it's worth it on long native runs.
    • sample_generate (enable) + sample_prompt - renders a sample at each save and displays it. Keep it on; Hunyuan DiT runs are slow, and you want the early-warning.

    Install & troubleshooting

    cd ComfyUI/custom_nodes
    git clone https://github.com/MinusZoneAI/ComfyUI-TrainTools-MZ
    # restart ComfyUI
    

    Then the one manual step this path can't do for you:

    pip install deepspeed   # pick the build matching your CUDA/torch
    

    Expect the first run to take a long while - dependency installs plus the ModelScope downloads happen before a single training step. If the run dies mid-epoch, the workspace survives; fix the env and re-queue with base_lora = latest to resume from the last save. If training errors on data, check the CSV it built - captions and image counts are the usual culprits. And remember the license context: Hunyuan weights are Tencent community-licensed, with EU/UK/South Korea excluded from the territory; fine for personal training, read the license before commercializing.

    CategoryMinusZone - TrainTools/HYDiT_native

    Inputs (18)

    NameTypeDefaultDescription
    workspace_configMZ_TT_HYDiT_WorkspaceConfig
    unet_pathCOMBOauto1 options: auto
    ema_to_moduleCOMBOenable2 options: enable, disable
    vae_ema_pathCOMBOauto1 options: auto
    text_encoder_pathCOMBOauto1 options: auto
    tokenizer_pathCOMBOauto1 options: auto
    t5_encoder_pathCOMBOnone2 options: none, auto
    resolutionINT1024
    batch_sizeINT1
    epochsINT50
    ckpt_everyINT500
    rankINT8
    base_loraCOMBOlatest2 options: latest, empty
    sample_generateCOMBOenable2 options: enable, disable
    sample_promptSTRING
    advanced_configoptMZ_TT_HYDiT_AdvConfig
    workspace_images_diroptSTRING
    has_no_effectopt*

    Outputs (0)

    No outputs