MinusZone - HYDiTTrain
Auto-downloads weights, needs deepspeed by hand
- workspace_config
- advanced_config
- has_no_effect
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(nativeMZ_TT_HYDiT_WorkspaceConfig) and the optionalworkspace_images_dir(from MZ_HYDiTDatasetConfig; falls back totrain_images/).unet_path,vae_ema_path,text_encoder_path,tokenizer_path,t5_encoder_path- allautoby 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. Noteckpt_everyhere 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-latestresumes from the newest checkpoint in the workspace output;emptystarts 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.
Inputs (18)
| Name | Type | Default | Description |
|---|---|---|---|
| workspace_config | MZ_TT_HYDiT_WorkspaceConfig | — | |
| unet_path | COMBO | auto | 1 options: auto |
| ema_to_module | COMBO | enable | 2 options: enable, disable |
| vae_ema_path | COMBO | auto | 1 options: auto |
| text_encoder_path | COMBO | auto | 1 options: auto |
| tokenizer_path | COMBO | auto | 1 options: auto |
| t5_encoder_path | COMBO | none | 2 options: none, auto |
| resolution | INT | 1024 | — |
| batch_size | INT | 1 | — |
| epochs | INT | 50 | — |
| ckpt_every | INT | 500 | — |
| rank | INT | 8 | — |
| base_lora | COMBO | latest | 2 options: latest, empty |
| sample_generate | COMBO | enable | 2 options: enable, disable |
| sample_prompt | STRING | — | |
| advanced_configopt | MZ_TT_HYDiT_AdvConfig | — | |
| workspace_images_diropt | STRING | — | |
| has_no_effectopt | * | — |
Outputs (0)
No outputs