Stripes Pattern (Purz)
Straight lines on demand — the stripe generator that never fights back
- image
Stripes are the lowest-stakes pattern you can generate - but you still don't want to leave ComfyUI, open an editor, and drag a file back in every time you need a background. PurzStripesPattern draws horizontal, vertical, or diagonal stripes straight into the graph as an IMAGE, in two colors you pick. It's the node equivalent of a ruler: simple, predictable, does exactly one job.
It ships in purzbeats' ComfyUI-Purz pack alongside the other pattern generators. Pure Pillow drawing, zero models, zero downloads.
How it works
Under the hood it's ImageDraw rectangles for horizontal and vertical stripes, and polygons for the two diagonal directions. Each stripe is stripe_width pixels of color1 followed by stripe_width of color2, repeating across the canvas. Diagonal modes draw parallel bands slanting top-left to bottom-right (diagonal_right) or the mirror (diagonal_left).
The inputs that matter
- width / height - 64–4096, step 8, default 512.
- stripe_width - 1–256, default 20, the width of one stripe band in pixels. Both colors get the same band width.
- direction -
horizontal,vertical,diagonal_right, ordiagonal_left. - color1 / color2 - hex strings like
#FFFFFF/#000000. Color1 is the first band. - batch_size - 1–16, if you want a stack of identical textures.
Output is a single image (IMAGE). Nothing else, no list output, no mask - just pixels.
Install
Same pack as always:
cd ComfyUI/custom_nodes
git clone https://github.com/purzbeats/ComfyUI-Purz.git
cd ComfyUI-Purz
pip install -r requirements.txt
then restart ComfyUI (or install "ComfyUI-Purz" via ComfyUI Manager). Requirements are OpenCV, Pillow, NumPy, and torch - all things you already have.
Where people get burned
- Hex format is strict.
#RRGGBBor it won't parse. The#matters. - Diagonals and
stripe_widtharen't the same "width". Because diagonal bands are drawn as polygons,stripe_widthis measured along the horizontal axis, not perpendicular to the stripe - the visual band is a bit narrower. Minor, but it surprises people tweaking a diagonal look. - Only two colors. No alternating triple-color stripes, no gradient. That's what
color1/color2give you; if you need more, this node isn't it. - Batch frames are identical. No seed, no variation between frames - it's a static pattern generator. For moving stripes you want the pack's Animated Stripes node instead.
The honest review: it's boring, and that's the compliment. When you need a clean striped background or a barcode-like texture for a mask or an img2img source, it's a three-input setup and it's done.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 51264–4096 | — |
| height | INT | 51264–4096 | — |
| stripe_width | INT | 201–256 | — |
| direction | COMBO | vertical | 4 options: horizontal, vertical, diagonal_right, diagonal_left |
| color1 | STRING | #FFFFFF | — |
| color2 | STRING | #000000 | — |
| batch_size | INT | 11–16 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| image | IMAGE | — |