Nodes/TA-ComfyUI-Nodes-Pack/🎯 TA LLM Prompt Selector
ComfyUI Node

🎯 TA LLM Prompt Selector

Pick the right prompt string depending on whether the LLM is actually up

By tmode-1960Β·Created 11 months agoΒ·Updated 5 months agoΒ· 5
🎯 TA LLM Prompt Selector
    • STRING
    β—„llm_statusDISABLEDβ–Ί
    β—„text2promptβ–Ί
    β—„image2promptβ–Ί

    An LLM prompt generator is only useful if the LLM is actually reachable, and nothing breaks a workflow like a dead backend feeding an empty string into your sampler. TA LLM Prompt Selector is a tiny routing node that answers one question: "is the LLM alive, and did it produce anything?" - then hands you the right prompt accordingly.

    It takes three strings. llm_status is the status output from an upstream LLM node (the pack's TA Smart LLM emits exactly this); the value "DISABLED" or an empty string means the LLM is off. text2prompt is the prompt the LLM generated, and image2prompt is a fallback - typically a manually written or image-derived prompt you'd rather use when the LLM isn't in play. The logic, straight from the source: if llm_status is active (anything other than "DISABLED") AND text2prompt is non-empty, output text2prompt; otherwise output image2prompt. Single STRING output, wire it into your CLIP Text Encode and done.

    It's a small thing, but it's the difference between a workflow that degrades gracefully and one that silently renders with an empty prompt. If you've ever had a session where your local LLM backend crashed mid-batch and you got a run of garbage images, you already know why this node exists. It's also a nice way to prototype: write your own fallback prompt, let the LLM try to beat it, and let the selector pick whichever is actually available. No cleverness, no hidden state - the status string is the source of truth, so whatever node produces it just needs to be honest about being down.

    One thing worth noting: this is one of the pack's older nodes, and it sits in a "ThomasAI" category rather than the newer "TA Tools" / "TA Nodes/*" namespaces - the author's naming settled down after this one shipped. If you see a TA Smart LLM in a workflow, this is its natural partner: Smart LLM produces prompt and status, and this node consumes the status to decide which prompt flows forward.

    Install. No Python dependencies; standard pack install:

    cd ComfyUI/custom_nodes
    git clone https://github.com/tmode-1960/TA-ComfyUI-Nodes-Pack
    

    or ComfyUI Manager (search "TA ComfyUI Nodes Pack"), restart, and it's under ThomasAI.

    Gotchas. The two things that trip people up: leave llm_status disconnected (defaults to "DISABLED") and you'll always get image2prompt, no matter what the LLM produced - so wire the status or it silently ignores your generated prompt. And remember the pack's v2.x rewrite: old v1 workflows need rebuilding, and this node's category name is a fossil of an earlier era, not a sign that anything's broken.

    CategoryThomasAI

    Inputs (3)

    NameTypeDefaultDescription
    llm_statusSTRINGDISABLEDβ€”
    text2promptSTRINGβ€”
    image2promptSTRINGβ€”

    Outputs (1)

    NameTypeDescription
    STRINGSTRINGβ€”