Pattern Generator
The Pattern Generator that quietly does six jobs behind one 'parameter1'
- IMAGE
The PatternGeneratorNode is the workhorse of the orion4d/illusion_node pack: one node that procedurally generates stripes, a checkerboard, random dots, a solid fill, a gradient, or blocky noise. Default size is a modest 128×128, which tells you what it's really for - making tiles. This is the node that feeds the autostereogram creator its pattern, or produces a quick seamless-ish texture you can tile up with the pack's Tile Image Repeater.
How it works
Six pattern_type modes, all computed in numpy/Pillow at the width × height you set. The catch - and it's the one genuinely confusing thing about this node - is that parameter1 and parameter2 mean different things in different modes. The author's tooltips are the Rosetta stone:
Stripes-parameter1is stripe width.Checkerboard-parameter1is square size.Random Dots-parameter1is density as a percentage,parameter2is max dot radius.Solid Color- fills withcolor1_hex. Parameters ignored.Gradient-parameter1is direction (0 = left-to-right, 1 = top-to-bottom, 2 = right-to-left, 3 = bottom-to-top).Noise-parameter1of 0 gives color noise, 1 gives grayscale;parameter2is the block scale (1 = pixel-level).
seed drives the randomness in the dots and noise modes, so you can regenerate the same texture.
The inputs that matter
width/height(default 128 each, range 16–4096, step 8): output size.pattern_type(defaultNoise): the six modes above.color1_hex/color2_hex(default#000000/#FFFFFF): the two colors.parameter1/parameter2: mode-dependent, see above.seed(default 0): random source for dots and noise.
One IMAGE output. The practical sweet spot: generate a busy pattern here and feed it into the autostereogram node as the pattern input - a dense random-dot field is literally what classic Magic Eye images are made of.
Install
Ships in orion4d/illusion_node ("ComfyUI Illusion & Pattern Nodes"), all nodes under the "illusion" category. ComfyUI Manager search "Illusion" will find it, or:
cd ComfyUI/custom_nodes
git clone https://github.com/orion4d/illusion_node.git
Restart ComfyUI afterward. The pack's requirements.txt is numpy, torch, and Pillow - nothing a stock ComfyUI doesn't already have - and there are no model files to fetch.
Common issues
Nine times out of ten, confusion here is "I set parameter1 to 10 expecting stripes and got noise" - because the parameter's meaning changes with the mode. Check the tooltip on the widget itself before you panic. Also watch the defaults: the Noise default with parameter2 at 1 gives you pure pixel soup, which is correct behavior, not a bug. If you want chunky blocks instead, raise the block scale. And remember width/height default to 128 - generate up to whatever you need, but the node was designed as a tile factory, so think in tile sizes.
Inputs (8)
| Name | Type | Default | Description |
|---|---|---|---|
| width | INT | 12816–4096 | — |
| height | INT | 12816–4096 | — |
| pattern_type | COMBO | Noise | 6 options: Stripes, Checkerboard, Random Dots, Solid Color, Gradient, Noise |
| color1_hex | STRING | #000000 | — |
| color2_hex | STRING | #FFFFFF | — |
| parameter1 | INT | 10–256 | Stripes:width; Dots:density%; Gradient:direction; Noise:0=Color/1=Grayscale |
| parameter2 | INT | 11–64 | Dots:max_radius; Noise:block_scale |
| seed | INT | 00–4294967295 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |