Nodes/GALIAIS-Nodes/GALIAIS-Nodes Prompt Quality Gate
ComfyUI Node

GALIAIS-Nodes Prompt Quality Gate

A pass/fail gate for your prompt, before the sampler ever runs

By GALIAIS·Created 3 months ago·Updated 3 months ago· 0
GALIAIS-Nodes Prompt Quality Gate
  • 项目配置
  • DB
  • 通过
  • 质量评分
  • 评级
  • 修复建议
  • 门禁JSON
提示词
允许NSFWfalse
最低通过分80

You've composed a prompt, wired it into the sampler, hit queue - and only after a minute of waiting do you see the mess: conflicting tags fighting each other, a duplicate that's silently blunting the one that matters, or a stray NSFW tag in what was supposed to be a safe render. The Prompt Quality Gate is the node that runs that check before you waste the sampler's time. It scores your prompt 0–100, grades it A–D, and hands back a real 通过 (pass) boolean you can wire into a switch.

It's a linter, not an oracle. The whole thing runs locally on a small rule engine - no AI provider, no API key, no network. Drop a prompt in the 提示词 input (that's the "prompt" field; this pack's labels are Chinese-first, get used to it), set how strict you want to be, and read the verdict.

How it works

Internally it calls the same _diagnose_prompt routine the rest of the pack uses. It splits your prompt into tags, then checks for the stuff that actually degrades anime-tag generations: duplicate tags, known conflict groups (smile vs crying, open_eyes vs closed_eyes, simple_background vs scenery), unknown tags, and - the one that's genuinely useful - NSFW tags detected in a SFW prompt when 允许NSFW is off. It also checks how complete your prompt is: does it have a subject, clothing, a pose, a scene, a style? Missing chunks cost points.

The score starts at 100 and sheds points per problem, then adds a small completeness bonus and clamps to 0–100. A C or worse is your cue to look at the 修复建议 (fix suggestions) output, which lists each issue with a concrete remedy in plain text.

Three inputs actually matter, and two of them are the defaults:

  • 提示词 - the prompt to judge.
  • 最低通过分 - the bar. Default 80; lower it if you're scoring early drafts.
  • 允许NSFW - off by default. If you're legitimately prompting NSFW, flip it or the gate flags you as an error.

The five outputs are 通过 (BOOLEAN), 质量评分 (INT), 评级 (STRING), 修复建议 (STRING), and 门禁JSON (STRING). Wire 通过 into a switch node before the sampler and you've got an actual quality gate - bad prompts get rerouted to a "fix me" branch instead of a 60-second wasted queue.

Installing and the DB caveat

Install via ComfyUI Manager (search "GALIAIS-Nodes") or:

cd ComfyUI/custom_nodes
git clone https://github.com/GALIAIS/GALIAIS-Nodes.git

Then restart ComfyUI. Good news: the pack has zero pip dependencies - pure stdlib. The catch is the optional DB input. Without a Danbooru runtime DB loaded (built via the Danbooru Runtime DB Builder, loaded with the DB Loader), the gate goes blind: it can't tell known tags from unknown ones and can't spot NSFW tags. Duplicate and conflict detection still work, but the two most useful checks are DB-dependent. If you're scoring real prompts, feed it the DB - it's the difference between a rubber stamp and a useful referee.

Common gotcha: the gate passes only when the score clears your threshold and no error-severity issue is present, so an otherwise-90-point prompt with a stray NSFW tag will still fail on default settings. That's the feature, not a bug.

CategoryGALIAIS-Nodes/diagnostics

Inputs (5)

NameTypeDefaultDescription
提示词STRING
允许NSFWBOOLEANfalse
最低通过分INT800–100
项目配置optGALIAIS_NODES_PROJECT_CONFIG
DBoptGALIAIS_NODES_DANBOORU_DB

Outputs (5)

NameTypeDescription
通过BOOLEAN
质量评分INT
评级STRING
修复建议STRING
门禁JSONSTRING