Nodes/ComfyUI-AbstractImaGen/Abstract Image Lines/Zigzags Layer
ComfyUI Node

Abstract Image Lines/Zigzags Layer

Zigzags and gestural strokes that read as intentional, not messy

By wakattac·Created about a year ago·Updated about a year ago· 1
Abstract Image Lines/Zigzags Layer
  • image
  • IMAGE
seed0
randomizefalse
num_layers1
lines_per_layer10
line_width_min5
line_width_max30
line_zigzag_color_moderandom
line_zigzag_hex
alpha255
shape_positionfull
blend_modenormal
feather_layerfalse
feather_sigma_min1.0
feather_sigma_max6.0

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). overlay and screen give 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_hex is ignored unless line_zigzag_color_mode is hex. 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.
CategoryAbstractImage/Layers

Inputs (15)

NameTypeDefaultDescription
imageIMAGE
seedINT00–18446744073709550000Seed for lines/zigzags randomness.
randomizeBOOLEANfalseIf true, randomize lines per layer, colors, width, position, and blend mode using the seed.
num_layersINT11–10Number of line/zigzag layers to add.
lines_per_layerINT101–100Number of lines/zigzags to draw per layer.
line_width_minINT51–100Minimum width for lines and zig-zags.
line_width_maxINT301–100Maximum width for lines and zig-zags.
line_zigzag_color_modeCOMBOrandomColor selection mode for lines and zig-zags. 'random' uses implicit RGB.
line_zigzag_hexSTRINGHex code for line/zigzag color (used if Line/Zigzag Color Mode is 'hex').
alphaINT2550–255Alpha (transparency) for lines/zigzags (0 is fully transparent, 255 is fully opaque).
shape_positionCOMBOfullRestrict lines/zigzags to a specific position/quadrant.
blend_modeCOMBOnormalBlending mode to composite the lines/zigzags layer onto the base image.
feather_layerBOOLEANfalseApply Gaussian blur to the alpha channel of the lines/zigzags layer.
feather_sigma_minFLOAT1.00–20Minimum sigma for feathering (if applied).
feather_sigma_maxFLOAT6.00–20Maximum sigma for feathering (if applied).

Outputs (1)

NameTypeDescription
IMAGEIMAGE