Comfyg Switch
Never Re-Tune Your KSampler After Every Checkpoint Swap Again
- MODEL_NAME
- CONFIG_SOURCE
- STEPS
- REFINE_STEPS
- CFG
- SAMPLER
- SCHEDULER
Every checkpoint wants different settings. One SDXL model sings at CFG 4.5 with dpmpp_2m_sde, the next one looks like mush unless you push it to 8 with euler_ancestral. If you swap models often, you've got two choices: memorize a settings sheet per model, or dig through the CivitAI page every time. Comfyg Switch is the third option - it remembers for you. Pick a checkpoint, and the node auto-fills the steps, CFG, sampler, and scheduler that model was tuned for, then hands them straight to your KSampler.
It's a tiny, dependency-free node, and it's honestly more clever than its 0 impressions on comfy.icu suggest. The name is a lie in the fun way: there's no API call, no key, no network - everything lives in a JSON file that ships with the pack.
How it actually works
The mechanism splits into a backend and a frontend half, and both matter. On the Python side, ComfygSwitch looks up the checkpoint filename you've selected against a bundled model_configs.json (~164 entries, mostly SDXL/Illustrious/NoobAI-era anime models plus a few realists). Matching is three-stage: exact filename match first, then wildcard patterns via fnmatch (so a config keyed anything* catches anythingv3, anything_beta_v4, and friends), then a global __default__ fallback so unmapped models still get sane values.
Then the interesting part: a small frontend extension (that's the web/ folder) fetches /comfyg-switch/config?model=... whenever you change the checkpoint dropdown, and writes the matched values into the node's widgets. You literally see steps, CFG, sampler, and scheduler update in front of you before you queue. That's why config_source shows the name of the matched config - it's a preview of what got loaded.
The inputs and outputs that matter
Honestly, you mostly ignore the inputs. checkpoint_model is the dropdown that drives everything. config_source defaults to (auto) and just tells you which config matched.
The outputs are the point - they plug into a KSampler:
- STEPS → steps
- CFG → cfg
- SAMPLER → sampler
- SCHEDULER → scheduler
- REFINE_STEPS → for two-pass/refiner setups, unused by a plain KSampler
- MODEL_NAME → the checkpoint filename, so it can drive your loader
- CONFIG_SOURCE → informational
Wire STEPS/CFG/SAMPLER/SCHEDULER into your KSampler, select a checkpoint, and the sampler config tracks your model choice automatically.
Installing it
ComfyUI Manager: search Comfyg Switch and install. Or the manual way:
cd ComfyUI/custom_nodes
git clone https://github.com/guerreiro/comfyg-switch
Then restart ComfyUI. That's it - there are zero pip dependencies and no model downloads. A rarity worth appreciating in an ecosystem where half of setup is dependency roulette.
Where people get burned
- Don't edit
model_configs.json. It's tracked by Git, so everygit pull/Manager update silently reverts your edits. The README is explicit about this. Instead, create your ownmy_model_configs.jsonin the pack folder using the same structure - it's gitignored, and its entries deep-merge over the defaults, so you can override just one field of an existing model. - Need a config for a model that isn't in the file? Add it to
my_model_configs.json. Unmatched models fall back to__default__(orunknown_model*), so nothing hard-crashes - you just get generic settings. - The JSON parser tolerates trailing commas (it strips them before parsing), but if the file is genuinely malformed you'll get a
[ComfygSwitch] ERROR: Invalid JSON formatline in the console and silently no config. The fix is usually a missing comma somewhere in your file. - No restart needed after editing JSON - the config cache checks file mtimes and reloads when you change the checkpoint. The frontend reload is keyed on the checkpoint dropdown, so if a config isn't applying, wiggle the model selector.
One honest caveat: it doesn't know about sampler_seed, denoise, or anything past those seven outputs, and the bundled configs are community guesses, not gospel. Treat them as starting points. But for "load a workflow, swap models, don't think about samplers," it's a quietly useful little gadget.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| checkpoint_model | COMBO | 0 options: | |
| config_source | STRING | (auto) | — |
| steps | INT | 301–200 | — |
| refiner_steps | INT | 301–200 | — |
| cfg | FLOAT | 7.00.1–20 | — |
| sampler | COMBO | 44 options: euler, euler_cfg_pp, euler_ancestral, euler_ancestral_cfg_pp, heun, heunpp2, +38 | |
| scheduler | COMBO | 9 options: simple, sgm_uniform, karras, exponential, ddim_uniform, beta, +3 |
Outputs (7)
| Name | Type | Description |
|---|---|---|
| MODEL_NAME | — | |
| CONFIG_SOURCE | STRING | — |
| STEPS | INT | — |
| REFINE_STEPS | INT | — |
| CFG | FLOAT | — |
| SAMPLER | euler,euler_cfg_pp,euler_ancestral,euler_ancestral_cfg_pp,heun,heunpp2,exp_heun_2_x0,exp_heun_2_x0_sde,dpm_2,dpm_2_ancestral,lms,dpm_fast,dpm_adaptive,dpmpp_2s_ancestral,dpmpp_2s_ancestral_cfg_pp,dpmpp_sde,dpmpp_sde_gpu,dpmpp_2m,dpmpp_2m_cfg_pp,dpmpp_2m_sde,dpmpp_2m_sde_gpu,dpmpp_2m_sde_heun,dpmpp_2m_sde_heun_gpu,dpmpp_3m_sde,dpmpp_3m_sde_gpu,ddpm,lcm,ipndm,ipndm_v,deis,res_multistep,res_multistep_cfg_pp,res_multistep_ancestral,res_multistep_ancestral_cfg_pp,gradient_estimation,gradient_estimation_cfg_pp,er_sde,seeds_2,seeds_3,sa_solver,sa_solver_pece,ddim,uni_pc,uni_pc_bh2 | — |
| SCHEDULER | simple,sgm_uniform,karras,exponential,ddim_uniform,beta,normal,linear_quadratic,kl_optimal | — |