Classify Persona
Build a system prompt from a few text pieces
- system_prompt_input
A good system prompt is rarely written in one sitting - it's a character bio, plus a set of rules, plus maybe a couple of examples, assembled together. Doing that assembly by hand-editing one giant text box every time you tweak the rules gets old fast. Classify Persona lets you keep those pieces separate and combine them into one system prompt at graph time instead.
How it works
It takes up to three text snippets plus an optional block of file content, concatenates them, and hands back a single string shaped for a system prompt slot. The separation is the actual value here: keep your character's backstory in one node, your behavioral rules in another, and swap either one out without touching the rest - useful if you're iterating on a persona and want to A/B a single piece of it (maybe paired with any_switcher to flip between two rule sets) without rebuilding the whole prompt.
The inputs and outputs that matter
file_content(optional) - pull in a chunk of text from a file, useful if part of your persona lives in a document rather than being typed directly into the node.text1,text2,text3(all optional) - your persona pieces. None are required, so you can use just one or two if three slots is more than you need.is_enable- toggle the node off without removing it.- One output:
system_prompt_input- wire this into the system prompt input on your LLM/agent node.
If three text slots isn't enough for what you're building, the pack's classify_persona_plus is the same idea scaled up to ten.
How to install it
- ComfyUI Manager - search "comfyui_LLM_party", install, restart.
- Manual -
cd ComfyUI/custom_nodes && git clone https://github.com/heshengtao/comfyui_LLM_party, then restart.
Then pip install -r requirements.txt from inside the comfyui_LLM_party folder, in your ComfyUI Python environment (python_embeded\python.exe -m pip install -r requirements.txt on portable Windows). No extra dependency for this node beyond the pack's baseline - it's text concatenation, nothing more.
Common issues & troubleshooting
System prompt comes out empty. Every input on this node is optional, which means it's entirely possible to leave all four fields blank and get nothing out. If your agent isn't behaving the way its persona should suggest, check that at least one of file_content/text1/text2/text3 is actually wired in.
Pieces are concatenating in an order you didn't expect. The node combines whatever's connected in a fixed order (file content, then the numbered text slots) - if the ordering of your persona pieces matters (rules before backstory, say), plan your text slots around that rather than assuming you can reorder freely.
Persona feels diluted or contradictory. This is a prompting problem more than a node problem - if text1 says "be terse" and text3 says "explain thoroughly," concatenation doesn't reconcile the conflict, it just hands the LLM both instructions and lets it sort it out (often badly). Keep the pieces coherent with each other.
The pack won't load. Separate from this node, comfyui_LLM_party has a real, current install issue where nodes fail to import after a Manager install - usually a CUDA/PyTorch mismatch with no clear compatibility list. Check that first if classify_persona isn't in your node browser at all.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| is_enable | BOOLEAN | true | — |
| file_contentopt | STRING | — | |
| text1opt | STRING | — | |
| text2opt | STRING | — | |
| text3opt | STRING | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| system_prompt_input | STRING | — |