LLM Prompt Conditioning
Skip the two CLIPTextEncode nodes
- clip
- positive
- negative
- positive_prompt
- negative_prompt
- raw_response
If you've read the LLM Prompt Tags article, you know the drill: type a sentence, get booru tags back. This node is the same call with one difference - it does the encoding for you. LLM Prompt Conditioning (class OpenAICompatiblePromptConditioning) takes a CLIP input, runs the same chat-completions request, and outputs positive and negative CONDITIONING tensors ready to plug into the sampler. No two CLIPTextEncode nodes, no middleman.
The README is upfront about why both variants exist: returning strings is the flexible design, and this one is the convenience wrapper for a single-step workflow. Want to eyeball or edit the tags before they hit the model? Use the pair node. Want "sentence in, image out" with the smallest possible graph? This is the one.
How it works
Identical pipeline under the hood: POST to <api_base_url>/chat/completions, ask for {"positive": [...], "negative": [...]} JSON, prepend your fixed prefixes, dedupe. Then, instead of handing you strings, it runs clip.tokenize and clip.encode_from_tokens_scheduled on both, and returns the conditioning.
The one thing worth internalizing is that encoding happens inside the node. With the pair variant you can inspect the tags before spending the encode. Here, you find out what the LLM said after it's been tokenized. That's why the node still surfaces three string outputs - positive_prompt, negative_prompt, and raw_response - so you can see exactly what got encoded and debug when the result is nonsense.
Inputs and outputs
The required clip input is the thing beginners forget. It has to be wired from a checkpoint loader (or a standalone CLIP loader), and it's checked before anything else happens - leave it unconnected and the node errors "clip input is required" before it even hits the API. The rest of the inputs are identical to the pair node: api_key, user_prompt, positive_prefix / negative_prefix, model, system_prompt, temperature, max_tokens, timeout_seconds, and print_to_console.
Outputs: positive and negative conditioning go straight into the sampler's positive and negative inputs. The three strings trail behind for inspection.
Install
Same pack, same steps as LLM Prompt Tags: search ComfyUI-LLM-Prompt-Tagger in ComfyUI Manager and install, or
cd ComfyUI/custom_nodes
git clone https://github.com/longyijdos/ComfyUI-LLM-Prompt-Tagger
then restart ComfyUI. No dependencies to pip install, no weights to download - pure Python standard library plus an API key.
The traps worth naming
The shared gotchas all apply: the default model is deepseek-reasoner, and if max_tokens is too low it burns the budget reasoning and returns no content - bump it. Blank key gets you a 401. A model that answers in prose instead of JSON gets you the parse error, with a preview of what it actually said.
The node-specific caveat is that it encodes immediately, so a bad prompt costs you a full encode before you see it. When you're iterating on the system prompt or prefixes, keep the pair node around for the cheap round-trips and switch to this one once the formula is locked. And remember the vocabulary: the default prefixes are Pony-style score_9... tags, which do nothing on an Illustrious or NoobAI checkpoint - match the prefixes and system prompt to your model rather than trusting the author's anime defaults.
Inputs (12)
| Name | Type | Default | Description |
|---|---|---|---|
| clip | CLIP | — | |
| api_base_url | STRING | https://api.deepseek.com/v1 | — |
| api_key | STRING | — | |
| model | STRING | deepseek-reasoner | — |
| user_prompt | STRING | A silver-haired girl wearing a winter coat stands on a snowy city street at night, shown in an upper-body shot with warm street lights in the background. | — |
| positive_prefix | STRING | score_9, score_8_up, score_7_up, rating_safe | — |
| negative_prefix | STRING | score_4, score_5, score_6, bad anatomy, worst quality, low quality | — |
| system_prompt | STRING | You convert natural-language image requests into Stable Diffusion prompts for anime and illustration models. Return JSON only, with this exact shape: { "positive": ["tag 1", "tag 2"], "negative": ["tag a", "tag b"] } Rules: - Output short English tags only, not prose sentences. - Prefer booru-style tags and tag fragments that work well in image models. - Put subject, clothing, environment, pose, camera angle, and composition in positive. - Put defects and unwanted artifacts in negative. - Add simple count tags when clear, such as 1girl, 1boy, solo. - Prefer camera/view tags like low angle, from below, close-up, upper body, cowboy shot, desk view. - Do not invent expression, lighting, pose, or background details unless the user request clearly implies them. - Do not repeat tags already supplied in the fixed positive_prefix or negative_prefix. - Do not include explanations, markdown, numbering, or extra keys. - The examples below show only the generated tags, not the fixed prefixes. Example 1 User request: A silver-haired girl wearing a winter coat stands on a snowy city street at night, shown in an upper-body shot with warm street lights in the background. Output: { "positive": ["1girl", "solo", "silver hair", "winter coat", "snow", "city street", "night", "upper body", "street lights"], "negative": ["blurry", "watermark", "text"] } Example 2 User request: Draw a blue-haired female mage wearing a large hat, holding a staff, standing in a forest. Output: { "positive": ["1girl", "solo", "blue hair", "mage", "witch hat", "holding staff", "forest", "standing"], "negative": ["blurry", "bad hands", "watermark", "text"] } Example 3 User request: A cyberpunk boy standing on a rainy night street, upper-body shot, neon lights in the background. Output: { "positive": ["1boy", "solo", "cyberpunk", "rainy night", "street", "upper body", "neon lights", "city"], "negative": ["blurry", "extra fingers", "watermark", "text"] } | — |
| temperature | FLOAT | 0.200–2 | — |
| max_tokens | INT | 409664–4096 | — |
| timeout_seconds | INT | 605–600 | — |
| print_to_console | BOOLEAN | false | — |
Outputs (5)
| Name | Type | Description |
|---|---|---|
| positive | CONDITIONING | — |
| negative | CONDITIONING | — |
| positive_prompt | STRING | — |
| negative_prompt | STRING | — |
| raw_response | STRING | — |