

Interactive rectangle tools for ComfyUI.
Includes an interactive Rect / Select (marching-ants popup) plus Rect / Crop, Rect / Mask, and Rect / Fill.
Outputs a reusable RECT object ({x,y,w,h}) and the four scalar values for compatibility with existing nodes.
Load this workflow:
x/y/w/h intsComfyUI-Rect into:“`
ComfyUI/custom_nodes/
“`
If the “Open Rect / Select” button doesn’t appear, it’s almost always cache—use
?nocache=1.
Inputs
image: IMAGE (required)Outputs
rect: RECT (object with x,y,w,h)x: INT, y: INT, w: INT, h: INTUI
image: IMAGE, rect: RECTimage: IMAGE (cropped)image: IMAGE, rect: RECTfeather (px), invert, combine (replace/union/intersect/subtract/multiply)existing_mask: MASKmask: MASK (0..1)image: IMAGE, rect: RECTr,g,b (0–255), opacity (0..1)fill or outline, thickness (outline), featherimage: IMAGE (blended)rect to:A simple JSON-like object:
{"x": 100, "y": 80, "w": 256, "h": 256}
All coordinates are in image pixel space. Values are clamped to the image bounds for safety.
?nocache=1.image input is connected.ComfyUI/custom_nodes/ComfyUI-Rect/ and restart ComfyUI.MIT