Abstract Image Lines/Zigzags Layer
Zigzags and gestural strokes that read as intentional, not messy
- image
- IMAGE
Abstract Image Lines/Zigzags Layer is the scribble node, in the best possible sense. It draws randomized lines and zigzag strokes onto whatever image you feed it and composites the result. For the img2img trick this pack is built around - abstract base → VAE Encode → sampler at high denoise - lines are the fastest way to inject a sense of motion and direction into a composition. A gradient background gives you color, filled shapes give you mass, and lines give you the gesture the diffusion model turns into implied structure: flowing hair, horizon edges, energy, movement.
The key thing that separates this from a random-scribble generator: the line widths are bounded and seed-controlled. line_width_min and line_width_max (both 1–100, defaults 5 and 30) set how heavy the strokes are, and everything is reproducible from the seed. Wide, few strokes read as deliberate brushwork; thin, many strokes read as fine linework. You're in charge of which.
Inputs worth knowing
- lines_per_layer - number of lines or zigzags drawn per layer (1–100). Your density control.
- line_width_min / line_width_max - stroke thickness range. Keep the range narrow when you want a consistent look.
- alpha - 0–255 opacity. Drop it when you want the lines to tint rather than dominate.
- blend_mode - same 12 options as the other layers (normal, multiply, screen, overlay, add, subtract, difference, darken, lighten, color_dodge, color_burn, hard_light).
overlayandscreengive nice light-drawing effects over darker bases.
num_layers stacks multiple line layers with independent randomness, shape_position confines the strokes to a quadrant or the center, and randomize hands all the choices to the seed. Color comes from line_zigzag_color_mode (random RGB, hex with line_zigzag_hex, or the named colors), exactly mirroring the filled shapes node.
How it works
Mechanically it's the same recipe as every layer in this pack: convert the input tensor to an RGBA layer, draw with PIL's ImageDraw using draw.line(..., joint='miter') so corners don't leave gaps, then composite via a NumPy blend function. Zigzags are just polylines with sharp turns - the miter joint is what keeps them from looking like a broken connection. Optional feather_layer blurs the layer's alpha with feather_sigma_min/max before compositing, which softens hard strokes into something closer to pastel or spray.
The node outputs a single IMAGE, chainable straight into the next layer, into Postprocessing, or into VAE Encode.
Install
Part of the AbstractImaGen pack. Via ComfyUI Manager, search AbstractImaGen and install, then restart and refresh. Manual install is the usual clone:
cd ComfyUI/custom_nodes
git clone https://github.com/wakattac/ComfyUI-AbstractImaGen
Dependencies are just Pillow, numpy, scipy, and torch - ComfyUI already has them all. No model downloads, no config. Find the node under AbstractImage/Layers after restarting.
Gotchas
- Like the other layer nodes, this processes a single image frame - don't wire in batched or video tensors.
line_zigzag_hexis ignored unlessline_zigzag_color_modeishex. The tooltip says it plainly and the code means it.- The zigzag randomness lives entirely inside the seed. Same seed, same stroke layout - which is the point. When you find a gesture you like, lock the seed and change only the prompt to see how the model reinterprets it.
Inputs (15)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| seed | INT | 00–18446744073709550000 | Seed for lines/zigzags randomness. |
| randomize | BOOLEAN | false | If true, randomize lines per layer, colors, width, position, and blend mode using the seed. |
| num_layers | INT | 11–10 | Number of line/zigzag layers to add. |
| lines_per_layer | INT | 101–100 | Number of lines/zigzags to draw per layer. |
| line_width_min | INT | 51–100 | Minimum width for lines and zig-zags. |
| line_width_max | INT | 301–100 | Maximum width for lines and zig-zags. |
| line_zigzag_color_mode | COMBO | random | Color selection mode for lines and zig-zags. 'random' uses implicit RGB. |
| line_zigzag_hex | STRING | Hex code for line/zigzag color (used if Line/Zigzag Color Mode is 'hex'). | |
| alpha | INT | 2550–255 | Alpha (transparency) for lines/zigzags (0 is fully transparent, 255 is fully opaque). |
| shape_position | COMBO | full | Restrict lines/zigzags to a specific position/quadrant. |
| blend_mode | COMBO | normal | Blending mode to composite the lines/zigzags layer onto the base image. |
| feather_layer | BOOLEAN | false | Apply Gaussian blur to the alpha channel of the lines/zigzags 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 | — |