Nodes/ComfyUI llama-swap/πŸ¦™ Llama-Swap Model Selector
ComfyUI Node

πŸ¦™ Llama-Swap Model Selector

One model picker to drive every llama-swap node in your graph

By ai-joe-gitΒ·Created 6 months agoΒ·Updated 6 months agoΒ· 14
πŸ¦™ Llama-Swap Model Selector
    • model_name
    β—„server_urlhttp://localhost:8080β–Ί
    β—„modelβ–Ί

    The πŸ¦™ Llama-Swap Model Selector is the boring half of the pack, and boring is exactly the point. It's a widget node: a server_url field, the same πŸ”„ Fetch Models button its sibling Client node has, and one output - a STRING holding the model name you picked. It generates nothing, calls nothing when you queue, and doesn't even check the server until you press the fetch button. All it does is remember a choice and hand it to you.

    So why does it exist? Because the Llama-Swap Client is designed as a terminal node. It's OUTPUT_NODE - you wire Preview Text into it, and nothing comes out to feed other nodes. If your workflow has three Client nodes doing different jobs (one captioning your render, one expanding your prompt, one answering questions), you'd otherwise type the model id into each one by hand, and they'd drift the first time you swap models. The Selector gives you a single source of truth: pick once, and every Client follows.

    How to use it

    Add the Selector, set server_url to the same address your Client nodes use (default http://localhost:8080), and click πŸ”„ Fetch Models to grab the live list from your llama-swap server. Then in each Client node, right-click the model widget and choose Convert widget to input, which turns it into a proper input port - wire the Selector's model_name output into all of them.

    That's the whole trick. The only other thing worth knowing: because the output is a plain STRING, nothing stops you wiring it into any text input on any node, not just other llama-swap nodes. In practice it's for sharing the model choice, but the wire is yours to abuse.

    Install

    Same as the rest of the pack - ComfyUI Manager (search "ComfyUI llama-swap") or:

    cd ComfyUI/custom_nodes
    git clone https://github.com/ai-joe-git/comfyui_llama_swap
    

    Restart ComfyUI. No extra dependencies beyond requests, no models to download into ComfyUI - everything lives on the llama-swap server.

    Gotchas

    The two real footguns are both about consistency. First, server_url on the Selector must match the Client nodes - it's a plain text field, easy to fat-finger one port and get a silent "no models" toast while the rest of your graph works fine. Second, the fetch is live: it reads /v1/models on the server every time you click, so models you add to llama-swap's config appear in the picker without restarting ComfyUI - but if you change the list, existing Client nodes keep their old value until you re-pick. That's arguably the point of the node, but it's worth knowing the selection is a snapshot, not a subscription. If you only have one Client, you don't need this node at all; it earns its place when the count goes above one.

    Categoryllama-swap

    Inputs (2)

    NameTypeDefaultDescription
    server_urlSTRINGhttp://localhost:8080β€”
    modelSTRINGModel name β€” click Fetch Models button to pick from the server

    Outputs (1)

    NameTypeDescription
    model_nameSTRINGβ€”