Nodes/Region Edit Toolkit/图像分区 · 受保护细节一致化
ComfyUI Node

图像分区 · 受保护细节一致化

When the edited face looks sharp but the untouched body suddenly reads as 'too crisp'

By Liu-Bot24·Created 2 months ago·Updated about a month ago· 1
图像分区 · 受保护细节一致化
  • image
  • protected_mask
  • detail_harmonized_image
  • protected_composite_region
  • report_json
enabledfalse
detail_radius1.00
outside_detail_retention0.80
strong_edge_protection0.90

Here's a subtle failure mode that will drive you mad if you've ever seen it: the regenerated face looks great, but the untouched rest of the image suddenly looks over-processed and rubbery next to it. What actually happened is a grain and microcontrast mismatch - the edited face came out of a generation pipeline with relatively smooth texture, and the untouched body retains full native-camera microdetail. Your eye reads the difference as "the body looks weird" when the body never changed at all. RegionEditProtectedDetailHarmonizer is the pack's fix: it gently attenuates the high-frequency detail outside the composite region so the whole frame sits at a consistent texture level, while leaving your protected areas alone.

The mechanism matters because it's the inverse of everything else in this pack. Instead of adding detail to the edited region, it subtracts a little microdetail from the unprotected region to bridge the gap. From the source: it only attenuates the high-frequency residual outside the final composite alpha, and it preserves fractional alpha values - so feather edges stay feathered instead of being flattened into hard cuts. There's even a built-in edge-protection ramp (the source sets an edge protection end near 0.12 alpha), so the seam itself doesn't get smeared while you're trying to blend it.

Inputs: image and protected_mask (what must not be touched), then four dials. The important ones for a beginner: enabled (default false - the node passes the image through untouched until you flip it, which is your safety switch for A/B testing) and detail_radius (default 1.0, range 0.25–4.0) which sets how many pixels count as "detail" - bigger radius blurs a broader band. outside_detail_retention (default 0.8) is how much original detail you keep - 1.0 keeps everything (i.e. does nothing), lower values smooth harder. strong_edge_protection (default 0.9) is how hard it holds the line at protected-region edges. The defaults are genuinely usable as a first pass: enable it, run, and nudge outside_detail_retention down toward 0.7 if the mismatch persists.

Outputs: detail_harmonized_image (wire this forward), protected_composite_region (a mask of exactly what was protected - handy for verifying you didn't touch the thing you said you'd protect), and report_json.

Where it fits: this is a finishing node, the last pass before final output - the source file categorizes it as "final output" stage. It's the companion to RegionEditSkinMicrotextureSynthesis: that node restores skin texture inside the edit; this one reconciles the outside. Run the two together when the composite reads "two different photos."

Install: ComfyUI Manager → search Region Edit Toolkit (registry ID 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 actual Python, restart. Pure pixel math - no models, no GPU load.

The trap to avoid: don't crank outside_detail_retention all the way down thinking "more smoothing = better." You'll trade the texture mismatch for an obvious AI-plastic sheen on the whole frame. The point is a small consistent gap, not a smoothing pass. This pack is new enough that you won't find community tuning guides, but this node's job is narrow enough that the default settings plus a couple of runs will teach you more than any forum post would.

CategoryRegion Edit Toolkit/Color & Detail

Inputs (6)

NameTypeDefaultDescription
imageIMAGE
protected_maskMASK
enabledBOOLEANfalse
detail_radiusFLOAT1.000.25–4
outside_detail_retentionFLOAT0.800–1
strong_edge_protectionFLOAT0.900–1

Outputs (3)

NameTypeDescription
detail_harmonized_imageIMAGE
protected_composite_regionMASK
report_jsonSTRING