LayerStyle: Stroke V2
Stroke V2 — a Photoshop-style outline, now with the full blend list
- background_image
- layer_image
- layer_mask
- image
Sticker look: a subject with a clean colored line traced around its edge. That's Photoshop's Stroke layer style, and this node is the ComfyUI version of it. Hand it a background, a foreground layer, and a mask of the subject, and it draws an outline that hugs the actual silhouette - not a bounding box - then composites the result into one image.
Reach for it whenever something needs to read as "cut out on purpose": product stickers, comic-panel emphasis, a figure popping off a caption card, meme-style callouts. This is V2, the pack's current revision of Stroke, and the one worth using over the older node unless you're maintaining a workflow that specifically pins the original.
How it works
The mask is the shape. The node grows or shrinks that shape by stroke_width (with stroke_grow for fine adjustment), fills the resulting ring with stroke_color, optionally softens the edge with blur, and blends the outlined layer onto the background at your chosen opacity and blend mode. Because it shares the pack's compositing core, this isn't a flat paste - you get a real blend-mode dropdown, and V2 specifically is the revision that carries the full 30-mode Photoshop blend list (normal, dissolve, darken, multiply, color burn, linear burn, and on), where the original Stroke worked off a shorter, homemade set. If you care about matching a specific Photoshop blend behavior, V2 is where that lives.
The inputs and outputs that matter
stroke_color(hex, default#FF0000) andstroke_width(pixels, default 8) - the two you'll always touch. The loud red default is deliberate: confirm placement first, then swap in your real color.stroke_grow- pushes the outline outward (positive) or inward, biting into the subject (negative), relative to the mask edge.blur- softens a hard line into something closer to a glow. Leave at 0 for a crisp sticker edge.invert_mask(default true) - the one that trips people up. If the stroke wraps the background instead of the subject, flip it.background_image,layer_image, and optionallayer_mask- your two images plus the shape to trace.opacityandblend_mode(30 options) control how the finished layer sits on the background.
Output is a single composited image, ready to save or feed into the next step.
How to install it
It ships inside the ComfyUI Layer Style pack, not on its own. Easiest path is ComfyUI Manager: search ComfyUI Layer Style (or just LayerStyle), install, restart. Manual route:
cd ComfyUI/custom_nodes
git clone https://github.com/chflame163/ComfyUI_LayerStyle
pip install -r ComfyUI_LayerStyle/requirements.txt
then restart. You'll find it under 😺dzNodes → LayerStyle. Nothing to download for this node specifically - it's pure compositing math, no models involved.
Common issues & troubleshooting
The outline is on the wrong side. Nine times out of ten it's invert_mask. LayerStyle's mask polarity doesn't always match what an upstream node (a detector, a rembg node, a hand-painted mask) hands you, so toggle it and re-run rather than assume the mask itself is broken.
Nothing's visible. Check stroke_width isn't 0 and opacity hasn't been dragged down. A stroke color that happens to match the subject will also hide in plain sight - part of why the default is a loud, unmissable red.
The whole node is missing from your palette. That's the pack failing to import, not Stroke specifically. LayerStyle pulls in a long dependency chain, and one broken library - transformers paired with a stray TensorFlow install is the classic offender - takes down every LayerStyle and LayerUtility node at once. It's especially common on an old, pre-split install (the pack used to ship combined with LayerStyle Advance); delete and reinstall clean, or hit "Try Fix" in Manager and read what it actually failed on.
Blocky-looking stroke on a small subject. Nudge blur up slightly, or clean up the mask's edges a step earlier in the graph - Stroke V2 traces whatever silhouette it's handed, jagged mask in, jagged stroke out.
Inputs (10)
| Name | Type | Default | Description |
|---|---|---|---|
| background_image | IMAGE | — | |
| layer_image | IMAGE | — | |
| invert_mask | BOOLEAN | true | — |
| blend_mode | COMBO | 30 options: normal, dissolve, darken, multiply, color burn, linear burn, +24 | |
| opacity | INT | 1000–100 | — |
| stroke_grow | INT | 0-999–999 | — |
| stroke_width | INT | 80–999 | — |
| blur | INT | 00–100 | — |
| stroke_color | STRING | #FF0000 | — |
| layer_maskopt | MASK | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |