MinusZone - HYDiTDatasetConfig
Feed it images once, let it skip the reruns
- workspace_config
- images
- workspace_images_dir
MZ_HYDiTDatasetConfig is the dataset step for the pack's native Hunyuan DiT training path - and it's notably lazier than its kohya-family cousin. Here images is an optional input: if you don't wire images in, the node assumes data already exists in the workspace's train_images/ folder and just skips straight to optional caption handling. That makes it a much more forgiving node to rerun, and it's the natural fit for the "build your dataset once, tweak the training config forever" rhythm.
The native Hunyuan DiT trainer (MZ_HYDiTTrain) actually builds its own image_text.csv from whatever is in train_images/, so this node's real job is narrower than the kohya dataset node: get images into the folder, resize them to your target resolution, and optionally stamp captions. No dataset.json/toml generation here - the native repo does data differently.
Inputs that matter
workspace_config- from MZ_HYDiTInitWorkspace. Type matters: it must be the nativeMZ_TT_HYDiT_WorkspaceConfig, not the kohya one.images(optional) - the training images. Leave unwired on re-runs to reuse what's already intrain_images/. The node logs "no images detected, assuming existing training data" and skips ahead.resolution(default 1024) - the long-side resize target when images are provided.force_clear/force_clear_only_images- nuke the whole dataset folder, or just the image files, before copying. If you re-run with a new image set and forget these, stale images pollute the run - the same trap as the kohya dataset node.same_caption_generate+same_caption- write the same caption file for every image. The native path reads captions from.txtor.captionfiles next to each image when building its CSV.
Output is workspace_images_dir (a STRING path) - wire it into MZ_HYDiTTrain's optional workspace_images_dir input so the trainer knows where the data lives (it falls back to the standard train_images/ path if you don't).
Install & troubleshooting
cd ComfyUI/custom_nodes
git clone https://github.com/MinusZoneAI/ComfyUI-TrainTools-MZ
# restart ComfyUI
The pairing to remember: this node's config type is MZ_TT_HYDiT_WorkspaceConfig, so it belongs with MZ_HYDiTInitWorkspace and MZ_HYDiTTrain. Pair it with the kohya init by mistake and you get a hard type error. Also note this node does not take conditioning_images - the native path is LoRA training only; if you want Hunyuan ControlNet work, that's not what this family does. And a heads-up for dataset quality that applies double here: the KB's training doc hammers that diverse backgrounds beat clean ones, and the native CSV path uses whatever captions you leave lying next to images - so caption deliberately, or same_caption everything and caption for real later.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| workspace_config | MZ_TT_HYDiT_WorkspaceConfig | — | |
| resolution | INT | 1024 | — |
| force_clear | COMBO | disable | 2 options: enable, disable |
| force_clear_only_images | COMBO | disable | 2 options: enable, disable |
| same_caption_generate | COMBO | disable | 2 options: enable, disable |
| same_caption | STRING | — | |
| imagesopt | IMAGE | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| workspace_images_dir | STRING | — |