Diffusion Model Enum Switch 10X (Soze)
Pick among ten UNets/DiTs with a string
- MODEL
- model_name
- matched_index
- status
The checkpoint loader is a bundle deal - MODEL, CLIP and VAE together. But a lot of modern workflows don't work that way. Flux, Hunyuan and the single-file diffusion-model ecosystem want you to load the UNet or DiT on its own, and for that ComfyUI has DiffusionModelLoader, which picks one file from models/diffusion_models. Diffusion Model Enum Switch 10X is that loader with a string key bolted on: ten diffusion-model slots, an enum_value decides which one actually loads, and only that one ever touches VRAM.
It's the diffusion-model sibling of the pack's Checkpoint Enum Switch, sharing the same lookup logic, the same ten-case shape, and the same "only the match loads" memory win.
How it works
Same matching core as the rest of the family: enum_value is compared against up to ten compare_text_N labels - case-insensitive and whitespace-trimmed by default, blank labels skipped, first match wins - and the model in the winning slot is the one loaded. default_model covers the no-match case. Blank dropdown = slot unused, so an empty slot can't hijack a run.
Two extras make it worth using over a bare loader:
weight_dtype- cast the weights on load, withdefault,fp8_e4m3fn,fp8_e4m3fn_fastandfp8_e5m2options. If you're running a big DiT on limited VRAM, fp8 is where you'll live;fp8_e4m3fn_fasttrades a touch of precision for speed. Leave it ondefaultif you don't know what you're doing and you're fine.allow_none- enabled, anenum_valueof"none"skips loading entirely and the node outputs nothing for that run.
Outputs are leaner than the checkpoint variant: MODEL, plus model_name (what actually loaded), matched_index and status. No CLIP or VAE here - diffusion models don't bundle them; you'll grab those from a checkpoint or a separate loader.
When it's worth it
This is the node that makes CSV-driven Flux/Hunyuan workflows work: your CSV row names the diffusion model, and this node loads it. Or run A/B comparisons across three different model files keyed by a text input. If you never change models mid-workflow, plain DiffusionModelLoader is simpler - the enum version pays off exactly when a string, not a human hand, does the choosing.
Installing it
Standard for the pack:
cd ComfyUI/custom_nodes
git clone https://github.com/SozeInc/ComfyUI_Soze.git
pip install -r ComfyUI_Soze/requirements.txt
Or via ComfyUI Manager ("ComfyUI_Soze") and restart. It reads whatever's in models/diffusion_models - no extra downloads. As with the checkpoint variant, there's a "Copy Names to Compare Text" button on the node that fills the case labels from your dropdowns and copies a JSON array for the enum_value source. Watch one thing: fp8_e4m3fn_fast wants a fast path in your ComfyUI install - if you get a loading error with it, fall back to fp8_e4m3fn rather than fighting it.
Inputs (26)
| Name | Type | Default | Description |
|---|---|---|---|
| enum_value | STRING | String to match against each compare_text_N. | |
| case_sensitiveopt | BOOLEAN | false | If True, 'A' != 'a'. |
| strip_whitespaceopt | BOOLEAN | true | Trim whitespace before comparing. |
| default_modelopt | COMBO | Loaded when no compare_text_N matches enum_value. Blank = none. | |
| compare_text_1opt | STRING | Case 1 label. Blank = skip this case. | |
| model_1opt | COMBO | Model loaded when compare_text_1 matches enum_value. Blank = unused. | |
| compare_text_2opt | STRING | Case 2 label. Blank = skip this case. | |
| model_2opt | COMBO | Model loaded when compare_text_2 matches enum_value. Blank = unused. | |
| compare_text_3opt | STRING | Case 3 label. Blank = skip this case. | |
| model_3opt | COMBO | Model loaded when compare_text_3 matches enum_value. Blank = unused. | |
| compare_text_4opt | STRING | Case 4 label. Blank = skip this case. | |
| model_4opt | COMBO | Model loaded when compare_text_4 matches enum_value. Blank = unused. | |
| compare_text_5opt | STRING | Case 5 label. Blank = skip this case. | |
| model_5opt | COMBO | Model loaded when compare_text_5 matches enum_value. Blank = unused. | |
| compare_text_6opt | STRING | Case 6 label. Blank = skip this case. | |
| model_6opt | COMBO | Model loaded when compare_text_6 matches enum_value. Blank = unused. | |
| compare_text_7opt | STRING | Case 7 label. Blank = skip this case. | |
| model_7opt | COMBO | Model loaded when compare_text_7 matches enum_value. Blank = unused. | |
| compare_text_8opt | STRING | Case 8 label. Blank = skip this case. | |
| model_8opt | COMBO | Model loaded when compare_text_8 matches enum_value. Blank = unused. | |
| compare_text_9opt | STRING | Case 9 label. Blank = skip this case. | |
| model_9opt | COMBO | Model loaded when compare_text_9 matches enum_value. Blank = unused. | |
| compare_text_10opt | STRING | Case 10 label. Blank = skip this case. | |
| model_10opt | COMBO | Model loaded when compare_text_10 matches enum_value. Blank = unused. | |
| weight_dtypeopt | COMBO | default | Cast the model weights to this dtype on load. |
| allow_noneopt | BOOLEAN | false | If enabled, an enum_value of 'none' (the first item in the copied compare-text array) skips loading: the LoRA loader passes (model, clip) through unchanged; the other loaders output nothing for that run. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| MODEL | MODEL | — |
| model_name | STRING | — |
| matched_index | INT | — |
| status | STRING | — |