The Last Model Switcher
One Dropdown, Every Model — Switch SDXL to Flux Without Rewiring Anything
- model
- vae
- positive
- negative
- width
- height
- steps
- cfg
- seed
Every ComfyUI user knows the ritual: switch models and you get to rewire half the graph. New checkpoint means a different CLIP, maybe a different VAE, a different resolution, different CFG, and - if you're moving between SDXL and Flux - a whole different negative-prompt philosophy. The Last Model Switcher is one node that says "nah, pick a model, I'll handle the rest." Drop it in, choose your model from a dropdown, and it loads the right model, CLIP, and VAE, encodes your prompts, sets the resolution, steps, CFG, and guidance, and hands the whole bundle to a KSampler.
It's from the "all-in-one mega loader" school, and it goes further than most: it does the prompt encoding and Flux guidance internally, so it replaces roughly five nodes at the front of your workflow. If you're the kind of person who keeps a handful of models around and gets tired of maintaining a separate template workflow for each, this is aimed squarely at you.
How it actually works
Under the hood it's a preset engine. A presets.json file maps each friendly model name to the model file, compatible text encoders, a VAE, resolution presets, and sampler settings. Everything is keyed to model_type and clip_type - SD 1.5, SDXL, SD3, Flux 1, and Flux 2 each get their own wiring, because Flux 2's Mistral/Qwen3 text encoder is not SDXL's CLIP and the node knows the difference.
When you hit Queue it loads the checkpoint (or a standalone diffusion model), pulls the CLIP from your text_encoders folder, loads the VAE, then encodes both prompts with the correct encoder. For Flux models it applies ModelSamplingFlux with a shift scaled to your resolution, and bakes the guidance value straight into the positive conditioning - that's the job a separate FluxGuidance node usually does. The negative output comes back empty for Flux, which is correct: at CFG 1 there's no unconditional pass for a negative prompt to steer.
It caches the loaded model in memory and clears the cache the moment you switch models, so you're not re-reading a 30 GB file from disk on every run, and not holding two models in VRAM.
The inputs that matter
- model - the dropdown. Only models whose files actually exist on disk show up. Each entry can carry sub-selections:
clip_variant(which text encoder, e.g. Mistral vs Qwen3 on Flux 2),resolution(aspect ratio presets), andmegapixels(scales width/height while keeping the aspect ratio, snapped to multiples of 8). - positive_prompt / negative_prompt - type right on the node; no CLIPTextEncode needed. The negative is ignored for Flux by design.
- width, height, steps, cfg, guidance - auto-filled from the preset but fully editable; changing the dropdown overwrites them.
- seed - standard randomize/increment/fixed control.
- weight_dtype - optional advanced override (fp8_e4m3fn / fp8_e5m2) for diffusion models.
Outputs: model, vae, positive, negative, then width, height, steps, cfg, seed as plain values. Wire model/positive/negative/seed into the KSampler, feed width/height into EmptyLatentImage, vae into VAE Decode - that's the entire graph. There's also an info panel on the node that tells you what it loaded and warns you about missing connections.
Installing it
The usual two ways. ComfyUI Manager → search "The Last Model Switcher", or:
cd ComfyUI/custom_nodes
git clone https://github.com/maxomarai/ComfyUI-The-Last-Model-Switcher.git
Restart ComfyUI and it appears under loaders > Maxomarai. No requirements.txt, no pip install - the only real dependency is a modern ComfyUI: this is built on the new comfy_api.latest node API, so an old install won't have it and will throw an import error. GGUF presets need ComfyUI-GGUF installed separately. And because it's a preset loader, it needs the model files in the right folders: checkpoints or diffusion_models, CLIPs in text_encoders, VAEs in vae.
Where people get burned
- Missing from the dropdown - the node only lists models whose files exist. If your model isn't there, check the file is in the right folder (or click Scan for New Models, which reads safetensors headers instantly to auto-detect SD/SDXL/Flux and distilled variants).
- Flux text encoder errors - Flux needs its own multi-GB CLIP sitting in
text_encoders. The error message tells you exactly this. - "Negative prompt does nothing" on Flux - that's not a bug, that's flow-matching. Write constraints positively instead.
- GGUF errors - you picked a GGUF preset without ComfyUI-GGUF installed. Install it, restart.
The AI "Identify Model" and prompt-enhancement features are strictly optional: no key, no account, and the core switching works offline. If you want them, Ollama gets you there free.
One honest caveat: this is a young, small pack from a solo author, not a community institution - think "handy preset loader to test on a copy of a workflow you care about," not "the standard." For hopping across model families, it genuinely does what it promises.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| model | COMBO | Select your model. Compatible CLIP and resolution options appear automatically. | |
| positive_prompt | STRING | Positive prompt. Encoded with the selected CLIP model. | |
| negative_prompt | STRING | Negative prompt. Only used for models that support it (SD, SDXL). Ignored for Flux. | |
| seed | INT | 00–18446744073709550000 | Random seed. Use the control to randomize, increment, or keep fixed between generations. |
| width | INT | 102464–8192 | Output width. Auto-set from preset, or type your own value. |
| height | INT | 102464–8192 | Output height. Auto-set from preset, or type your own value. |
| steps | INT | 201–10000 | Sampling steps. Auto-set from preset, or type your own value. |
| cfg | FLOAT | 1.00–100 | CFG scale. Auto-set from preset, or type your own value. |
| guidance | FLOAT | 3.50–100 | Flux guidance. Auto-set from preset, or type your own value. |
| weight_dtypeopt | COMBO | default | Weight dtype override for diffusion model. |
Outputs (9)
| Name | Type | Description |
|---|---|---|
| model | MODEL | — |
| vae | VAE | — |
| positive | CONDITIONING | Positive conditioning. FluxGuidance applied automatically for Flux models. |
| negative | CONDITIONING | Negative conditioning. Empty for Flux models, safe to keep connected. |
| width | INT | — |
| height | INT | — |
| steps | INT | — |
| cfg | FLOAT | — |
| seed | INT | Seed value. Connect to KSampler seed input. |