Nodes/ComfyUI-ZMongo/10 Prompt Critic
ComfyUI Node

10 Prompt Critic

A Gemini-powered second opinion on your prompt

By CentralFloridaAttorney·Created 5 months ago·Updated 2 months ago· 1
10 Prompt Critic
  • text_agent_config
  • json
  • revised_prompt
  • score
  • success
  • refresh
prompt
context_pack
target_modelComfyUI image/video model
rubricScore clarity, visual specificity, consistency, contradiction risk, and model fit.
save_to_ledgertrue
refresh_token

Every serious ComfyUI user has stared at a prompt and known it's wrong but not why. Prompt Critic is ZMongo's answer: it hands your prompt to Gemini, asks it to critique it like a professional prompt engineer against a rubric you supply, and gets back a score plus a rewritten prompt that's supposedly ready to drop into a CLIP Text Encode.

The framing matters for what to expect. The critic's own prompt asks for clarity, visual specificity, consistency, contradiction risk, and model fit - the same axes the community actually argues about. Given how much of modern prompting is now "write an instruction, not a tag list" (see the KB's prompt-engineering essay on LLM-encoded models), a model that can restructure a prompt into something structured and specific is genuinely useful when it works.

How it works

The node takes your text_agent_config (from a Text Agent Session node - which means a hosted ZMongo API session, since Gemini calls route through the backend's /api/chat), builds a critique prompt with your target_model, rubric, and optional context_pack, and calls Gemini at a fixed temperature of 0.2 - low, because you want a consistent reviewer, not a creative one. It asks for JSON with a schema: score, per-axis scores, strengths, weaknesses, recommendations, and a revised_prompt.

Then it parses the JSON best-effort, extracts the score and revised prompt, and - if save_to_ledger is on (it is by default) - writes the whole audit into your ledger collection as a prompt_critic record so you keep a history of every critique.

Inputs and outputs that matter

  • text_agent_config - required; comes from Text Agent Session.
  • prompt - the prompt under review.
  • target_model - what you'll generate with (default "ComfyUI image/video model"), so the critic tailors language appropriately.
  • rubric - what to score. The default covers clarity, specificity, consistency, contradiction risk, and model fit; edit it to match your style.
  • context_pack - optional project memory to include.
  • save_to_ledger - default true; turn off to skip writing the audit record.

Outputs: revised_prompt (STRING - the usable output), score (FLOAT), json (full audit payload including raw Gemini text), success (BOOLEAN), and refresh (bump it to force a re-critique).

Installing it

cd ComfyUI/custom_nodes
git clone https://github.com/CentralFloridaAttorney/ComfyUI-ZMongo

Restart ComfyUI or install via ComfyUI Manager ("ComfyUI-ZMongo"). Heavy requirements.txt install regardless of node - pymongo, langchain, sentence-transformers, transformers, FlagEmbedding.

Common issues

  • Score 0, but no crash - Gemini returned unparseable text. Check the json output; the node falls back to a raw_text field with the score zeroed rather than failing. This usually means the model ignored the JSON schema.
  • success false even though it critiqued - save_to_ledger is on and the ledger write failed (auth/collection issue). Check json for the save_payload. If you don't care about the ledger, flip save_to_ledger off.
  • "Missing ZMongo API session" - the Text Agents family needs a hosted API key session; local file store won't serve /api/chat.
  • Revised prompt not usable - it's an LLM's rewrite, not a guarantee. If the model produced (word:1.4)-style weighting or boilerplate that's inert on modern LLM-encoded models, take the critique, not the rewrite.
CategoryZMongo/07 Text Agents/Prompt Agents

Inputs (7)

NameTypeDefaultDescription
text_agent_configZMONGO_TEXT_AGENT_CONFIG
promptSTRING
context_packoptSTRING
target_modeloptSTRINGComfyUI image/video model
rubricoptSTRINGScore clarity, visual specificity, consistency, contradiction risk, and model fit.
save_to_ledgeroptBOOLEANtrue
refresh_tokenoptSTRING

Outputs (5)

NameTypeDescription
jsonSTRING
revised_promptSTRING
scoreFLOAT
successBOOLEAN
refreshSTRING