Nodes/ComfyUI-DeepStereo/DeepStereo: Procedural Texture Generator
ComfyUI Node

DeepStereo: Procedural Texture Generator

The texture decides whether your Magic Eye fuses — this node builds it from your own image

By SanDiegoDude·Created about a year ago·Updated about a year ago· 3
DeepStereo: Procedural Texture Generator
  • image
  • texture
max_megapixels2.0
combination_modeblend
blend_typeaverage
blend_opacity0.75
enable_color_dotstrue
dot_density0.70
dot_size50
dot_bg_color000000
dot_color_modetransformed_hue
hue_shift_degrees90
enable_glyph_dithertrue
glyph_num_colors8
glyph_size10
glyph_stylerandom_dots
use_quantized_colortrue

A plain Magic Eye is random dots. A nice one has a patterned texture, and the texture is what your eyes actually lock onto when the 3D resolves. RandomNoiseGenerator gives you abstract patterns; this node goes a step further and builds a texture from the content of the image itself - content-driven color dots plus a dither pass - so the texture has a visual relationship to the scene you're showing.

It's the ComfyUI translation of the author's standalone DeepStereo tool's texture methods, and it's the one texture node that understands "this came from a photo."

How it works

Required inputs: an image (the source you want the texture to draw from), max_megapixels (caps the output size, default 2 MP - bigger is slower, not better), and combination_mode - sequential or blend - which decides how the two texture methods combine.

Two methods are stacked under that:

  • Color dots (enable_color_dots, on by default). dot_density, dot_size, and a dot_bg_color (hex, no #) control the dots. The interesting knob is dot_color_mode:
    • content_pixel - dots sample actual pixels from your image.
    • random_rgb - fully random colors.
    • random_from_palette - random colors drawn from a palette derived from the image.
    • transformed_hue (default) - image colors with a hue rotation via hue_shift_degrees, which keeps the pattern tied to the content while making it visually distinct.
    • transformed_invert - image colors inverted.
  • Glyph dither (enable_glyph_dither, on by default). glyph_num_colors, glyph_size, glyph_style (random_dots, lines, circles, solid) and use_quantized_color build a dithered dot field.

When combination_mode is blend, blend_type (eight options: average, lighten, darken, multiply, screen, add, difference, overlay) and blend_opacity control how the two methods merge.

One output: texture, straight into StereogramGenerator's texture input.

Getting it to work

The pack's own advice is worth repeating: avoid blurry or overly complex patterns, keep pattern size consistent with your separation values. The transformed_hue default is a good starting point because it separates the pattern's colors from the scene's while keeping them related. If the fused image is noisy static, your pattern is too busy or too low-contrast - simplify the glyph_style and up the dot contrast. And keep max_megapixels modest; a 2 MP texture is already plenty and renders fast.

Installing it

Standard pack install:

cd ComfyUI/custom_nodes
git clone https://github.com/SanDiegoDude/ComfyUI-DeepStereo
cd ComfyUI-DeepStereo
pip install -r requirements.txt

Restart ComfyUI or install via ComfyUI Manager (search ComfyUI-DeepStereo). Pure procedural generation - no models, no first-run downloads, just PIL and numpy doing the work.

CategoryDeepStereo/Texture

Inputs (16)

NameTypeDefaultDescription
imageIMAGE
max_megapixelsFLOAT2.00.1–10
combination_modeCOMBOblend2 options: sequential, blend
blend_typeoptCOMBOaverage8 options: average, lighten, darken, multiply, screen, add, +2
blend_opacityoptFLOAT0.750–1
enable_color_dotsoptBOOLEANtrue
dot_densityoptFLOAT0.700–1
dot_sizeoptINT501–200
dot_bg_coloroptSTRING000000Background color as hex (without #)
dot_color_modeoptCOMBOtransformed_hue5 options: content_pixel, random_rgb, random_from_palette, transformed_hue, transformed_invert
hue_shift_degreesoptFLOAT900–360
enable_glyph_ditheroptBOOLEANtrue
glyph_num_colorsoptINT82–32
glyph_sizeoptINT102–50
glyph_styleoptCOMBOrandom_dots4 options: random_dots, lines, circles, solid
use_quantized_coloroptBOOLEANtrue

Outputs (1)

NameTypeDescription
textureIMAGE