Nodes/Dream Painter/πŸ”ƒ Shape Flip
ComfyUI Node

πŸ”ƒ Shape Flip

Mirror a shape without touching pixels

By alt-key-projectΒ·Created 2 years agoΒ·Updated 2 years agoΒ· 2
πŸ”ƒ Shape Flip
  • SHAPE
  • SHAPE
β—„directionβ–Ύβ–Ί

Symmetry is one of the cheapest ways to make a composition look intentional, and Shape Flip is how you get it in Dream Painter without ever touching a bitmap. It takes a vector shape and mirrors it - horizontally or vertically - around its own center, and hands back the flipped shape for the rest of the shape pipeline to use.

The pack's butterfly example is built around exactly this move: generate one half of a motif, flip it, and combine both halves into a symmetric whole. Because the flip happens in vector space, before rendering, the result stays crisp and resolution-independent - flip a bitmap and you're resampling pixels; flip a shape and you're just negating coordinates.

How it works

A shape is a list of points in normalized space. Flipping horizontally mirrors every point across the shape's vertical centerline (each x becomes center_x + (center_x - x)); flipping vertically does the same across the horizontal centerline. The flip is around the shape's own center, so the shape stays put - it rotates in place rather than jumping across the canvas.

The direction input is the only thing you set:

  • horizontal - mirror left-right.
  • vertical - mirror top-bottom.

Both flip around the same center, so a shape that's off-center stays off-center, just mirrored. If you want the mirrored copy to sit next to the original, you'll translate it afterward - flip doesn't move anything.

Inputs and outputs

  • SHAPE - the shape to mirror.
  • direction - horizontal or vertical.

Output:

  • SHAPE - the flipped shape.

Installing

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

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.

Common issues

The direction naming occasionally trips people up: "horizontal" flip mirrors left-right, it doesn't lay the shape out horizontally. And since the flip is around the shape's own center, the flipped result overlaps the original exactly - if you were expecting the classic mirrored-pair look (original left, mirror right), you need to translate one copy after flipping, or combine the flipped and unflipped shapes and let Shape Center & Fit re-frame them. For a true two-sided composition, the pattern is: generate β†’ flip β†’ Shape Combiner β†’ render.

CategoryπŸ–Œ DPaint/β–’ shape

Inputs (2)

NameTypeDefaultDescription
SHAPESHAPEβ€”
directionCOMBO2 options: vertical, horizontal

Outputs (1)

NameTypeDescription
SHAPESHAPEβ€”