Nodes/Diffusion_pipe_in_ComfyUI/通用数据集配置
ComfyUI Node

通用数据集配置

The dataset hub — resolutions, bucketing, and repeats for the whole run

By TianDongL·Created 11 months ago·Updated 7 months ago· 69
通用数据集配置
  • input_path
  • frame_buckets
  • ar_buckets
  • dataset_config
resolutions[512]
enable_ar_buckettrue
min_ar0.5
max_ar2.0
num_ar_buckets7
num_repeats1

Every training run needs its data told to the trainer, and GeneralDatasetConfig is the node that does the telling. It's the dataset-side twin of GeneralConfig - the hub that takes your path nodes, resolution choices, and bucketing preferences, and hands the assembled DATASET_CONFIG up to the main config node. Get this right and training is boring; get it wrong and you get a week of confusing losses.

What it takes

The required inputs, and the ones you'll actually set:

  • input_path - the dataset. This is a wired input, not a typed one: feed it the output of GeneralDatasetPathNode (plain folder) or EditModelDatasetPathNode (paired source/target folders for editing models). The tooltip's line - "select the node that matches your training purpose" - is the whole game.
  • resolutions (default [512]) - training resolution: a single number for square, or a list of [width, height] pairs like [[1280, 720]]. Multi-resolution training is the modern default (the KB's LoRA notes call bucketing "the default rather than an optimization" post-Flux), so don't feel you must lock to one size.
  • enable_ar_bucket (default on) - auto aspect-ratio bucketing. Leave on; it's what lets a mixed-shape dataset train without forcing everything to one ratio.
  • min_ar (0.5) / max_ar (2.0) / num_ar_buckets (7) - the range and count of auto-computed buckets. If you only have square-ish images, tighten the range; if you have extreme panoramas, widen it.
  • num_repeats (default 1) - how many times each sample repeats per epoch, i.e. how much you oversample a small dataset. For 15–25 image character sets this is your main "make the run last longer" lever, and the KB is clear that small, well-curated sets beat big ones.

The optional inputs are the specialized hooks: frame_buckets (from FrameBucketsNode) for video, and ar_buckets (from ArBucketsNode) for hand-written resolution lists. If you supply ar_buckets, remember it can't coexist with enable_ar_bucket - the author flags it in the tooltip.

What comes out

One output, dataset_config (type DATASET_CONFIG), which wires into GeneralConfig.dataset_config. That's the whole job - a serialized config that the hub folds into the TOML the trainer reads. For video runs you'll pair it with video_clip_mode on GeneralConfig; the frame buckets only describe lengths, the clip mode describes how to extract them.

Installing the pack

Same pack-wide install, Linux/WSL2 only:

cd ComfyUI/custom_nodes/
git clone --recurse-submodules https://github.com/TianDongL/Diffusion_pipe_in_ComfyUI.git
git submodule update
pip install -r Diffusion_pipe_in_ComfyUI/requirements.txt

Common issues

The community's recurring dataset stumble was custom configs being ignored - the pack generates its own .toml from these nodes, so editing some external dataset file does nothing. Your settings live here. Also keep the WSL2 path convention (Z:/... not /mnt/z/...), and don't fight enable_ar_bucket with a hand-written ar_buckets list at the same time - pick one.

CategoryDiffusion-Pipe/dataset

Inputs (9)

NameTypeDefaultDescription
input_pathinput_path数据集输入路径,必选,根据不同训练目的,选择不同节点
resolutionsSTRING[512]训练分辨率,可以是单个数值(正方形)或 [[宽度, 高度]] 对,例如: [[1280, 720]]
enable_ar_bucketBOOLEANtrue是否启用宽高比分桶设置
min_arFLOAT0.50.1–5最小宽高比
max_arFLOAT2.00.1–5最大宽高比
num_ar_bucketsINT71–20宽高比分桶数量
num_repeatsINT11–100数据集重复次数,用于增加训练数据的有效使用次数
frame_bucketsoptframe_buckets帧分桶设置,例如: [1, 33] 或 [1, 33, 65, 97],专用与视频模型训练
ar_bucketsoptar_buckets宽高比分桶设置,例如:[[512, 512], [448, 576]]

Outputs (1)

NameTypeDescription
dataset_configDATASET_CONFIG