RC Stroke
An outline around anything
- image
- IMAGE
Text and stickers look unfinished without an outline, and in ComfyUI "draw a border around this" used to mean three or four nodes of mask extraction and dilation held together by hope. RC_Stroke is the pack's Photoshop-style layer effect: a proper stroke with inside/outside/center positioning, a color picker, blend mode, and auto canvas expansion so outside strokes don't get clipped. It's the sibling of Outer Glow and Drop Shadow in the RC Image Compositor pack, under RC/Layer Effects.
How it works
Same layer-style engine as the glow node, pointed the other direction: it reads the image's alpha as a mask, expands it by the stroke width using morphological dilation, and paints the stroke color around the shape's edge. The position control decides where:
- outside - the stroke rings the shape's outer edge. With
auto_expand_canvason, the canvas grows to fit it. - inside - the stroke eats into the shape itself. Shape keeps its original footprint; the border is on the interior.
- center - straddles the edge, half in, half out.
The controls you'll actually set:
- size (0–50 px) - stroke width.
- position - above.
- color_r / color_g / color_b - stroke color, 0–255.
- opacity (0–1) - stroke strength.
- blend_mode -
normal, plusmultiply,screen,overlay, andcolor_burnfor matching the stroke to the background's lighting. - fill_opacity - again the fun one: original image's opacity. 1.0 = normal, 0.0 = hollow outline only (the sticker becomes just its border), 0.5 = ghosted content plus stroke.
- auto_expand_canvas - grows the output for outside/center strokes.
Output is a single IMAGE, potentially larger than the input when expansion kicks in.
Installing it
ComfyUI Manager → search "RC Image Compositor" → install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kj863257/ComfyUI_RC_Image_Compositor
cd ComfyUI_RC_Image_Compositor
pip install -r requirements.txt
Dependencies: pillow, numpy, opencv-python. Nothing to download.
Where people get burned
- Canvas expansion changes your dimensions. An outside stroke grows the canvas by 2× size on each relevant axis. If a downstream node expects the original size, that's the cause - disable auto-expand or composite after.
centerstrokes bleed over the alpha edge. Because the border straddles the boundary, the stroke inherits the shape's own semi-transparent edges. A clean alpha makes a clean center stroke; a rough one looks muddy.- Outside stroke on a non-transparent image is nearly invisible. Stroke outlines the alpha boundary. A full-frame RGB image has no boundary to outline, so the stroke hugs the image edge and you'll wonder where it went. Cut the shape out first (RC MaskApply / LoadImageWithAlpha) and then stroke it.
fill_opacity0 gives you the outline look you probably want for stickers. If your goal was a bordered decal, 0.0 + a stroke is the whole recipe.
Strokes are one of those effects that seems trivial until you need it twice a week. RC Stroke makes it a single node with the exact knobs Photoshop users expect - and the hollow-outline mode is worth the install by itself.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| size | FLOAT | 3.00–50 | Stroke width in pixels |
| position | COMBO | outside | Stroke position relative to shape |
| opacity | FLOAT | 1.000–1 | Stroke opacity |
| color_r | INT | 00–255 | Stroke color red component (0-255) |
| color_g | INT | 00–255 | Stroke color green component (0-255) |
| color_b | INT | 00–255 | Stroke color blue component (0-255) |
| blend_mode | COMBO | normal | Stroke blend mode: - normal: Normal blending, direct overlay - multiply: Multiply, darkens colors - screen: Screen, lightens colors - overlay: Overlay, enhances contrast - color_burn: Color burn, deeper shadows |
| fill_opacity | FLOAT | 1.000–1 | Original image fill opacity: - 1.0: Normal image display - 0.0: Hollow effect, stroke only - 0.5: Semi-transparent image + stroke |
| auto_expand_canvas | BOOLEAN | true | Auto expand canvas: - True: Auto expand canvas when stroke exceeds bounds - False: Stroke is clipped to original canvas size |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |