Nodes/comfyui_LLM_party/Classify Function
ComfyUI Node

Classify Function

Route text down one of three output branches

By heshengtao·Created 2 years ago·Updated 11 days ago· 2,328
Classify Function
    • response1
    • response2
    • response3
    is_enabletrue
    text

    A static ComfyUI graph can't natively decide "run branch A instead of branch B" based on what an LLM just said - every node downstream of a given point just runs, regardless of what the text passing through it actually means. Classify Function looks like comfyui_LLM_party's answer to exactly that gap: it takes text and routes the result out through one of three named outputs instead of one fixed one, so wiring only the branch you care about to a specific output slot is how you fake conditional branching in a graph that otherwise can't do it.

    That's a real, longstanding pain point for exactly this kind of build. The pack's own author has described the underlying problem directly when explaining a related feature: getting an LLM's decision to actually change which part of a workflow executes next is something ComfyUI "finds challenging to perform," because the graph's topology is fixed once a run starts. Classify Function is a lighter-weight tool aimed at that same problem, for the case where you just need a three-way split rather than the full workflow-nesting machinery of Start Workflow / End Workflow.

    The inputs and outputs that matter

    • text - the input to classify.
    • is_enable - the pack's standard bypass toggle.

    That's genuinely the entire visible input set - there's no model_name, no exposed list of categories, no field defining what the three branches actually mean. Whatever classification logic decides which output carries the result is baked into the node's own code rather than something you configure on the graph. That's worth being upfront about: this brief's schema doesn't tell you what distinguishes response1 from response2 from response3, and there's no honest way to guess it from the inputs alone.

    Outputs: response1, response2, response3 - three separate STRING outputs. The practical pattern is almost certainly: wire each one to a different downstream branch, and only the branch matching whatever category the node decided the text fell into actually receives a non-empty value - the same "leave the outputs you don't want disconnected" trick used elsewhere in this pack.

    How to use it in practice

    Since the exact classification categories aren't documented in the node's schema, the fastest way to actually understand this node is to drop it on a canvas, feed it a few different text inputs, and watch which of the three outputs lights up for each one. That fifteen minutes of poking will tell you more than guessing - and once you know the pattern, wiring the three outputs to three different downstream branches gets you conditional-feeling behavior without the overhead of this pack's full sub-workflow machinery.

    How to install it

    Search comfyui_LLM_party in ComfyUI Manager and install, then restart. Manual route:

    cd ComfyUI/custom_nodes
    git clone https://github.com/heshengtao/comfyui_LLM_party.git
    

    Run pip install -r requirements.txt from inside the pack's folder using ComfyUI's own Python, then restart. If this node calls an LLM internally to do the classification (which its behavior strongly suggests, given it lives in a pack built around LLM calls), it likely inherits credentials from config.ini the same way several of this pack's other minimal-input nodes do - check there first if it errors rather than assuming a missing field on the node itself.

    Common issues & troubleshooting

    All three outputs come back empty. Given the sparse input set, this is most likely a credentials problem if the node calls an LLM behind the scenes - check config.ini before assuming your input text is the issue.

    You're not sure which output to wire. There's no substitute here for testing directly with your actual expected inputs - run a few representative examples through and observe which output slot receives data for each, since that behavior isn't spelled out in the node's visible configuration.

    You need more than three categories, or categories you define yourself. This node's three-way split appears fixed rather than configurable. For a custom set of categories, you're likely better served building the classification yourself with the pack's LLM node (a system prompt telling it to answer with one of your own category labels) paired with JSON Get Value to route on the result.

    Category大模型派对(llm_party)/文本(text)

    Inputs (2)

    NameTypeDefaultDescription
    is_enableBOOLEANtrue
    textSTRING

    Outputs (3)

    NameTypeDescription
    response1STRING
    response2STRING
    response3STRING