Nodes/ComfyUI-TrainTools-MZ/MinusZone - KohyaSSTrain(controlnet)
ComfyUI Node

MinusZone - KohyaSSTrain(controlnet)

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

By MinusZoneAI·Created 2 years ago·Updated 5 months ago· 67
MinusZone - KohyaSSTrain(controlnet)
  • train_config
  • has_no_effect
    base_controlnetlatest
    sample_generateenable
    sample_prompt

    MZ_KohyaSSControlnetTrain (display name "KohyaSSTrain(controlnet)") is this pack's specialist node: it trains a ControlNet on SD 1.5 instead of a LoRA. It leans on the controlnet_sd1_5 template from the pack's configs, and the whole point is that your preprocessing pipeline lives in the graph - you can run your Canny/OpenPose/Depth preprocessor as ComfyUI nodes and feed the results straight into training. That's genuinely nicer than the classic workflow of pre-processing to disk with a separate tool.

    The KB's controlnet essay calls it "the missing piece of the SDXL picture" historically and the reason people stayed on SD 1.5 for control work - and this node trains exactly that SD 1.5 controlnet flavor. If your goal is a custom ControlNet on anything newer, this pack won't help; it's the SD 1.5 template.

    How it works

    The flow is: InitWorkspace → MZ_KohyaSSDatasetConfig with conditioning_images wired → MZ_KohyaSSUseConfig (old style, since this node takes a train_config) → this node. The dataset step is the critical piece - its own description demands the preprocessed images: "if the training type is controlnet, the preprocessed images (conditioning_images) must be passed in." Those get saved to the workspace with names matching the source images, and the dataset config points kohya at both folders.

    On the train side, the inputs are:

    • train_config - the assembled config from MZ_KohyaSSUseConfig, with train_config_template set to controlnet_sd1_5.
    • base_controlnet - latest (resume from the newest controlnet model in the workspace output), empty (fresh), or any .safetensors in your ComfyUI models/controlnet/ folder.
    • sample_generate / sample_prompt - sample rendering at each save, same as the LoRA trainer.

    The optional has_no_effect (* type) input is an ordering stub; ignore it.

    Install & troubleshooting

    cd ComfyUI/custom_nodes
    git clone https://github.com/MinusZoneAI/ComfyUI-TrainTools-MZ
    # restart ComfyUI
    

    Or Manager → search ComfyUI-TrainTools-MZ.

    The traps here are the same as the LoRA path plus one of its own. Same: first-run clone, lazy-installed deps, bitsandbytes if you use 8-bit optimizers. Different: forgetting conditioning_images is not a warning, it's a silent dataset disaster - training starts happily on paired-source-only data. Also, source and conditioning image counts must match one-to-one; a mismatch shows up as a kohya data error mid-run. And remember the model-licensing angle: you're fine to train a ControlNet for your own use, but the base models' licenses can restrict redistribution of the trained weights - check before you upload. ControlNet training is also heavier than LoRA training; budget VRAM accordingly, and drop save_every_n_epochs low so you can abort and keep a usable checkpoint.

    CategoryMinusZone - TrainTools/kohya_ss

    Inputs (5)

    NameTypeDefaultDescription
    train_configMZ_TT_SS_TrainConfig
    base_controlnetCOMBOlatest2 options: latest, empty
    sample_generateCOMBOenable2 options: enable, disable
    sample_promptSTRING
    has_no_effectopt*

    Outputs (0)

    No outputs