训练启动器
The node that actually launches your training run
- dataset_config
- train_config
- config_path
- status
- log_output
This is the node the whole pack exists for. Every other node in Diffusion_pipe_in_ComfyUI - the model pickers, the dataset paths, the optimizer and sampler configs - just builds a TOML file. Train is the one that reads it and actually kicks off the training run. It's a thin but important wrapper: it spawns a deepspeed subprocess that runs tdrussell's diffusion-pipe train.py in the background, then streams the logs into your ComfyUI console.
Don't think of it as a "train everything" button. Think of it as the launch button for a process that will run for hours, entirely outside ComfyUI's normal execution. It's also the node to be careful with - the README's own example workflow tells you to disable it while you're still debugging your graph, and only run it once you're sure the config is right.
How it works
The node takes three required inputs, all of which come from other nodes in the pack: dataset_config (from a GeneralDatasetConfig node), train_config (from the GeneralConfig node), and config_path (also from GeneralConfig - it points at the TOML file GeneralConfig wrote into the pack's train_config/ folder).
When you run it, Train builds a command like this and launches it as a subprocess:
deepspeed --num_gpus=1 train.py --deepspeed --config <config_path>
The GPU count comes from number_of_gpus inside your train config. For multi-GPU runs it sets WORLD_SIZE, MASTER_ADDR, MASTER_PORT and friends, and it always sets NCCL_P2P_DISABLE=1 and NCCL_IB_DISABLE=1 - the classic WSL2 workaround, because these nodes were built to run in WSL2 first and everything else second. Logs are captured line-by-line and printed into ComfyUI's console, with progress bars handled specially so they don't spam your log.
The inputs that matter
dataset_config/train_config/config_path- wire these fromGeneralDatasetConfigandGeneralConfig. Missing any of them returns an error.resume_from_checkpoint- set this to a run's timestamp like20250212_07-06-40to resume training instead of starting fresh.regenerate_cache- force rebuild of the dataset cache. Useful when you changed images but the cache didn't notice.cache_only- build the cache and exit without training. Great sanity check before committing to a run.i_know_what_i_am_doing- skips safety checks. The name is the warning.reset_optimizer_params/reset_dataloader- when resuming from a checkpoint, these reset optimizer and dataloader state. Only enable them if you understand what you're losing.
The two outputs, status and log_output, tell you whether the process started: you'll see TRAINING_STARTED, ERROR, or ALREADY_RUNNING (because this node refuses to start a second run while one is going).
Install
Like every node in this pack: ComfyUI Manager → search "Diffusion_pipe_in_ComfyUI", or clone with submodules:
cd ComfyUI/custom_nodes
git clone --recurse-submodules https://github.com/TianDongL/Diffusion_pipe_in_ComfyUI.git
cd Diffusion_pipe_in_ComfyUI
git submodule init && git submodule update
This is a Linux/WSL2-only pack - on plain Windows you won't be able to train. Dependencies are heavy: deepspeed, diffusers, transformers, bitsandbytes, peft, and more. The README recommends a dedicated conda env with Python 3.12 and PyTorch 2.7.1 (cu128) installed before pip install -r requirements.txt.
Where people get burned
The most common failure is the subprocess dying two seconds in - Train catches that and returns ERROR with the stderr text, so read that output rather than the generic message. Also remember the pack needs deepspeed in the same environment ComfyUI runs in; if you installed ComfyUI's deps in one env and the pack's in another, the launch silently fails. And if you're on a 4090 training Wan LoRAs, community reports put a good run at roughly 25 images, a trigger word, and 150–250 epochs taking 2–3 hours - not a five-minute job. Budget for it.
Inputs (11)
| Name | Type | Default | Description |
|---|---|---|---|
| dataset_config | DATASET_CONFIG | 数据集配置(来自GeneralDatasetConfig节点) | |
| train_config | TRAIN_CONFIG | 训练配置(来自GeneralConfig节点) | |
| config_path | config_path | 配置文件路径(来自GeneralConfig节点) | |
| resume_from_checkpointopt | STRING | 从指定检查点继续训练,例如:'20250212_07-06-40' 或留空表示不从检查点恢复 | |
| reset_dataloaderopt | BOOLEAN | false | 重置数据加载器状态(在从检查点恢复时使用) |
| regenerate_cacheopt | BOOLEAN | false | 强制重新生成缓存文件 |
| cache_onlyopt | BOOLEAN | false | 仅生成缓存然后退出,不进行训练 |
| trust_cacheopt | BOOLEAN | false | 信任现有缓存,不进行验证 |
| i_know_what_i_am_doingopt | BOOLEAN | false | 跳过某些安全检查(仅在你知道自己在做什么时使用) |
| dump_datasetopt | STRING | 导出数据集到指定路径(用于调试) | |
| reset_optimizer_paramsopt | BOOLEAN | false | 重置优化器状态(在从检查点恢复时使用) |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| status | STRING | — |
| log_output | STRING | — |