Nodes/ComfyUI-Practical-Tools/UNet Name Selector
ComfyUI Node

UNet Name Selector

One dropdown for fp8 and GGUF alike

By wenchengxiang·Created 2 months ago·Updated 9 days ago· 3
UNet Name Selector
    • unet_name
    • model_type
    ◄unet_name▾►

    Here's a workflow that's annoying to build and easy to build once you have this node: the same model in two formats - an fp8 safetensors and a Q4 GGUF - in one graph, so you can flip between them, or fall back automatically when you're on the laptop. Normally that means two loader nodes and surgically rewiring them. The UNet Name Selector turns the model choice into a string you can route instead.

    What it is

    One dropdown, two outputs, no loading. It merges unet, diffusion_models and the pack's unet_gguf listing into one sorted, de-duplicated list of diffusion models - safetensors, .ckpt, .gguf, all of it - and reports which format you picked.

    model_type is the key: 0 for a regular file, 1 for .gguf. Feed it into a switch or index node and the graph can pick its own loader - ComfyUI's "Load Diffusion Model" for 0, wcx_GGUFUNETLoader for 1. That pairing is the reason both nodes exist in the same pack.

    Beyond that, it's plumbing: the model pick lives in one node instead of three, so a batch experiment over formats, or an A/B between an fp8 and a quantized build, is a list you iterate rather than a canvas you rewire. Same idea as the pack's CLIP Name Selector, one directory over.

    Inputs and outputs

    • unet_name (required) - the dropdown, built from your model folders
    • Output unet_name - STRING, the filename as ComfyUI knows it
    • Output model_type - INT, 0 or 1

    Wire unet_name into a diffusion-model loader's unet_name widget after right-clicking it and choosing Convert widget to input. If your frontend won't accept a plain STRING into a combo socket, the pack's String To Combo node outputs the wildcard * type and connects to practically anything - that's what it's there for.

    Output goes wherever your MODEL goes: a sampler, a guider, a model patch chain. The selector itself outputs no model, so nothing downstream of it can run before a loader actually loads the file.

    Install

    Manager → search Practical-Tools → install → restart, or manually:

    cd ComfyUI/custom_nodes
    git clone https://github.com/wenchengxiang/ComfyUI-Practical-Tools.git
    

    No models to download for the node itself. Your files belong in:

    ComfyUI/models/diffusion_models/   # legacy alias: models/unet/
    

    Common issues

    It validates nothing. The selector reports the extension and hands over the string. It never opens the file, so a wrong pick surfaces later - as a load error, or as a sampler running with an architecture that doesn't match your clips. Side note on the community's most-asked ComfyUI question, "which folder do I put the models in?": the answer here is the extension decides. .gguf diffusion models only appear in GGUF loaders; safetensors diffusion models only appear in the regular loader. Putting either in checkpoints is the classic mistake, because that folder feeds a different node entirely.

    Empty dropdown. Nothing in models/unet or models/diffusion_models. Files are listed from a cache that only re-checks when a folder's mtime changes, so refresh or restart after copying - the usual reason a file that's definitely there "doesn't show".

    A file appears once even if it's in both folders. unet and diffusion_models are the same folder list in current ComfyUI, so this is expected - not a missing entry.

    Renaming bites later. Once the string is wired into a loader, it's your workflow that remembers it, not the loader widget. Move or rename a file and saved workflows keep pointing at the old name until you fix it by hand. Expect this if you reorganize your model folder at any point.

    If your whole workflow ignores the model you picked, check ComfyUI's "widget control mode" setting. Set to Before, widget values are the ones that actually run - which is the setting you want before you start shuffling model choices around in a graph.

    CategoryPractical-Tools/loaders

    Inputs (1)

    NameTypeDefaultDescription
    unet_nameCOMBO0 options:

    Outputs (2)

    NameTypeDescription
    unet_nameSTRING—
    model_typeINT—