图像分区 · 人脸结构差异
An audit node that measures whether the face actually changed structure
- source_landmarks
- result_landmarks
- structure_delta_json
- groups_above_threshold
- automatic_support_only
Most face-edit workflows are all forward motion: detect, crop, prompt, sample, paste. RegionEditFaceStructureDelta is the odd one out - it's an audit node that runs after the edit and answers a question you should be asking: did the face's underlying structure actually change the way I asked it to? It compares the source face's landmarks against the result face's landmarks, groups them by facial region, and reports which groups moved more than an advisory threshold.
It lives in the "6 audit" category of the pack's internal face pipeline, right next to the quality gate - the pack's author clearly believes you should verify before you ship, and this node is that verification for the geometry half of the job. The three outputs are designed to be actionable:
structure_delta_json- the full breakdown of landmark displacement by region (eyes, nose, mouth, jaw, brows…), per group, vs. the threshold.groups_above_threshold- an integer count: how many feature groups actually moved enough to count as changed.automatic_support_only- a boolean flag for a specific workflow contract: whether the edit should be treated as support-only (i.e., you should keep the source structure and let only detail change).
How it works
It takes two landmark sets - source_landmarks and result_landmarks - plus source_face_index / result_face_index to pick the face in each (default 0). The advisory_threshold (default 0.06) is the per-group displacement cutoff in normalized landmark space; anything below it is considered "no real change" for that group. Below the surface there's also a normal_photo_geometry_gate - a sanity check on both face sets (normal photo, plausible anatomy, no duplicate-face boundary) that runs first and, if it fails, stops the downstream identity evaluation and tells you the geometry is too broken to audit meaningfully. If you're feeding it wildly different images with no shared face, it won't pretend to compare them.
Inputs and outputs that matter
source_landmarks/result_landmarks- bothFACE_LANDMARKS, from the same detection chain used elsewhere in the workflow. Wire them from the pre-edit and post-edit images.advisory_threshold- lower it if you care about subtle structure changes (jawline nudges), raise it if you only care about gross differences. It's advisory, not a hard gate.
The interesting output is groups_above_threshold. In a loop or a batch you can use it as a switch: "did enough of the face change? if not, re-roll." That's a genuinely useful automation hook that most packs don't bother to give you.
Install
ComfyUI Manager → search "Region Edit Toolkit" (package ID native-region-tile-planner-merge) → install → restart. Or git clone https://github.com/Liu-Bot24/ComfyUI-Region-Edit-Toolkit.git into custom_nodes, pip install -r requirements.txt into ComfyUI's Python, restart. Python 3.10+, deps numpy/Pillow/scipy/argostranslate, no models.
Gotchas
It's an audit node, not an edit node - don't expect it to change pixels, it returns numbers and JSON. And it needs corresponding faces: if the edit was so aggressive the detector sees a different face (or two), the geometry gate fails and you get automatic_support_only semantics rather than a comparison. That's by design - a "different person" result isn't comparable landmark-to-landmark. If your identity goal is "different person," this node is telling you the honest thing: structural comparison is only meaningful when the face stayed recognizably the same face.
Inputs (5)
| Name | Type | Default | Description |
|---|---|---|---|
| source_landmarks | FACE_LANDMARKS | — | |
| result_landmarks | FACE_LANDMARKS | — | |
| source_face_index | INT | 00–15 | — |
| result_face_index | INT | 00–15 | — |
| advisory_threshold | FLOAT | 0.060.01–0.5 | — |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| structure_delta_json | STRING | — |
| groups_above_threshold | INT | — |
| automatic_support_only | BOOLEAN | — |