Nodes/ComfyUI-DaSiWa-Nodes/DaSiWa LLM Model Selector
ComfyUI Node

DaSiWa LLM Model Selector

Point a local LLM or VLM at your workflow

By darksidewalker·Created 4 months ago·Updated 23 days ago· 22
DaSiWa LLM Model Selector
    • llm_config
    model
    custom_path
    hf_repo_id
    hf_revisionmain
    download_if_missingfalse
    backendtransformers
    taskauto
    deviceauto
    dtypeauto
    quantizationnone
    cache_modeunload_after_run
    trust_remote_codefalse
    attention_implementationauto

    This node doesn't do anything to your images or text by itself - it's the piece that answers "which model, and how do I want it loaded" for DaSiWa_LLMAnalyze. Separate model-selection from model-use is a pattern you'll recognize from checkpoint loaders in general; this is that pattern applied to local chat and vision-language models.

    How it works

    model is a dropdown populated from whatever's already sitting in ComfyUI/models/llm - a folder, not a single file, since local transformers models ship as a directory of config/tokenizer/weight files rather than one .safetensors. If nothing's there yet, it shows None, which is your cue to either drop a model folder in manually or use the two fields built for pulling one automatically: hf_repo_id (a Hugging Face repo, like author/model-name) plus hf_revision (default main) and download_if_missing - flip that on and the node fetches the repo into ComfyUI/models/llm the first time it can't find it locally, rather than you doing it by hand with git lfs or the huggingface-cli. custom_path is the escape hatch if your model lives somewhere outside the standard folder.

    task (auto/text/vision) tells the node how to treat the model - leave it on auto for standard chat or VLM checkpoints; set it explicitly if you're loading something with an ambiguous config the auto-detection guesses wrong on. backend currently only offers transformers, so there's nothing to actually decide there yet, but the field exists for whatever gets added later.

    The inputs and outputs that matter

    The real decisions are in the loading/memory settings:

    • device (auto/cuda/cpu) and dtype (auto/float16/bfloat16/float32) - leave both on auto unless you're deliberately forcing CPU inference or need a specific precision for a model that's picky about it.
    • quantization (none/8bit/4bit) - the lever for fitting a bigger model into less VRAM. 4bit gets you the most headroom at the most quality cost; try 8bit first if you're on the edge of running out of memory rather than jumping straight to 4bit.
    • cache_mode (cached or unload_after_run, default unload_after_run) - cached keeps the model resident in VRAM between runs (fast on repeated queue presses, but it's sitting there taking up space the rest of your workflow might want); unload frees it after every run at the cost of a reload next time.
    • trust_remote_code (default false) - some HF model repos ship custom Python alongside their weights and require this to load at all. It's off by default for a reason: it means running arbitrary code from that repo, so only flip it on for models you actually trust the source of.
    • attention_implementation (auto/sdpa/flash_attention_2/eager) - leave on auto unless you've specifically installed flash-attn separately, since selecting flash_attention_2 without that package installed will fail rather than fall back gracefully.

    Single output: llm_config (type DASIWA_LLM_CONFIG) - wire it straight into DaSiWa_LLMAnalyze's required input.

    How to install it

    ComfyUI Manager - search DaSiWa-Nodes, install, restart. Manual: clone into custom_nodes, pip install -r requirements.txt, restart. The pack's own dependencies get you the transformers backend; the actual model weights are a separate download either manually or via download_if_missing, and can be sizeable - budget disk space and bandwidth accordingly, especially for vision-capable models.

    Common issues & troubleshooting

    Model dropdown shows None even though I have models. Check they're actually in ComfyUI/models/llm as a proper model folder (config.json, tokenizer files, weights) and not just loose files or nested one directory too deep - or use custom_path to point at wherever they actually are.

    Load fails with a "trust_remote_code" error. The model's repo requires custom code to load and the node has it off by default for safety. Only enable it if you trust the source, then retry.

    Out of memory loading a model that should fit. Try quantization before assuming the model's simply too big - 8bit or 4bit can be the difference between fitting and not, especially on a VLM where the vision tower adds meaningfully to the footprint beyond the base parameter count.

    CategoryDaSiWa/LLM

    Inputs (13)

    NameTypeDefaultDescription
    modelCOMBO1 options: None
    custom_pathSTRING
    hf_repo_idSTRING
    hf_revisionSTRINGmain
    download_if_missingBOOLEANfalse
    backendCOMBOtransformers1 options: transformers
    taskCOMBOauto3 options: auto, text, vision
    deviceCOMBOauto3 options: auto, cuda, cpu
    dtypeCOMBOauto4 options: auto, float16, bfloat16, float32
    quantizationCOMBOnone3 options: none, 8bit, 4bit
    cache_modeCOMBOunload_after_run2 options: cached, unload_after_run
    trust_remote_codeBOOLEANfalse
    attention_implementationCOMBOauto4 options: auto, sdpa, flash_attention_2, eager

    Outputs (1)

    NameTypeDescription
    llm_configDASIWA_LLM_CONFIG