图像分区 · 人像 Prompt 质量检查
A lint check for your portrait prompts, because the model won't tell you they're too thin
- validated_prompt
- quality_report_json
A portrait edit prompt that says only "change the face" is a coin flip on a bad result, and the bad result is expensive: a full generation cycle before you see it. RegionEditPortraitPromptQualityGate is a cheap, deterministic gate that stops obviously thin prompts before they ever reach the model. It's the pack's version of a linter - it doesn't claim the prompt is good, it just refuses to pretend an incomplete one is ready.
The inputs are the knobs of a coverage check. prompt (multiline), plus minimum_characters (default 120), minimum_sentences (default 2), and maximum_sentences (default 8). The node splits your text on sentence boundaries, checks the length, and - this is the interesting part - checks for coverage of the things a portrait edit prompt actually needs. From the source, that's a subject or face term ("face", "portrait", "woman", "person", "subject"), a head-pose or direction term ("head", "pose", "facing", "profile", "three-quarter"), and more of the same family. If the prompt doesn't mention what the subject is or which way they're facing, it fails the gate.
Crucially, the gate doesn't fix your prompt and it doesn't block the run by default - it hands back the original text as validated_prompt and drops a detailed quality_report_json on the side. That report is the whole value: it tells you exactly which required element is missing. You wire the report to a text display, look at it once, and you've learned what your portrait prompts keep forgetting.
Honest take: a 120-character floor is a decent heuristic, not a guarantee. You can hit every checkbox with a boilerplate sentence that's still a bad edit instruction - the docstring in the source says it plainly: this is a format/coverage gate, not a claim the caption is visually truthful. What it catches is the real failure mode of pipelines that auto-generate prompts (the pack's own identity-route workflows feed VLM-generated captions in here): an LLM that summarizes "regenerate the face" into one thin clause. That's the trap this gate exists for.
Outputs are just the two: validated_prompt and quality_report_json. The report is a JSON blob, so it pairs naturally with a text display node or a route selector that inspects pass/fail. If you want the gate to actually stop the run on failure, you'll want to combine it with a control node or a route that checks the report - the gate itself is deliberately passive.
Install: ComfyUI Manager → Region Edit Toolkit (native-region-tile-planner-merge), or git clone https://github.com/Liu-Bot24/ComfyUI-Region-Edit-Toolkit.git into custom_nodes, pip-install requirements.txt into ComfyUI's real Python, restart. Pure text processing - no models, no downloads, nothing to tune except the three threshold widgets.
This pack is too new to have community folklore, but a prompt gate is about the most self-auditing node you'll find: wire the report to a display, feed it a deliberately terrible prompt, and you'll see exactly what it's checking before you trust it on real work.
Inputs (4)
| Name | Type | Default | Description |
|---|---|---|---|
| prompt | STRING | — | |
| minimum_characters | INT | 12040–2000 | — |
| minimum_sentences | INT | 21–8 | — |
| maximum_sentences | INT | 81–30 | — |
Outputs (2)
| Name | Type | Description |
|---|---|---|
| validated_prompt | STRING | — |
| quality_report_json | STRING | — |