Nodes/ComfyUI llama.cpp Suite/llama.cpp ADV++ Prompt
ComfyUI Node

llama.cpp ADV++ Prompt

The ADV++ kitchen sink

By Setmaster·Created 8 months ago·Updated 2 months ago· 6
llama.cpp ADV++ Prompt
  • trigger
  • token_ban
  • image_1
  • image_2
  • image_3
  • image_4
  • image_5
  • image_6
  • image_7
  • image_8
  • image_9
  • image_10
  • structured_output
  • connection
  • response
  • thinking
  • success
templateEmpty
prompt
image_amount2
model(use running model)
server_url
system_prompt
enable_thinkingtrue
max_tokens2048
temperature0.70
top_p0.90
top_k40
min_p0.05
repeat_penalty1.10
presence_penalty0.0
frequency_penalty0.0
seed0
keep_contextfalse
enable_chainingfalse
enable_token_bantrue
stop_sequences
api_key_envLLAMACPP_API_KEY
verify_tlstrue
request_timeout300
include_image_batchfalse

ADV Prompt does text-plus-images. ADV++ takes that and stacks on the three things that turn a chatty LLM into a reliable pipeline component: bundled prompt templates, token bans, and structured-output constraints. If you've ever gotten a caption back that starts with "Here is a detailed description of your image," this node is the cure.

It's the node you reach for when the LLM isn't just generating text - it's doing a job with strict output requirements. Caption → image prompt. Rough idea → structured prompt. Raw text → valid JSON. Those jobs are exactly where a plain chat model fails, because it hands you its conversational habits as literal output.

How it works

ADV++ is ADV Prompt's generation engine with three extra plug-in points, each coming from a sibling node or a bundled file:

  • Templates - the template dropdown applies a bundled prompt template before generation. The pack ships Image2Prompt (rewrite an image into a single final image-generation prompt) and Prompt Enhancer (turn rough ideas into detailed prompts), defined in web/templates.json. Each template injects a system_prompt and an optional default user prompt. Templates are applied in Python, so API-format and headless workflows behave the same as the UI.
  • Token bans - a token_ban input takes a list from a llama.cpp Token Ban node. The bans are sent as llama.cpp text-form logit-bias entries, so generation is steered away from specific tokens the same way the LTX-style hard-stop nodes block role delimiters.
  • Structured output - a structured_output input accepts a constraint built by llama.cpp Structured Output (JSON Schema, JSON object, or GBNF grammar), which forces decoding into the shape you asked for.

The inputs that matter

Most of the sampling controls match ADV Prompt, so I'll skip those and hit the distinctive ones:

  • template - Empty, Image2Prompt, or Prompt Enhancer. Restart ComfyUI after editing web/templates.json to add your own.
  • prompt - the user prompt. With Image2Prompt this is where an image description or output: marker goes.
  • image_amount / image_1…image_10 / include_image_batch - the full vision stack, same as ADV Prompt.
  • token_ban + enable_token_ban - plug in a Token Ban node and toggle it.
  • structured_output - plug in a Structured Output node. enable on that node is what bypasses the constraint when you're experimenting.
  • stop_sequences - still useful even with structured output; belt and braces.

Outputs: response (the final generated or structured text), thinking, and success.

Why this matters

The KB's LLM-in-ComfyUI essay is blunt about the failure mode: a chat LLM doesn't emit a clean prompt by default - it emits role delimiters, preamble, markdown scaffolding. ADV++ gives you the three-layer fix in one node: a template that tells it the exact job, token bans that physically stop it from writing certain tokens, and structured output that constrains decoding itself. That combination is the difference between an enhancer that makes your prompts worse and one that earns its place in the graph.

Common issues

  • Template output looks wrong - the bundled templates are opinionated (Image2Prompt is explicitly NSFW-tolerant and refuses to omit visible anatomy). Edit web/templates.json and restart if you want your own rules.
  • Structured output and token bans fighting - a ban that contradicts the grammar can stall generation. Disable one while you debug.
  • Model adds text outside the JSON - make sure strict is on in the Structured Output node and system_prompt is empty or minimal; the template's system prompt can override your formatting intent.
CategoryLlamaCpp

Inputs (38)

NameTypeDefaultDescription
templateCOMBOEmptyApply a bundled prompt template before generation.
promptSTRINGThe user prompt to send to the LLM
image_amountINT20–10Number of image input slots to show
modeloptCOMBO(use running model)Model for router mode, or the running direct model.
server_urloptSTRINGLeave empty to use the server owned by this node pack. Attached endpoints are never implicitly stopped.
system_promptoptSTRINGSystem prompt that defines model behavior.
enable_thinkingoptBOOLEANtrueRequest thinking/reasoning from compatible models.
max_tokensoptINT20481–131072Maximum number of tokens to generate.
temperatureoptFLOAT0.700–2Sampling randomness. Lower values are more deterministic.
top_poptFLOAT0.900–1Keep tokens within this cumulative probability mass.
top_koptINT400–200Sample from the top K tokens. 0 disables top-k filtering.
min_poptFLOAT0.050–1Discard tokens below this probability relative to the best token.
repeat_penaltyoptFLOAT1.101–2Penalize recently repeated tokens. 1.0 disables the penalty.
presence_penaltyoptFLOAT0.0-2–2Penalize tokens that have appeared at least once.
frequency_penaltyoptFLOAT0.0-2–2Penalize tokens in proportion to how often they appeared.
seedoptINT00–2147483647Random seed
keep_contextoptBOOLEANfalseReuse a matching prompt-prefix KV cache. This is not chat history.
enable_chainingoptBOOLEANfalseCompatibility toggle. A connected trigger already controls ordering.
triggeropt*Optional dependency input used to sequence execution.
token_banoptLOGIT_BIASToken ban list from a llama.cpp Token Ban node.
enable_token_banoptBOOLEANtrueEnable or disable the connected token ban list.
stop_sequencesoptSTRINGStop sequences. JSON arrays preserve commas and whitespace.
api_key_envoptSTRINGLLAMACPP_API_KEYEnvironment variable containing the API key. The secret is not serialized.
verify_tlsoptBOOLEANtrueVerify HTTPS certificates.
request_timeoutoptINT3001–86400Overall generation deadline in seconds.
include_image_batchoptBOOLEANfalseSend every image in each connected IMAGE batch.
image_1optIMAGEOptional image 1. Visibility follows image_amount.
image_2optIMAGEOptional image 2. Visibility follows image_amount.
image_3optIMAGEOptional image 3. Visibility follows image_amount.
image_4optIMAGEOptional image 4. Visibility follows image_amount.
image_5optIMAGEOptional image 5. Visibility follows image_amount.
image_6optIMAGEOptional image 6. Visibility follows image_amount.
image_7optIMAGEOptional image 7. Visibility follows image_amount.
image_8optIMAGEOptional image 8. Visibility follows image_amount.
image_9optIMAGEOptional image 9. Visibility follows image_amount.
image_10optIMAGEOptional image 10. Visibility follows image_amount.
structured_outputoptSTRUCTURED_OUTPUTJSON schema, JSON object, or GBNF constraint.
connectionoptLLAMACPP_CONNECTIONOptional reusable local or remote connection profile.

Outputs (3)

NameTypeDescription
responseSTRINGGenerated multimodal or structured response text.
thinkingSTRINGReasoning content reported separately by compatible models.
successBOOLEANWhether generation completed successfully.