ComfyUI Node
BD Draw Rect
Draw a rectangle shape — or use any existing mask — for color compositing and/or packed-channel injection. Shape priority: 1. mask input — any ComfyUI mask (skips geometry) 2. mask_from_packed — extract one R/G/B/A channel from packed_image 3. geometry — x_center / y_center / rect_width / rect_height / corner_radius Feather: positive = outward from edge (interior stays 1.0), negative = inward, 0 = hard edge. pack_channel writes the final mask into a specific channel of packed_image.
BD Draw Rect
- mask
- image
- packed_image
- image
- mask
- packed_out
◄mask_from_packednone►
◄pack_channelnone►
◄x_center0.500►
◄y_center0.500►
◄rect_width0.200►
◄rect_height0.100►
◄corner_radius0►
◄feather0►
◄fill_r128►
◄fill_g128►
◄fill_b128►
◄opacity1.00►
◄canvas_width512►
◄canvas_height512►
Category🧠BrainDead/Segmentation
Inputs (17)
| Name | Type | Default | Description |
|---|---|---|---|
| mask_from_packed | COMBO | none | Extract a channel from packed_image and use it as the shape mask. Ignored when mask is connected. none = fall through to geometry. |
| pack_channel | COMBO | none | Write the final feathered mask into this channel of packed_image. none = pass packed_image through unchanged. R/G/B = overwrite that colour channel. A = overwrite alpha (appended if image has no alpha). |
| x_center | FLOAT | 0.5000–1 | Horizontal center (0=left, 1=right). Ignored when mask is connected. |
| y_center | FLOAT | 0.5000–1 | Vertical center (0=top, 1=bottom). |
| rect_width | FLOAT | 0.2000–2 | Width as fraction of image width. >1.0 extends beyond the edge. |
| rect_height | FLOAT | 0.1000–2 | Height as fraction of image height. |
| corner_radius | INT | 00–400 | Rounded corner radius in pixels. 0 = sharp corners. Clamped to half the shortest side. |
| feather | INT | 0-200–200 | Edge feather in pixels (applied to any shape source). Positive: expands OUTWARD — interior stays fully opaque. Negative: bleeds INWARD — fill fades toward its edge. 0 = hard binary edge. |
| fill_r | INT | 1280–255 | Fill red. Default 128 = mid-grey. |
| fill_g | INT | 1280–255 | Fill green. |
| fill_b | INT | 1280–255 | Fill blue. |
| opacity | FLOAT | 1.000–1 | Blend strength over the base image. 1.0 = fully opaque. |
| maskopt | MASK | Shape mask. When connected, skips rect geometry and uses this mask directly (feather still applies). Priority: mask > mask_from_packed > geometry. | |
| imageopt | IMAGE | Base image to composite onto. If not connected, a blank canvas (canvas_width × canvas_height) is used. | |
| packed_imageopt | IMAGE | Existing packed RGBA image. pack_channel: write the final mask into this channel. mask_from_packed: extract a channel as the shape source. Typical use: u_image3 RGBA pack for skin_shader.glsl. | |
| canvas_widthopt | INT | 5121–8192 | Canvas width when no image is connected. |
| canvas_heightopt | INT | 5121–8192 | Canvas height when no image is connected. |
Outputs (3)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | Shape composited over image (or blank canvas). |
| mask | MASK | Final feathered shape mask (1.0 inside, 0.0 outside). |
| packed_out | IMAGE | packed_image with mask written into pack_channel. Pass-through (or blank) when pack_channel='none'. |