Nodes/Quality of Life Nodes for ComfyUI/Diffusion Model Enum Switch 10X (Soze)
ComfyUI Node

Diffusion Model Enum Switch 10X (Soze)

Pick among ten UNets/DiTs with a string

By SozeInc·Created 2 years ago·Updated 8 days ago· 10
Diffusion Model Enum Switch 10X (Soze)
    • MODEL
    • model_name
    • matched_index
    • status
    enum_value
    case_sensitivefalse
    strip_whitespacetrue
    default_model
    compare_text_1
    model_1
    compare_text_2
    model_2
    compare_text_3
    model_3
    compare_text_4
    model_4
    compare_text_5
    model_5
    compare_text_6
    model_6
    compare_text_7
    model_7
    compare_text_8
    model_8
    compare_text_9
    model_9
    compare_text_10
    model_10
    weight_dtypedefault
    allow_nonefalse

    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, with default, fp8_e4m3fn, fp8_e4m3fn_fast and fp8_e5m2 options. If you're running a big DiT on limited VRAM, fp8 is where you'll live; fp8_e4m3fn_fast trades a touch of precision for speed. Leave it on default if you don't know what you're doing and you're fine.
    • allow_none - enabled, an enum_value of "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.

    Categoryloaders

    Inputs (26)

    NameTypeDefaultDescription
    enum_valueSTRINGString to match against each compare_text_N.
    case_sensitiveoptBOOLEANfalseIf True, 'A' != 'a'.
    strip_whitespaceoptBOOLEANtrueTrim whitespace before comparing.
    default_modeloptCOMBOLoaded when no compare_text_N matches enum_value. Blank = none.
    compare_text_1optSTRINGCase 1 label. Blank = skip this case.
    model_1optCOMBOModel loaded when compare_text_1 matches enum_value. Blank = unused.
    compare_text_2optSTRINGCase 2 label. Blank = skip this case.
    model_2optCOMBOModel loaded when compare_text_2 matches enum_value. Blank = unused.
    compare_text_3optSTRINGCase 3 label. Blank = skip this case.
    model_3optCOMBOModel loaded when compare_text_3 matches enum_value. Blank = unused.
    compare_text_4optSTRINGCase 4 label. Blank = skip this case.
    model_4optCOMBOModel loaded when compare_text_4 matches enum_value. Blank = unused.
    compare_text_5optSTRINGCase 5 label. Blank = skip this case.
    model_5optCOMBOModel loaded when compare_text_5 matches enum_value. Blank = unused.
    compare_text_6optSTRINGCase 6 label. Blank = skip this case.
    model_6optCOMBOModel loaded when compare_text_6 matches enum_value. Blank = unused.
    compare_text_7optSTRINGCase 7 label. Blank = skip this case.
    model_7optCOMBOModel loaded when compare_text_7 matches enum_value. Blank = unused.
    compare_text_8optSTRINGCase 8 label. Blank = skip this case.
    model_8optCOMBOModel loaded when compare_text_8 matches enum_value. Blank = unused.
    compare_text_9optSTRINGCase 9 label. Blank = skip this case.
    model_9optCOMBOModel loaded when compare_text_9 matches enum_value. Blank = unused.
    compare_text_10optSTRINGCase 10 label. Blank = skip this case.
    model_10optCOMBOModel loaded when compare_text_10 matches enum_value. Blank = unused.
    weight_dtypeoptCOMBOdefaultCast the model weights to this dtype on load.
    allow_noneoptBOOLEANfalseIf 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)

    NameTypeDescription
    MODELMODEL
    model_nameSTRING
    matched_indexINT
    statusSTRING