ComfyUI Node

prompt

Ask Civitai's moderation bot to grade your prompt before you hit generate

By civitai·Created 2 months ago·Updated about a month ago· 42
prompt
  • api_config
  • results
  • signal_metadata
  • blocked
  • triggered_labels
  • workflow_id
  • raw_json
store_full_responsefalse
positive_prompt
labels_json
label_overrides_json
negative_prompt
instructions

Here's a niche tool for a niche job: a node that runs the same XGuard content-moderation classifier Civitai's platform uses, pointed at your prompt, and tells you whether it would get blocked before you spend a single Buzz on generation. It's an analysis node, not a generator - nothing comes back except verdicts and metadata. If you're building automated pipelines that feed Civitai's hosted models, this is the pre-flight check that keeps a batch job from dying halfway through on a policy violation.

Why would you reach for it? The same reason the pack exists: Civitai's cloud generation runs its own moderation on the fleet, and when a prompt trips the filter you lose the job and the cost. Checking first - locally, cheaply, on the same classifier that will judge the real run - turns a surprise failure into a controlled one. It's also just interesting as a moderation probe: feed it a phrase you're unsure about and see which labels fire.

How it works

The tooltips are unusually honest about the mechanism: this is an LLM chat-completion classifier. The node submits your prompt(s) to the xGuardModeration recipe on Civitai's orchestration API, and the worker classifies against a set of labels, returning which ones triggered. store_full_response is the internal debug switch - keep it off.

The inputs that matter

  • positive_prompt (required) - the prompt to evaluate. This is the main event.
  • store_full_response (required, default false) - the tooltip's blunt warning is worth repeating: when true it stores the full raw response including the complete logprobs array, ballooning the blob from ~2–3 KB to ~200 KB. "Do not enable in normal traffic." It's for one-off debugging of classification decisions.
  • negative_prompt - an optional negative to grade alongside the positive.
  • instructions - extra context for the evaluation.
  • labels_json - when provided, only the named labels are evaluated; unmatched labels are silently ignored. Leave empty for the full default set.
  • label_overrides_json - merges/overrides the default label configs from XGuardModerationOptionsGrain for the mode. This is power-user territory; the defaults are fine.

Outputs: results, signal_metadata, blocked (the yes/no you actually care about), triggered_labels, plus the standard workflow_id and raw_json.

Install and auth

Same pack-wide install: ComfyUI Manager → Custom Nodes Manager → search Civitai Comfy Nodes → Install → restart, or clone + pip install -r requirements.txt (just requests). Auth via a Civitai Auth node, CIVITAI_API_TOKEN, stored OAuth, or browser login.

Where people get burned

Don't treat this as a hard guarantee of what the full generation pipeline will allow - moderation is configured per label set, and the fleet's defaults can differ from what this node evaluates. And keep store_full_response off unless you're genuinely debugging; the 200 KB blobs aren't what you want in your workflow history.

CategoryCivitai/Analysis/prompt

Inputs (7)

NameTypeDefaultDescription
store_full_responseBOOLEANfalseDebug opt-out. When true, the worker stores the full raw chat completion response (including the complete logprobs.content array) in the destination blob instead of the trimmed version. Intended for one-off debugging of classification decisions where the full logprobs distribution or generated token stream needs inspection. Leaves blobs at ~200KB instead of ~2-3KB — do not enable in normal traffic.
positive_promptSTRINGThe positive prompt to evaluate.
labels_jsonoptSTRINGOptional label filter. When provided, only the named labels are evaluated. Labels not found in the defaults (or label overrides) are silently ignored. When omitted or empty, all labels are evaluated.
label_overrides_jsonoptSTRINGOptional label configuration overrides. When provided, these merge with/override the defaults from the XGuardModerationOptionsGrain for the given mode.
negative_promptoptSTRINGThe negative prompt to evaluate.
instructionsoptSTRINGAdditional instructions or context for the moderation evaluation.
api_configoptCIVITAI_CONFIGOptional Civitai Auth connection; defaults to CIVITAI_API_TOKEN or stored OAuth login.

Outputs (6)

NameTypeDescription
resultsSTRING
signal_metadataSTRING
blockedSTRING
triggered_labelsSTRING
workflow_idSTRING
raw_jsonSTRING