Extensions/ComfyUI-TrainTools-MZ
ComfyUI Extension

ComfyUI-TrainTools-MZ

Nodes for fine-tuning lora in ComfyUI, dependent on training tools such as kohya-ss/sd-scripts

By MinusZoneAI·Created 2 years ago·Updated 5 months ago· 67
MinusZoneAI/ComfyUI-TrainTools-MZ
Nodes18
On cloudLocal install
CategoryMinusZone - TrainTools/HYDiT_native, MinusZone - TrainTools/kohya_ss
Stars67
Updated5 months ago

Nodes (18)

MinusZone - HYDiTAdvConfig

The deepspeed-flavored tuning node for native Hunyuan DiT training

MinusZone - TrainTools/HYDiT_native
MinusZone - HYDiTDatasetConfig

Feed it images once, let it skip the reruns

MinusZone - TrainTools/HYDiT_native
MinusZone - HYDiTInitWorkspace

The native Hunyuan DiT path starts by cloning Tencent's own repo

MinusZone - TrainTools/HYDiT_native
MinusZone - HYDiTSimpleT2I

A full Hunyuan DiT sampler as one node, with auto-downloaded weights

MinusZone - TrainTools/HYDiT_native
MinusZone - HYDiTTrain

Auto-downloads weights, needs deepspeed by hand

MinusZone - TrainTools/HYDiT_native
MinusZone - ImagesCopyWorkspace

The dataset copier that's secretly the same node as KohyaSSDatasetConfig

MinusZone - TrainTools/kohya_ss
MinusZone - KohyaSSAdvConfig

Every Kohya tuning knob, dumped into one node (network_dim and friends)

MinusZone - TrainTools/kohya_ss
MinusZone - KohyaSSTrain(controlnet)

Training a ControlNet in ComfyUI — with the preprocessing already in the graph

MinusZone - TrainTools/kohya_ss
MinusZone - KohyaSSDatasetConfig

Turns a ComfyUI image batch into a Kohya-ready training set

MinusZone - TrainTools/kohya_ss
MinusZone - KohyaSSInitWorkspace

This node quietly installs Kohya inside your ComfyUI (that's the point)

MinusZone - TrainTools/kohya_ss
MinusZone - KohyaSS_KohakuBlueleaf_HYHiDInitWorkspace

The Hunyuan DiT workspace starter that clones KohakuBlueleaf's fork instead

MinusZone - TrainTools/kohya_ss_HYDiT_kohakublueleaf
MinusZone - KohyaSS_KohakuBlueleaf_HYHiDLoraTrain

The Hunyuan DiT LoRA trainer via KohakuBlueleaf's Kohya fork

MinusZone - TrainTools/kohya_ss_HYDiT_kohakublueleaf
MinusZone - KohyaSS_KohakuBlueleaf_HYHiDSimpleT2I

Generate with your trained Hunyuan DiT LoRA, right inside the same graph

MinusZone - TrainTools/kohya_ss_HYDiT_kohakublueleaf
MinusZone - KohyaSSTrain(lora)

The one MinusZone train node you should actually use now

MinusZone - TrainTools/kohya_ss
MinusZone - KohyaSSTrain(old version)

The old training main thread — where Kohya actually runs inside ComfyUI

MinusZone - TrainTools/kohya_ss/v1
MinusZone - KohyaSSUseConfig(old version)

One template JSON, then tweak

MinusZone - TrainTools/kohya_ss/v1
MinusZone - LoadImagesFromDirectoryPath

Images from a folder path, straight into a batch

MinusZone - TrainTools/tools
MinusZone - TrainToolsDebug

Pretty-print any config object in your graph

MinusZone - TrainTools
Readme

image image

ComfyUI-TrainTools-MZ

在ComfyUI中进行lora微调的节点,依赖于kohya-ss/sd-scripts等训练工具(Nodes for fine-tuning lora in ComfyUI, dependent on training tools such as kohya-ss/sd-scripts)

Recent changes

[20240706] 支持混元lora训练,脚本来自https://github.com/KohakuBlueleaf/sd-scripts/tree/HunYuanDiT 分支

Installation

  1. Clone this repo into custom_nodes folder.
  2. Restart ComfyUI.

Nodes

MZ_KohyaSS_KohakuBlueleaf_HYHiDInitWorkspace | MZ_KohyaSS_KohakuBlueleaf_HYHiDLoraTrain

image

MZ_KohyaSSInitWorkspace

初始化训练文件夹,文件夹位于output目录(Initialize the training folder, the folder in the output directory)

  • lora_name(LoRa名称): 用于生成训练文件夹的名称(Used to generate the name of the training folder
  • branch(分支): sd-scripts的分支,默认为当前代码调试时使用的分支(sd-scripts branch, default is the branch used when debugging the current code)
  • source(源): sd-scripts的源,默认为github,下载有问题的话可以切换加速源(sd-scripts source, default is github, if there is a problem with the download, you can switch to the accelerated source)

image

MZ_ImagesCopyWorkspace

复制图片到训练文件夹中和一些数据集配置(Copy images to the training folder and some dataset configurations)

  • images(图片列表): 推荐使用 https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite 中的上传文件夹节点 (It is recommended to use the upload folder node in https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite )
  • force_clear(强制清空): 复制图片前是否强制清空原有文件夹内容(Whether to force clear the original folder content before copying the image)
  • force_clear_only_images(仅清空图片): 仅清空图片文件夹内容,不清空其他文件夹内容(Only clear the content of the image folder, not the content of other folders)
  • same_caption_generate(生成相同标注): 是否生成相同的标注文件(Whether to generate the same annotation file)
  • same_caption(单一标签): 生成相同标签的内容(Generate content with the same label)
  • 其他字段参考: https://github.com/kohya-ss/sd-scripts

image

MZ_KohyaSSUseConfig

一些基础的训练配置(Some basic training configurations)

  • 没什么特殊的,字段参考: https://github.com/kohya-ss/sd-scripts

image

MZ_KohyaSSAdvConfig

更多的训练配置(More training configurations)

  • 没什么特殊的,字段参考: https://github.com/kohya-ss/sd-scripts

image

MZ_KohyaSSTrain

训练主线程(Training main thread)

  • base_lora(基础lora): 加载一个lora模型后进行训练,和sd-scripts中的network_weights参数一致,启用时忽略dim/alpha/dropout(Train after loading a lora model, consistent with the network_weights parameter in sd-scripts, ignore dim/alpha/dropout when enabled)
  • sample_generate(启用样图生成): 每次保存模型时进行一次示例图片生成,并展示训练过程中每个保存epoch时的示例图片(Enable example image generation each time the model is saved, and display the example image at each saved epoch during training)
  • sample_prompt(提示词): 生成示例图片时使用的提示词(Phrase used when generating example images)

image

FAQ

Credits

Star History

<a href="https://star-history.com/#MinusZoneAI/ComfyUI-TrainTools-MZ&Date"> <picture> <source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=MinusZoneAI/ComfyUI-TrainTools-MZ&type=Date&theme=dark" /> <source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=MinusZoneAI/ComfyUI-TrainTools-MZ&type=Date" /> <img alt="Star History Chart" src="https://api.star-history.com/svg?repos=MinusZoneAI/ComfyUI-TrainTools-MZ&type=Date" /> </picture> </a>

Contact