Nodes/ComfyUI-TrainTools-MZ/MinusZone - KohyaSSInitWorkspace
ComfyUI Node

MinusZone - KohyaSSInitWorkspace

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

By MinusZoneAI·Created 2 years ago·Updated 5 months ago· 67
MinusZone - KohyaSSInitWorkspace
    • workspace_config
    lora_name
    branch71e2c91330a9d866ec05cdd10584bbb962896a99
    sourcegithub
    seed0

    Every MinusZone train workflow starts here, and that's more literal than it sounds. MZ_KohyaSSInitWorkspace is the bootstrap node for the pack's kohya_ss path: give it a LoRA name and it clones kohya-ss/sd-scripts at a pinned commit into your ComfyUI's models folder, creates a training workspace under ComfyUI/output/mz_train_workspaces/, and hands you a workspace_config that every later node in the graph reads. One run, and the pack's kohya toolchain quietly exists on disk.

    Why would you want that? Because the whole point of this pack is to run real sd-scripts LoRA training from inside a ComfyUI graph - no Gradio GUI, no separate terminal. Kohya's vocabulary (network_dim, network_alpha, schedulers, optimizers) is all still there, but you set it in node fields instead of a config file. The kohya-ss panel in our knowledge base calls sd-scripts "the reference LoRA trainer," and this node is the pack's way of pulling that reference into your graph.

    How it works

    Under the hood it does two things. First, a git clone --depth 1 of kohya-ss/sd-scripts into ComfyUI/models/minus_zone_models/train_tools/kohya_ss_lora/ (the pack's own sandbox, separate from your custom_nodes). Then, if the branch hash you asked for doesn't match what's checked out, it fetches and checks out that exact commit. The default branch is a pinned commit hash - the one the author debugged against - so you get a reproducible toolchain instead of chasing sd-scripts HEAD.

    Then it creates the workspace folder and returns the workspace_config (type MZ_TT_SS_WorkspaceConfig) that carries the workspace name downstream. It's a dict riding through the graph - wire it into the dataset config, then into the trainer.

    The inputs that matter

    • lora_name - becomes your workspace folder name. No empty strings allowed; the node raises a "lora_name is required" error if you leave it blank.
    • branch - the sd-scripts commit/branch to check out. Default is the pinned hash; you generally don't touch it.
    • source - github, or the mirrors githubfast / 521github / kkgithub. If the initial clone crawls or fails, this is the first switch to flip. The author is Chinese-language and shipped these for exactly that reason.
    • seed - carried along in the config for the sample-generation step later. Not much to see here.

    Install

    It ships with the pack, so install the pack itself once:

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

    Or use ComfyUI Manager and search for ComfyUI-TrainTools-MZ. There's no requirements.txt to worry about - the pack lazy-installs its helper deps (toml, imagesize, diffusers, accelerate) on first train.

    Common issues

    The first run is the slow one: cloning sd-scripts takes a minute and needs network. If it fails mid-clone, check the console, then switch source to a mirror and rerun - the node only clones when the folder isn't already a git repo, so a half-clone is fine to retry. Your actual workspace lives under ComfyUI/output/mz_train_workspaces/<name>/ - if you can't find your data later, that's where it went. This pack is tiny on the internet (our reddit corpus has zero mentions), so when something breaks you're mostly debugging with the ComfyUI console and the source, which is all Chinese-commented. Patience is part of the install.

    CategoryMinusZone - TrainTools/kohya_ss

    Inputs (4)

    NameTypeDefaultDescription
    lora_nameSTRING
    branchSTRING71e2c91330a9d866ec05cdd10584bbb962896a99
    sourceCOMBOgithub4 options: github, githubfast, 521github, kkgithub
    seedINT0

    Outputs (1)

    NameTypeDescription
    workspace_configMZ_TT_SS_WorkspaceConfig