Nodes/ComfyUI-DeepStereo/DeepStereo: Random Dot Stereogram
ComfyUI Node

DeepStereo: Random Dot Stereogram

Random dots plus depth, no texture required

By SanDiegoDude·Created about a year ago·Updated about a year ago· 3
DeepStereo: Random Dot Stereogram
  • depth_map
  • rds_stereogram
min_separation30
max_separation100
dot_density0.50
depth_layers50
layer_smoothing1.00
background_color#808080
random_seed0

The original Magic Eye images weren't textured - they were random dots. When you defocus and your eyes lock, a hidden 3D shape resolves out of what looks like TV static. This node does exactly that: a random-dot stereogram (RDS), built straight from a depth map with no texture input at all. It's the "classic effect" option the pack's README points you at, and honestly it's the most satisfying way to test that your depth map is any good.

The genre is a small niche even by diffusion-community standards - people have been asking for a Magic Eye generator since 2022 ("can someone get SD to do Magic Eye?") and a handful of node packs serve it. This is the dedicated one.

How it works

Feed it one depth_map and it lays down the classic constraint-copy algorithm. For each pixel column, it reads the depth, maps it to a pixel offset between min_separation and max_separation, and copies from x - separation. Where there's no source yet, it rolls a random colored dot with probability dot_density, or the background_color (a hex string, default #808080 gray). Because every repeat of the pattern shifts by the depth value, your eyes fuse the repeats and read the shift as height.

The inputs that actually shape the result:

  • min_separation / max_separation - the depth range in pixels. Wider = stronger pop but harder to fuse. They must satisfy min_separation < max_separation, or the node raises an error.
  • dot_density (0.1–1, default 0.5) - how dense the dots are. Denser dots give more texture to lock onto.
  • depth_layers (0–50, default 50) - quantizes depth into discrete bands. 0 means continuous depth; fewer layers gives that stepped "pixel relief" look.
  • layer_smoothing (0–1, default 1) - smooths transitions between those bands with cosine interpolation. Turn it down for a deliberately chunky posterized effect.
  • background_color and random_seed (0 = random) round it out.

One output: rds_stereogram.

Getting it to work

If the shape pops inward instead of outward, invert the depth map upstream (DepthMapProcessor has an invert switch). If you can't fuse it at all, reduce max_separation - a big separation demands more eye divergence. And if the depth looks chunky where you want smooth, raise depth_layers or layer_smoothing. Keep in mind RDS is unforgiving: no texture means every pixel is doing depth duty, so a blurry depth map shows up immediately as mud.

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). No downloads beyond the pack itself - the only thing it needs from you is a depth map, which the pack's own MiDaSDepthEstimator is happy to provide.

CategoryDeepStereo/Generation

Inputs (8)

NameTypeDefaultDescription
depth_mapIMAGE
min_separationINT3010–200
max_separationINT10020–300
dot_densityFLOAT0.500.1–1
depth_layersINT500–50Number of distinct depth layers (0 for continuous)
layer_smoothingFLOAT1.000–1Amount of smoothing between layers
background_coloroptSTRING#808080Hex color for background
random_seedoptINT00–9999990 for random seed

Outputs (1)

NameTypeDescription
rds_stereogramIMAGE