Nodes/Dream Painter/πŸ”Ž Bitmap Edge Detect
ComfyUI Node

πŸ”Ž Bitmap Edge Detect

Turn a filled shape into an outline, cheap

By alt-key-projectΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 2
πŸ”Ž Bitmap Edge Detect
  • BITMAP
  • BITMAP

Filled shapes are the easy part of Dream Painter. Outlines are the part that gets you a nice controlnet guide. Bitmap Edge Detect takes a filled bitmap - say a solid rectangle or a blob - and hands back just the boundary, as a one-bit outline you can feed into ControlNet's lineart or canny slot without ever leaving the pack.

Why bother? A filled guide tells the model "content lives in this whole region." An outline tells it "there's a boundary right here," which reads as a much tighter constraint. It's the difference between "a shape is vaguely here" and "a crisp edge runs exactly along this path." For geometric compositions that's often exactly the structure you want to preserve, and the pack's own butterfly example uses edge detection as part of the pipeline.

How it works

No neural net under the hood - this is Pillow's FIND_EDGES filter applied to the bitmap, then re-quantized back to mode "1". FIND_EDGES is a simple convolution-based edge detector: where the local pixel values change sharply, you get a bright response; flat regions go dark. Thresholding that back to pure black/white gives you a clean outline.

The author is honest about the limits, and the README says as much: this is a "basic" detector that "should work well in most cases," and if you need more control you can convert your bitmap to a regular image and use any of ComfyUI's richer edge preprocessors (Canny, lineart, and friends, per the ControlNet ecosystem). This node is the fast, dependency-free option that stays inside the bitmap world.

Inputs and outputs

One input:

  • BITMAP - the bitmap to outline.

One output:

  • BITMAP - the edge map, still one-bit. Route it through Bitmap To Image & Mask (in the convert category) to get an IMAGE you can plug into a ControlNet loader.

Installing

In the Dream Painter pack (comfyui-dream-painter, alt-key-project). ComfyUI Manager β†’ Install Custom Nodes β†’ search Dream Painter β†’ install β†’ restart. Or:

cd ComfyUI/custom_nodes
git clone https://github.com/alt-key-project/comfyui-dream-painter
cd comfyui-dream-painter
pip install -r requirements.txt

No models, no downloads, no extra detectors to fetch.

Common issues

The main gotcha is expectation setting: this is a crude detector on an already-quantized image, so the outlines can be chunky or slightly jaggy compared to a proper lineart model. If your ControlNet is fighting your outline, that's usually the culprit - either feed it through a real edge preprocessor or lean on thicker shapes so the boundary survives thresholding. Also check the polarity after converting to image: if the guide comes out inverted against what your ControlNet expects, Bitmap Invert is one node away.

CategoryπŸ–Œ DPaint/β–© bitmap

Inputs (1)

NameTypeDefaultDescription
BITMAPBITMAPβ€”

Outputs (1)

NameTypeDescription
BITMAPBITMAPβ€”