Nodes/ComfyUI-HakuImg/OutlineExpansion
ComfyUI Node

OutlineExpansion

PixelOE's edge-thickening step, on its own

By licyk·Created 2 years ago·Updated about a year ago· 14
OutlineExpansion
  • img
  • oe_image
  • oe_weight
pixel_size4
thickness3
device

If you've read the PixelOE article on this pack, you already understand half of this node: PixelOE turns a photo into pixel art by first expanding contrast-driven outlines, then downscaling with that outline data as a guide so edges stay crisp instead of blurring away. OutlineExpansion is that first step, by itself, with no downscale attached. You get a full-resolution image with thickened, ink-like outlines - a graphic, cel-shaded look - without shrinking anything into blocky pixel-art squares.

Reach for it when you want the outline-strengthening effect on its own (a comic/cel-shaded style pass), or when you want to feed the outline weight map into your own custom downscale-and-quantize chain instead of using PixelOE's built-in one.

The inputs and outputs that matter

  • img - your source image.
  • pixel_size (1–32, default 4) - even without downscaling, this controls the scale the outline-expansion algorithm operates at internally; it's the same parameter PixelOE exposes, and matching it between the two nodes matters if you're planning to feed this into a matching downscale step yourself.
  • thickness (1–6, default 3) - how aggressively outlines get expanded. Higher values, bolder, more cartoon-like lines.
  • device - default / cpu / cuda / mps.

Two outputs: oe_image is the full-resolution image with outlines expanded - the thing you actually want if you're after the standalone graphic look. oe_weight is the map the algorithm used to decide where to expand, which you'd only wire somewhere if you're building a custom downstream pixelization or masking step.

How to install it

Search ComfyUI-HakuImg in ComfyUI Manager, or:

cd ComfyUI/custom_nodes
git clone --recurse-submodules https://github.com/licyk/ComfyUI-HakuImg

Restart ComfyUI, find it under Image → HakuImg.

Common issues & troubleshooting

Only this node, PixelOE, and PreResize are missing after install. They all lean on the same underlying algorithm, which the README ships as a git submodule - that's exactly why the install command is git clone --recurse-submodules, not a plain clone. If these three specifically are gone from the node menu while the rest of the pack is fine, check ComfyUI's startup console for an import error and re-clone with the flag.

Expected a finished pixel-art image, got a full-resolution outlined photo instead. That's correct - this node stops after the outline-expansion step and never downscales. If you want the complete pixel-art conversion in one node, use PixelOE directly; it does outline expansion and the downscale/quantize/dither pipeline after it. Use this node instead only when you specifically want the outline effect without shrinking the image, or you're assembling your own custom pipeline around oe_weight.

Effect looks too subtle or too heavy. thickness is the dial that matters most here - it has a narrower range (1–6) than PixelOE's own thickness field, so small changes have a bigger visible impact. Move it one step at a time.

Categoryimage/HakuImg

Inputs (4)

NameTypeDefaultDescription
imgIMAGE
pixel_sizeINT41–32
thicknessINT31–6
deviceCOMBO4 options: default, cpu, cuda, mps

Outputs (2)

NameTypeDescription
oe_imageIMAGE
oe_weightIMAGE