Nodes/StereoVision Plugin for ComfyUI/πŸŒ€ Stereoscopic Generator
ComfyUI Node

πŸŒ€ Stereoscopic Generator

Side-by-Side 3D From a Flat Image β€” Just Add a Depth Map

By DrMWeigandΒ·Created 2 years agoΒ·Updated 12 months agoΒ· 12
πŸŒ€ Stereoscopic Generator
  • base_image
  • depth_map
  • IMAGE
β—„depth_scale80β–Ί

The StereoscopicGenerator is the other half of DrMWeigand's StereoVision pack - the "boring but useful" sibling of the pack's Magic Eye node. Feed it an image plus a depth map and it outputs a side-by-side stereo pair: the left half is the original, the right half is the same pixels shifted horizontally by an amount proportional to depth. Cross your eyes on the result and it snaps into genuine 3D. The README's example is a Seattle skyline labeled "use cross-eyed technique to view 3D," which tells you both what it does and how to look at it.

Why reach for it: it's the cheapest route from a flat diffusion image to something actually viewable in 3D. This is the same family of trick the depth-estimation essay calls stereo/VR content - split a monocular image into left- and right-eye views by offsetting pixels along the depth axis. You need no stereo camera rig, no VR headset, no glasses: just the depth map you probably already have lying around from ControlNet work.

How it works

The node takes your base_image and depth_map, resizes the depth map to match (nearest-neighbor, so mismatched dimensions aren't fatal), then builds a canvas twice as wide. Left half is the original image; right half is a copy where each pixel shifts right by depth value Γ— depth_scale Γ· image width pixels. Because the shift is normalized by image width, a given depth_scale behaves roughly the same across resolutions. There's a small extra pass that paints each shifted pixel a few times over, filling the little gaps left at depth edges so you don't get pinholes.

It runs entirely on CPU and processes the whole batch in a thread pool - which is how the included workflow examples do video: feed frames in from a VHS batch, get side-by-side frames back, save them back out with VHS. The author is on record on r/comfyui (in the thread where someone shipped a GPU anaglyph node) that this pack is fast enough on CPU that GPU-porting isn't worth it - the bottleneck is always generating the depth maps, not shifting pixels.

Inputs and output

That's the whole node: base_image, depth_map, and one depth_scale (INT, default 80). Depth convention: lighter = closer, darker = further.

  • depth_scale is your 3D intensity dial. Higher values = more separation and a stronger pop; lower = subtler. 80 is a sane start, and the README notes that high-contrast scenes may want a lower value.

Output is one IMAGE tensor where each input frame becomes a side-by-side frame. Wire it to PreviewImage/SaveImage, or to VHS for video.

Install

Same as its sibling - ComfyUI Manager, search "StereoVision", or:

cd ComfyUI/custom_nodes
git clone https://github.com/DrMWeigand/ComfyUI-StereoVision

Then restart. Dependencies (numba, opencv-python, scipy, and the usual suspects) are in requirements.txt and install automatically via Manager. All CPU-side: no models to download, no API keys, no GPU requirement.

Where people get burned

The depth map is everything. It has to match the image's actual geometry - run Depth Anything v2 or Marigold on the same image rather than grabbing an arbitrary map - because a flat or misaligned map gives a broken, artifact-riddled result.

The output is literally double width, so it eats twice the VRAM and disk on save; at high resolution that's worth planning for. And the cross-eyed viewing takes practice - the result can look wrong at a glance if you don't actually do the eye thing. For video, per-frame depth flicker shows up as wobbly 3D; a temporally-smoothed depth source like DepthCrafter helps, but that smoothing isn't built into this node.

Three inputs, one output, no models, and a depth map away from a genuinely convincing 3D illusion. It's the kind of thing that's absurdly impressive to show people precisely because it needs no hardware to view.

CategoryπŸŒ€ StereoVision

Inputs (3)

NameTypeDefaultDescription
base_imageIMAGEβ€”
depth_mapIMAGEβ€”
depth_scaleINT80β€”

Outputs (1)

NameTypeDescription
IMAGEIMAGEβ€”