Nodes/Region Edit Toolkit/图像分区 · 四边羽化
ComfyUI Node

图像分区 · 四边羽化

A feathering tool that actually respects the edge of your crop

By Liu-Bot24·Created 2 months ago·Updated about a month ago· 1
图像分区 · 四边羽化
  • local_mask
  • original_image
  • feathered_alpha
  • four_side_ramp
  • report_json
x
y
width
height
use_orientation_defaultstrue
top_feather_percent10.0
bottom_feather_percent10.0
left_feather_percent5.0
right_feather_percent5.0
feather_at_original_image_boundaryfalse

Every local-edit workflow ends the same way: you've regenerated a region, and now you have to blend the seam so the edit doesn't announce itself with a hard line. The obvious move is a blur or a feather, and the obvious mistake is feathering blindly - because a crop that sits on the actual image boundary cannot be feathered on that side without pulling a fake gradient in from nothing. RegionEditBoundaryFeather4Side is the node in the Region Edit Toolkit that feathers your mask with that geometry in mind.

It's a crop-perimeter feather: instead of one global feather width, you get independent control over all four sides, and it knows where the crop sits in the original image. If your crop touches the image edge, that side's feather is zeroed by default - no invented edge. That single behavior is what makes it the right tool for compositing cropped edits back into full frames rather than the generic blur nodes you'd otherwise reach for.

How it works

You feed it the local mask plus the original image and the crop's x, y, width, height. It builds a ramp per side - 0 at the crop perimeter up to 1 a few pixels in - and combines them into a single 2D alpha with a min() across all four ramps. The mask is multiplied by that alpha, so the effect is a feathered falloff that hugs the entire perimeter of the crop, not just one edge.

The clever part is use_orientation_defaults. With it on (the default), you don't tune four numbers at all: portrait crops get 10% on top/bottom and 5% left/right, landscape gets the reverse (10% on the long sides), and square gets 10% everywhere. Turn it off and your four *_feather_percent values are used literally - each up to 30%. The node reports both what you entered and what it actually used in report_json, so you can always see which interpretation it chose.

Inputs that matter

  • local_mask - must be exactly width × height, single batch. Mismatched dimensions throw.
  • original_image + x/y/width/height - the crop's position in the full image. These must be a real, in-bounds crop; the node validates.
  • use_orientation_defaults - leave on unless you have a specific side to protect (say, a garment edge that must stay crisp at the bottom while the top fades).
  • feather_at_original_image_boundary - the escape hatch. Off by default (sides at the image edge stay unfeathered); flip it on if you genuinely want the feather to run off the image edge.

Outputs

feathered_alpha is the mask you composite with. four_side_ramp is the raw ramp before the mask is multiplied in - useful if you want to inspect or reuse the geometry. report_json tells you the effective percentages and pixel widths per side.

Install

Same as every node in this pack: ComfyUI Manager → search "Region Edit Toolkit" (package ID native-region-tile-planner-merge) → install → restart. Or clone https://github.com/Liu-Bot24/ComfyUI-Region-Edit-Toolkit.git into custom_nodes and pip install -r requirements.txt into ComfyUI's Python environment. Python 3.10+; deps are numpy, Pillow, scipy, argostranslate. No models to download - this is pure math on tensors.

Gotchas

Because it's a perimeter feather with a hard zero at the crop edge, it's easy to misjudge the pixel widths: 10% of a 3000px crop is 300px of fade, which is a lot. Start small. And remember the boundary-zeroing default - if your crop is flush against the image edge and you're wondering why one side has no feather, that's the feature, not a bug. Wire this between your edit pass and the strict composite node and the seam work mostly disappears.

CategoryRegion Edit Toolkit/Mask

Inputs (12)

NameTypeDefaultDescription
local_maskMASK
original_imageIMAGE
xINT
yINT
widthINT
heightINT
use_orientation_defaultsBOOLEANtrue
top_feather_percentFLOAT10.00–30
bottom_feather_percentFLOAT10.00–30
left_feather_percentFLOAT5.00–30
right_feather_percentFLOAT5.00–30
feather_at_original_image_boundaryBOOLEANfalse

Outputs (3)

NameTypeDescription
feathered_alphaMASK
four_side_rampMASK
report_jsonSTRING