Nodes/ComfyUI_FL-Trainer/FL Kohya Workspace
ComfyUI Node

FL Kohya Workspace

The node that installs Kohya for you (and names your training run)

By filliptm·Created 2 years ago·Updated 4 months ago· 178
FL Kohya Workspace
    • workspace_config
    lora_name
    branch71e2c91330a9d866ec05cdd10584bbb962896a99
    sourcegithub
    seed0

    This is the node that makes the rest of the FL-Trainer pack possible, and it does something no other ComfyUI training pack bothers with: it installs Kohya for you. The first time you run FL Kohya Workspace, it quietly git-clones kohya-ss/sd-scripts into the pack's own folder and creates a named workspace for your run. By the time it returns a config object, the entire training stack you'd otherwise have to install by hand is sitting on disk, waiting.

    The author (filliptm, publishing under the "Machine Delusions" brand) built this pack for one job - training image LoRAs on SD 1.5 and SDXL without leaving ComfyUI. This node is the setup step that does the repo choreography, and it's the first thing in every FL-Trainer workflow you'll see shared.

    How it works

    Under the hood it's two things. First it runs git clone --depth 1 on kohya-ss/sd-scripts into custom_nodes/ComfyUI_FL-Trainer/kohya_ss_lora - pinned to a specific commit (71e2c9… by default) so your training environment is reproducible, not drifting with upstream. If that folder already exists, it just checks out your chosen branch/commit instead of re-cloning. Then it creates ComfyUI/models/loras/FL_train_workspaces/<your_lora_name>/ and hands back the workspace_config that every other node in the chain needs.

    That config object is the whole point of the output. Wire it into FL Kohya Dataset Config and FL Kohya Train and the rest of the chain knows where your workspace lives without you typing paths.

    The inputs that actually matter

    • lora_name - required, and it's your workspace name and the basis of your output LoRA's filename. Pick a short, clean name before you start; changing it later means a new workspace.
    • branch - the pinned sd-scripts commit. Leave it alone unless you know exactly what you're doing; this pack is tested against SD 1.5/SDXL, not against whatever sd-scripts main is today.
    • source - GitHub plus three mirror accelerators (githubfast, 521github, kkgithub). Handy if you're in a region where GitHub clones are slow or flaky; pick one and let it clone.
    • seed - flows into the sampling that generates your preview images during training.

    The output is workspace_config (type FL_TT_SS_WorkspaceConfig), and it only has meaning downstream.

    Install

    ComfyUI Manager → Install Custom Nodes → search "FL-Trainer", or clone it yourself:

    cd ComfyUI/custom_nodes
    git clone https://github.com/filliptm/ComfyUI_FL-Trainer
    # restart ComfyUI
    

    The pack's own requirements.txt is a single line (opencv-python); everything else - toml, imagesize, voluptuous, diffusers, accelerate - gets auto-installed on first train, and the sd-scripts clone happens on this node's first run.

    Gotchas

    • You need git installed and reachable. The clone is what this node does; no git, no workspace, and you get "Failed to clone or update kohya-ss/sd-scripts".
    • First run is slow - a shallow clone of sd-scripts takes a minute or two. Later runs are near-instant because it only checks out the branch.
    • Empty lora_name is a hard error ("lora_name is required"), so the node is picky about whitespace too.
    • Because it's pinned to a 2024-era sd-scripts commit, the whole pack is SD 1.5 / SDXL only. Don't point this at a Flux checkpoint and expect magic.

    It's not glamorous - it's the plumbing. But if you're chaining the manual FL-Trainer nodes, this is where every run starts, and it's the one that saves you the hour of Kohya setup everyone else spends.

    Category🏵️Fill Nodes/Training

    Inputs (4)

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

    Outputs (1)

    NameTypeDescription
    workspace_configFL_TT_SS_WorkspaceConfig