Nodes/ComfyUI Flux Trainer/Train Network Config
ComfyUI Node

Train Network Config

Switch from plain LoRA to LyCORIS/LoKr and friends

By kijai·Created 2 years ago·Updated about a year ago· 1,156
Train Network Config
    • network_config
    network_typelora
    lycoris_presetattn-mlp
    factor-1
    extra_network_args

    By default the Init nodes train a plain LoRA. TrainNetworkConfig is how you tell them to train something fancier instead - a LyCORIS variant like LoKr, LoCon, or LoHa. It's an optional node: build it, set the type, and plug it into the network_config input of an Init node. Skip it and you get a normal LoRA, which is fine for plenty of jobs.

    This matters more than it used to. For character work on Flux-class models, the community has largely moved from plain LoRA to LoKr - it's compact and it tends to converge better on the newer architectures. If you've read a recent character-training writeup and seen "factor 8," this is the node that gets you there.

    How it works

    The node outputs a network_config (type NETWORK_CONFIG) that overrides the Init node's default plain-LoRA behavior. The inputs:

    • network_type (default lora) - the choice that does the work: lora, LyCORIS/LoKr, LyCORIS/Locon, or LyCORIS/LoHa. LoKr is the popular modern pick for characters; LoCon reaches into convolution layers (good for exact reproduction and styles); LoHa is the Hadamard-product variant.
    • lycoris_preset (default attn-mlp) - which layers the LyCORIS adaptation touches: full, full-lin, attn-mlp, or attn-only. attn-mlp is a balanced default; full adapts more of the network at a bigger size.
    • factor (default -1) - the LoKr factor, the LyCORIS equivalent of "rank." Published LoKr character recipes commonly use factor 8. The -1 default means "let it decide"; set it explicitly when following a recipe.

    The LyCORIS code here comes from KohakuBlueleaf's LyCORIS library, which kijai bundles into the pack.

    LoRA vs LoKr, briefly

    Plain LoRA still works and is the safe default. LoKr is what displaced it for serious character LoRAs on post-Flux bases - not the DoRA everyone predicted a couple years back, which never reached critical mass because it doesn't stack well. If you're training a character on Flux or SDXL and plain LoRA isn't nailing the likeness, LoKr at factor 8 is the well-trodden next thing to try.

    Installing the pack

    ComfyUI Manager: search ComfyUI Flux Trainer, install, restart. Or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/kijai/ComfyUI-FluxTrainer
    pip install -r ComfyUI-FluxTrainer/requirements.txt
    

    Torch 2.4.0+ recommended, plus kijai's ComfyUI-KJNodes for the example workflows.

    Common issues

    LyCORIS is flagged experimental. Kijai's README calls LyCORIS support "experimental." It works, but it's newer and less battle-tested than the plain-LoRA path - validate on a short run before committing hours to a LoKr train.

    factor -1 isn't a recipe value. The default -1 lets the library choose; a published recipe usually names an explicit factor (often 8). If you're copying settings from a guide, set factor to what the guide says rather than leaving it at -1.

    A LoKr isn't a plain LoRA at load time. LyCORIS formats load fine in modern ComfyUI, but if some older tool refuses your file, that's the format - not a corrupt train. Plain LoRA is the maximally compatible option if you need it.

    CategoryFluxTrainer

    Inputs (4)

    NameTypeDefaultDescription
    network_typeCOMBOloranetwork type
    lycoris_presetCOMBOattn-mlp4 options: full, full-lin, attn-mlp, attn-only
    factorINT-1-1–16LoKr factor
    extra_network_argsSTRINGadditional network args

    Outputs (1)

    NameTypeDescription
    network_configNETWORK_CONFIG