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

MinusZone - KohyaSSAdvConfig

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

By MinusZoneAI·Created 2 years ago·Updated 5 months ago· 67
MinusZone - KohyaSSAdvConfig
    • advanced_config
    xformersenable
    sdpadisable
    fp8_basedisable
    mixed_precisionfp16
    gradient_accumulation_steps1
    gradient_checkpointingdisable
    cache_latentsenable
    cache_latents_to_diskenable
    network_dim16
    network_alpha8
    network_modulenetworks.lora
    network_train_unet_onlyenable
    lr_schedulercosine
    lr_scheduler_num_cycles1
    optimizer_typeAdamW
    lr_warmup_steps0
    unet_lr
    text_encoder_lr
    shuffle_captiondisable
    save_precisionfp16
    persistent_data_loader_workersenable
    no_metadataenable
    noise_offset0.10
    no_half_vaeenable
    lowramdisable

    If MZ_KohyaSSInitWorkspace is the pack's front door, MZ_KohyaSSAdvConfig is the control panel with the confusingly many switches. It's a single node that collects the sd-scripts training flags you'd normally sprinkle through a kohya config file, and hands them forward as one advanced_config object. You don't need to touch most of them - the pack's templates already have sane defaults - but when you outgrow the template, this is where you grow.

    Everything here maps 1:1 to a kohya flag, which is the same vocabulary the KB's LoRA training doc spends pages on. That's both the strength and the danger: the node exposes the raw knobs with no presets, and the kohya-ss panel's verdict is that this is exactly why beginners bounce off. Start with the template, tweak from there.

    The inputs that actually matter

    • network_dim / network_alpha (defaults 16 / 8) - the rank and the alpha. The alpha-at-half-rank convention (alpha ≈ dim/2) is Kohya's house style, and it's what "rank 16, alpha 8" means when you read a config dump. Raise network_dim when a small rank underfits a style, not when your character looks off.
    • network_module - networks.lora (default), networks.dylora (dynamic, more expressive, fiddlier), or networks.oft. Stay on lora for your first few runs.
    • mixed_precision - fp16 default, bf16 on cards that support it, no if you have VRAM to burn and want to fight for precision.
    • cache_latents + cache_latents_to_disk (both default enable) - precompute the latents once instead of every epoch. The single biggest speed lever in a modern config; leave both on.
    • optimizer_type - AdamW default, with the whole 8-bit / Paged / Lion / DAdapt family in the dropdown. The KB notes 8-bit optimizers are where installs usually break: AdamW8bit needs bitsandbytes, which is the most dependency-prone package in the kohya stack. If you pick one and training dies at startup with a bnb error, that's why.
    • lr_scheduler / lr_warmup_steps - cosine with a small warmup is the boring, correct choice.
    • network_train_unet_only (default enable) - train only the UNet, not the text encoder. Common on SD-family LoRAs, and it saves memory.
    • noise_offset (0.1) - a small value helps contrast; the "0.1" everyone copies.
    • xformers / sdpa - the attention backends. Enable one, not both; sdpa is the modern default, xformers is the legacy fallback.

    How it works & what it outputs

    The node just packages the dict - the actual training flags get merged into the final config when MZ_KohyaSSTrain or MZ_KohyaSSLoraTrain runs. Output is advanced_config (type MZ_TT_SS_AdvConfig). In the old chain you wire it into MZ_KohyaSSUseConfig's save_advanced_config; in the new chain straight into MZ_KohyaSSLoraTrain. Either way, values here override the template.

    Install & troubleshooting

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

    Or ComfyUI Manager → ComfyUI-TrainTools-MZ. No extra deps for the node itself.

    Where people get burned: flipping xformers and sdpa both on (some environments tolerate it, some don't), picking a save_precision of float and wondering why the output is twice the size, and choosing an 8-bit optimizer without bitsandbytes installed. And the eternal one - a higher network_dim is not free quality. If you're tuning because results are bad, change one thing at a time, and remember the KB's blunt line: dataset curation beats every knob.

    CategoryMinusZone - TrainTools/kohya_ss

    Inputs (25)

    NameTypeDefaultDescription
    xformersCOMBOenable2 options: enable, disable
    sdpaCOMBOdisable2 options: enable, disable
    fp8_baseCOMBOdisable2 options: enable, disable
    mixed_precisionCOMBOfp163 options: no, fp16, bf16
    gradient_accumulation_stepsINT1
    gradient_checkpointingCOMBOdisable2 options: enable, disable
    cache_latentsCOMBOenable2 options: enable, disable
    cache_latents_to_diskCOMBOenable2 options: enable, disable
    network_dimINT16
    network_alphaINT8
    network_moduleCOMBOnetworks.lora3 options: networks.lora, networks.dylora, networks.oft
    network_train_unet_onlyCOMBOenable2 options: enable, disable
    lr_schedulerCOMBOcosine7 options: linear, cosine, cosine_with_restarts, polynomial, constant, constant_with_warmup, +1
    lr_scheduler_num_cyclesINT1
    optimizer_typeCOMBOAdamW18 options: AdamW, AdamW8bit, PagedAdamW, PagedAdamW8bit, PagedAdamW32bit, Lion8bit, +12
    lr_warmup_stepsINT0
    unet_lrSTRING
    text_encoder_lrSTRING
    shuffle_captionCOMBOdisable2 options: enable, disable
    save_precisionCOMBOfp163 options: float, fp16, bf16
    persistent_data_loader_workersCOMBOenable2 options: enable, disable
    no_metadataCOMBOenable2 options: enable, disable
    noise_offsetFLOAT0.10
    no_half_vaeCOMBOenable2 options: enable, disable
    lowramCOMBOdisable2 options: enable, disable

    Outputs (1)

    NameTypeDescription
    advanced_configMZ_TT_SS_AdvConfig