ComfyUI Node

SLM: Model Selector

One model today, but a clean pattern for when there are more

By gpdev-Pilcothink·Created 11 months ago·Updated 3 months ago· 2
SLM: Model Selector
    • slm_model
    • model_path
    modelQwen3-0.6B
    deviceauto
    dtypeauto
    download_if_missingtrue

    SLMModelSelector ("SLM: Model Selector") is the loader half of the pack's text-model side. You pick a model, a device and a dtype, and it hands the SLM generator a ready-to-use SLM_MODEL object plus the local path where the model lives. The generator doesn't care where the weights came from - it just consumes that object.

    Right now there's exactly one choice in the model dropdown: Qwen3-0.6B, the 0.6-billion-parameter member of the Qwen3 family. That's a genuinely small model - the kind that runs comfortably on CPU-adjacent hardware and in a few gigabytes of VRAM. Calling the node a "selector" is a little generous when the menu has one item, but the pattern is the point: add entries to the pack's model table and this node picks them up.

    How it works

    The node does three things on execution:

    1. Resolves the path. Models download into the pack's own Models/SLM/ folder (inside the custom node directory), named with the HF repo slug's / swapped for __ - so Qwen/Qwen3-0.6B becomes Models/SLM/Qwen__Qwen3-0.6B.
    2. Downloads if missing. If the folder is empty and download_if_missing is on (it is by default), it pulls the repo from Hugging Face via snapshot_download. That first run can take a while depending on your connection.
    3. Resolves device and dtype into the model dict. device auto-picks cuda when a GPU is available, else cpu. dtype auto becomes bfloat16 on a bf16-capable GPU, float16 otherwise, and float32 on CPU.

    The inputs that matter

    • model - the enum; currently just Qwen3-0.6B.
    • device - auto (default), cuda, or cpu.
    • dtype - auto (default), bfloat16, float16, or float32.
    • download_if_missing - on by default. Turn it off and the node errors instead of downloading when weights are absent.

    Two outputs: slm_model (the SLM_MODEL object) and model_path (the local folder as a STRING, handy for a display node or if you want to know where the gigabytes went).

    Install

    Part of the comfyui_pilcothink_VisionSLM pack:

    cd ComfyUI/custom_nodes
    git clone https://github.com/gpdev-Pilcothink/comfyui_pilcothink_VisionSLM
    

    Restart ComfyUI, or install via ComfyUI Manager (search comfyui_pilcothink_VisionSLM). The pack needs transformers ≥ 4.56.2 for Qwen3 support, plus torch and accelerate from its requirements.

    Gotchas

    The big one is where the weights land: inside the custom node folder, not ComfyUI/models/. Uninstalling or updating the pack can take your downloaded models with it. If you want to move them, you can - the folder layout is self-contained, so a symlink from Models/SLM to a big disk works.

    Two more from the README. If you pick cpu as the device, the author says it only works with float16; other dtypes error out, so don't fight it, just set it. And the README's "downloads into Models/SLM_Vision/" is stale - the code actually uses Models/SLM for this node and Models/VisionSLM for the vision one. Trust the code. As with the rest of this pack, it's new with no community track record, so grab it from the official repo only.

    CategoryPilcothink/SLM

    Inputs (4)

    NameTypeDefaultDescription
    modelCOMBOQwen3-0.6B1 options: Qwen3-0.6B
    deviceCOMBOauto3 options: auto, cuda, cpu
    dtypeCOMBOauto4 options: auto, bfloat16, float16, float32
    download_if_missingBOOLEANtrue

    Outputs (2)

    NameTypeDescription
    slm_modelSLM_MODEL
    model_pathSTRING