Optimizer Config
The default optimizer picker for Flux Trainer (AdamW8bit and friends)
- optimizer_settings
Every training run in this pack needs an optimizer - the algorithm that decides how the model's weights actually move each step - and OptimizerConfig is the general-purpose node that picks and tunes it. It's the one you wire into the optimizer_settings input of any Init node, and for most people it's the only optimizer node they'll ever need.
The pack ships a few dedicated optimizer nodes (Prodigy, Adafactor, ProdigyPlusScheduleFree) because those have enough special knobs to deserve their own UI. OptimizerConfig is the catch-all for everything else, and its default - AdamW8bit - is still the sensible starting choice for the vast majority of LoRA training in 2026.
How it works
You set an optimizer_type and a learning-rate schedule, and the node bundles it all into an optimizer_settings (type ARGS) output that plugs into the Init node. The learning rate itself lives on the Init node, not here - this node governs which optimizer runs and how the LR is scheduled over the course of training.
The inputs that matter:
optimizer_type(defaultadamw8bit) - the dropdown includesadamw8bit,adamw,prodigy,CAME,Lion8bit,Lion,adamwschedulefree,sgdschedulefree,AdEMAMix8bit,PagedAdEMAMix8bit, andProdigyPlusScheduleFree. AdamW8bit is the default-and-fine choice; the 8bit variants save VRAM.lr_scheduler(defaultconstant) -constant,cosine,cosine_with_restarts,polynomial, orconstant_with_warmup. Constant is simplest; cosine gently decays the LR toward the end.lr_warmup_steps- ramps the LR up over the first N steps, which can steady the start of a run.min_snr_gamma(default 5) - a loss-weighting trick that helps convergence; 5 is the community-standard value, leave it be.
Which optimizer to actually pick
Honestly? Start with the default AdamW8bit. It's still the workhorse and it's fine. Reach for one of the dedicated nodes only when you have a reason: Prodigy if you want the LR auto-tuned (an SDXL-era favorite), Adafactor if you're squeezing VRAM, or ProdigyPlusScheduleFree if you're chasing the newer adaptive-and-schedule-free approach. Picking those from this dropdown works, but the dedicated nodes expose their specific knobs, which is usually what you want.
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
You expected to set the learning rate here - you don't. The LR lives on the Init node. This node picks the optimizer and how the LR is scheduled, not its value.
8bit optimizer, bitsandbytes trouble. The 8bit optimizers (adamw8bit, Lion8bit, etc.) rely on bitsandbytes under the hood, which is historically the most fragile part of any Kohya-based install. If an 8bit optimizer errors on launch, that dependency is the usual suspect; a plain adamw sidesteps it at a VRAM cost.
Prodigy from this dropdown ignores its special settings. Prodigy wants LR set to 1.0 and has its own decouple/bias-correction knobs. If you're serious about Prodigy, use the dedicated OptimizerConfigProdigy node instead so those knobs are actually exposed.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| optimizer_type | COMBO | adamw8bit | optimizer type |
| max_grad_norm | FLOAT | 1.00 | gradient clipping |
| lr_scheduler | COMBO | constant | learning rate scheduler |
| lr_warmup_steps | INT | 0 | learning rate warmup steps |
| lr_scheduler_num_cycles | INT | 1 | learning rate scheduler num cycles |
| lr_scheduler_power | FLOAT | 1.00 | learning rate scheduler power |
| min_snr_gamma | FLOAT | 5.00 | gamma for reducing the weight of high loss timesteps. Lower numbers have stronger effect. 5 is recommended by the paper |
| extra_optimizer_args | STRING | additional optimizer args |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| optimizer_settings | ARGS | — |