Nodes/RES4LYF/ClownGuide_Style_EdgeWidth
ComfyUI Node Runs on cloud

ClownGuide_Style_EdgeWidth

Soften scattersort seams with an edge mask

By ClownsharkBatwing·Created 2 years ago·Updated 18 days ago· 1,222
ClownGuide_Style_EdgeWidth
  • guides
  • guides
edge_width20

This is a one-job helper node, and its own description says it plainly: it sets an edge mask for some style guide types such as scattersort, and it can help mitigate seams. If you've used scattersort style transfer and noticed hard lines where regions meet - a visible boundary between the styled area and the rest - this is the node that feathers that edge.

Some background on why seams happen. Scattersort is the author's own style-transfer mode, built to keep zero-shot faceswaps and style transfers from dragging color and lighting out of the source image. It works by rearranging feature statistics in a way that's more surgical than plain normalization - which is great for fidelity but can leave abrupt transitions at region edges. EdgeWidth gives those edges a controlled width to blend across.

How it works

It's a modifier in the guide chain, not a guide itself. It takes an existing GUIDES bundle, tags it with an edge-mask width, and passes the enriched GUIDES along. When a downstream scattersort-style guide runs, it uses that edge width to soften the transition zone instead of cutting sharply. Wider edge, gentler blend; narrower edge, crisper but more prone to a visible seam.

The inputs and output that matter

There's exactly one control, which is refreshing:

  • edge_width (INT, default 20) - the width, in latent units, of the edge-blend zone. Turn it up if seams are still visible; turn it down if the blend is eating too much of your styled region and softening detail you wanted to keep.
  • guides (GUIDES, optional) - the incoming guide chain to modify.

Output is a single guides (GUIDES) bundle, which continues to the next guide node or into the sampler.

How to install it

ComfyUI Manager: search RES4LYF, install, restart. Manual: cd ComfyUI/custom_nodes && git clone https://github.com/ClownsharkBatwing/RES4LYF/, pip install -r requirements.txt in your venv (portable ComfyUI: embedded python's pip), restart, hard-refresh with F5. For the nested sampler menu, add rgthree-comfy with "Auto Nest Subdirectories" on.

Common issues

The main thing to get right is placement in the chain. This node only affects style guides that actually use an edge mask - scattersort and its relatives - so it has to sit in the same GUIDES chain as one of those, feeding the sampler together. Drop it next to an AdaIN or mean guide that doesn't use edge masking and it'll quietly do nothing.

It's also a fine-tuning node, not a rescue. If your scattersort result is bad in ways beyond the seam - wrong style strength, contaminated color - EdgeWidth won't help; fix the style guide itself first, then come back and feather the edge. And there's a tradeoff to accept: a wider edge blends the seam away but also bleeds a little more of the surrounding area into your styled region, so very high values can undermine the whole reason you were masking. Nudge it until the seam disappears and stop there. Keep the seed fixed while you tune so you're judging the edge, not a new roll.

CategoryRES4LYF/sampler_extensions

Inputs (2)

NameTypeDefaultDescription
edge_widthINT201–10000
guidesoptGUIDES

Outputs (1)

NameTypeDescription
guidesGUIDES