Abstract Image Filled Shapes Layer
Rectangles, ellipses, triangles, polygons — the shape layer that hands img2img a skeleton
- image
- IMAGE
If the Background node is the canvas, Abstract Image Filled Shapes is the first thing you throw at it. It paints a layer of rectangles, ellipses, triangles, and polygons over whatever image you feed in, then composites that layer onto the base with your choice of blend mode. Wire it up the intended way - Background → this node → VAE Encode → KSampler at 0.8–0.9 denoise - and those abstract blocks become the composition the diffusion model has to work inside. You get layout control without ControlNet: the geometry is yours, the texture and subject are the checkpoint's.
A nice touch buried in the source: about one in four shapes gets drawn as an outline instead of a filled form. That alone breaks up the "clip art collage" look and gives the model hard edges to work with, which img2img loves.
The inputs that matter
There are a lot of knobs, but a beginner mostly touches these:
- num_layers - how many stacked shape sub-layers to add (1–10). Each layer gets its own randomness, so more layers means more depth and overlap.
- shapes_per_layer - how many shapes per layer (up to 100). This is your density control; crank it for a busy abstract base, keep it low for a sparse one.
- alpha - 0 to 255, opacity of the shapes. Start near 200–255 and drop it when you want the background color to show through.
- blend_mode - 12 options: normal, multiply, screen, overlay, add, subtract, difference, darken, lighten, color_dodge, color_burn, hard_light.
screenandmultiplyare the two you'll actually use most;addis great for glow-like bases.
max_shape_size caps how big a single shape can get (10–1024). shape_position restricts everything to a quadrant or the center if you want a deliberate focal point rather than full-bleed shapes. randomize delegates all of that to the seed - perfect for gacha-style sketching, useless when you're art-directing.
How it works
The node takes your input IMAGE tensor, converts it to a transparent RGBA layer, and draws shapes with PIL's ImageDraw - each shape gets its own derived RNG from the layer seed, so the whole thing is reproducible. Then it picks a color via the filled_shape_color_mode (random RGB, or a hex from filled_shape_hex when mode is hex, or one of the named colors), composites through one of the NumPy blend functions, and returns the result. If feather_layer is on, the layer's alpha channel gets a Gaussian blur using feather_sigma_min/max before compositing - that's the "soft spray paint" look that keeps hard-edged shapes from feeling pasted on.
All the layer nodes in this pack follow the same pattern, which makes them trivial to chain: each takes an image in and puts an IMAGE out, so you can stack Filled Shapes under Lines over a Pattern and the composition compounds.
Install
This is part of the AbstractImaGen pack. Easiest: ComfyUI Manager → search AbstractImaGen → install → restart and refresh. Or:
cd ComfyUI/custom_nodes
git clone https://github.com/wakattac/ComfyUI-AbstractImaGen
Dependencies are Pillow, numpy, scipy, and torch - all things ComfyUI already has. No models to fetch, nothing to configure. Restart after cloning and you'll find it under AbstractImage/Layers.
Gotchas
- The layer nodes operate on a single image frame, not a batch - don't try to feed it a video tensor and expect it to process every frame.
filled_shape_hexonly applies whenfilled_shape_color_modeis set tohex. Handing it a hex while the mode saysrandomquietly does nothing.- Changing the seed changes every sub-layer at once. If you want to vary just the colors, that's what the color mode is for - or step up to the pack's V1 generator node, which exposes per-component salts for exactly this kind of targeted tweak.
Inputs (14)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| seed | INT | 00–18446744073709550000 | Seed for shapes randomness. |
| randomize | BOOLEAN | false | If true, randomize shapes per layer, colors, size, position, and blend mode using the seed. |
| num_layers | INT | 11–10 | Number of shape layers to add. |
| shapes_per_layer | INT | 101–100 | Number of shapes to draw per layer. |
| max_shape_size | INT | 25610–1024 | Maximum size (width or height) of a single shape. |
| filled_shape_color_mode | COMBO | random | Color selection mode for filled shapes. 'random' uses implicit RGB. |
| filled_shape_hex | STRING | Hex code for filled shapes color (used if Filled Shape Color Mode is 'hex'). | |
| alpha | INT | 2550–255 | Alpha (transparency) for shapes (0 is fully transparent, 255 is fully opaque). |
| shape_position | COMBO | full | Restrict shapes to a specific position/quadrant. |
| blend_mode | COMBO | normal | Blending mode to composite the shapes layer onto the base image. |
| feather_layer | BOOLEAN | false | Apply Gaussian blur to the alpha channel of the shapes layer. |
| feather_sigma_min | FLOAT | 1.00–20 | Minimum sigma for feathering (if applied). |
| feather_sigma_max | FLOAT | 6.00–20 | Maximum sigma for feathering (if applied). |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |