Alpha Edge Solidify -> RGB
Solidify alpha-cutout textures in ComfyUI
- image
- mask
- image
If you've ever made a grass or foliage texture for a game, you know the pain: the RGB data hiding in the transparent parts of an alpha-cutout texture comes back to haunt you as a bright fringe around every leaf edge. That's the edge halo, and this node exists to make it go away.
Alpha Edge Solidify (AlphaEdgeSolidify, displayed as "Alpha Edge Solidify -> RGB") is a single-purpose utility from the comfyui-texture-packer pack by zisb. It takes an RGBA-style asset - a solid-color image plus its alpha mask - and bleeds the visible edge colors outward into the transparent region, producing a fully solid RGB texture with no alpha left over. In game-art terms that's the classic "alpha bleed" / "solidify" pass you'd otherwise run in Photoshop or Substance Painter, except now it's a node sitting in your ComfyUI graph.
Why does this matter? Because game engines are unkind to cutout textures. The transparent areas of a foliage, grass, or decal texture aren't empty - they hold arbitrary RGB data that leaks out three ways: edge halos (light or dark fringes around cutouts), mipmap bleeding (that garbage color smearing into visible pixels as the mip chain kicks in at distance), and atlas contamination (one texture's transparent junk bleeding over its neighbor's border). Solidify the alpha - fill the transparent region with sensible edge colors - and all three stop being a problem before the engine ever sees the asset.
How it works
Mechanically it's simple, and there's no hidden magic. The whole pack is a tiny, dependency-free repo running on plain PyTorch, which ComfyUI already ships with. Here's the pipeline:
- Your
maskis thresholded (default 0.5) into a binary inside/outside map. - The node then runs iterative dilation. Each pass finds pixels that are still empty but touch a filled pixel, and colors them with the average of their filled neighbors.
bleed_pixelssets how many passes to run - and it bails out early if there's nothing left to fill, so you can't really over-shoot with a big number. kernel_size(3, 5, or 7) sets how wide a neighborhood each fill pass averages over. 3 is the default and usually right.modeflips betweenbasic- a uniform neighbor average, fast - andsmooth, which weights closer neighbors more heavily.smoothearns its keep when you're bleeding a long way;basicis fine for most assets.
The output is a single image (IMAGE), fully opaque. Wire it to a Save Image node and export your finished texture.
The inputs that actually matter
image- your RGB texture, straight from Load Image.mask- the alpha. Load Image automatically splits an RGBA PNG's alpha into its MASK output.bleed_pixels(default 64, range 1–256) - how far to bleed. 64 is plenty for thin foliage; chunky decals may want more.mask_threshold(default 0.5) - where "inside" starts. It's your main lever on soft, anti-aliased edges.kernel_sizeandmode- leave them alone until results look wrong.
Installing it
Two ways, both painless. It's in ComfyUI Manager - search for "comfyui-texture-packer" (or "Alpha Edge") and hit install - or clone it by hand:
cd ComfyUI/custom_nodes
git clone https://github.com/zisb/comfyui-texture-packer
Restart ComfyUI and the node shows up under image/postprocessing. No models to download, no extra Python dependencies, no VRAM anxiety - this is about as light a pack as you'll find.
Where people get burned
The one gotcha worth memorizing is right in the node's own description, and it trips up nearly everyone on first run: ComfyUI auto-inverts masks from Load Image. The alpha you think you're feeding in is backwards - transparent becomes solid and solid becomes transparent - so your "solidified" texture comes out looking inverted and wrong. The fix is a single Invert Mask node between Load Image and this node's mask input. It's easy to miss because the image preview still looks like your texture; it's the mask that got flipped under you.
Second, watch the threshold on soft edges. A value of 0.5 swallows feathered, anti-aliased edges, so for a grass tuft with a soft fringe you may want to drop mask_threshold a bit to keep more of the edge inside. And if a long bleed comes out blocky or banded, that's exactly the case smooth mode was built for.
Honest caveat: this is a niche utility with a tiny audience - single-digit impressions on comfy.icu and essentially no community chatter. But it's small, clean, MIT-licensed, and does exactly one thing well. If you ship alpha-tested assets into Unity, Unreal, or Godot and would rather not open Photoshop for a three-step solidify pass, it's the one you reach for. If you never touch game textures, you'll never need it - and that's fine too.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| mask | MASK | — | |
| bleed_pixels | INT | 641–256 | — |
| mask_threshold | FLOAT | 0.500–1 | — |
| kernel_sizeopt | INT | 33–7 | — |
| modeopt | COMBO | 2 options: basic, smooth |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |