Nodes/ComfyUI-NegiTools/Stereo Image Generator πŸ§…
ComfyUI Node

Stereo Image Generator πŸ§…

3D side-by-side views from one image plus depth

By natto-makiΒ·Created 3 years agoΒ·Updated 2 years agoΒ· 31
Stereo Image Generator πŸ§…
  • image
  • depth_image
  • STEREO_IMAGE
  • IMAGE_L
  • IMAGE_R
β—„divergence5.00β–Ί
β—„stereo_offset_exponent1.0β–Ί
β—„fill_techniqueβ–Ύβ–Ί
β—„output_modeβ–Ύβ–Ί

Take a flat image, add a depth map, and you can manufacture the left-eye/right-eye pair that makes a picture look three-dimensional in a VR headset or a cross-eyed viewer. That's this node's entire job, and it's a surprisingly fun one: it's the "living photo" and stereo-3D trick, done locally in the graph. It's also the most convoluted node in the pack to get running, so let's be straight about what you're signing up for.

How it works

The node feeds your image and depth_image into the stereo-generation algorithm from thygate/stable-diffusion-webui-depthmap-script - an A1111 extension. And here's the catch: it git clones that repo into a dependencies/ folder on first run, then imports its Python module to do the work. No weights to download, but it does need internet and a successful clone the first time, and it's yet another example of this pack shelling out to other people's repos. The depth map is normalized, inverted (so near = bright shifts correctly), and used to displace pixels left and right - the two views see the scene from slightly different angles, which is exactly how your eyes do it.

The inputs that matter

  • image - the flat image to turn into stereo.
  • depth_image - its depth map. The natural source in this pack is the DepthEstimationByMarigold node, though any depth map (Depth Anything, etc.) works.
  • divergence (default 5.0) - how strong the 3D effect is. Higher = more depth, more edge artifacts.
  • stereo_offset_exponent (default 1.0) - skews how the offset distributes between near and far.
  • fill_technique - how holes in the shifted views get patched. polylines_* fill along detected edges and look cleanest; naive and naive_interpolating are cruder; none leaves holes.
  • output_mode - L-R (left/right side-by-side), R-L, or L-R-L (the classic three-panel format some viewers and lenticular tricks want).

Outputs are three IMAGEs: STEREO_IMAGE (the combined frame per output_mode), plus IMAGE_L and IMAGE_R separately, in case you want to do your own compositing.

Where you'd use it

Stereo viewing: L-R-L output viewed cross-eyed, side-by-side in a viewer, or in a headset. It's also the depth-based cousin of the parallax/video 3D pipeline the depth KB covers - where parallax slides the whole image toward a moving camera, stereo slides two static views apart. Quality depends heavily on your depth map: clean, sharp depth (Marigold-grade) gives clean stereo; mushy depth gives smeared edges. That's why this node pairs with the pack's Marigold node - though you'll want the maintained Kijai Marigold instead.

Installing it

It's part of ComfyUI-NegiTools - ComfyUI Manager (search "ComfyUI-NegiTools") or:

cd ComfyUI/custom_nodes
git clone https://github.com/natto-maki/ComfyUI-NegiTools
pip install -r ComfyUI-NegiTools/requirements.txt

then restart. No API key. The extra step is the first-run clone of the A1111 extension, plus the depth map feeding it.

The honest verdict

The runtime-clone architecture makes this the fiddliest node in the pack - it depends on a third-party A1111 repo that isn't under the pack author's control, and if that repo changes or disappears, the node breaks. There are dedicated ComfyUI stereo nodes that are better maintained. But if you want to see the trick work end-to-end in one graph, this gets you there: image β†’ Marigold depth β†’ Stereo Image Generator β†’ viewer. It's a curiosity, not a daily driver - but it's a fun curiosity, and the first time you cross your eyes and a flat picture pops into 3D, you'll understand why people keep building these.

CategoryGenerator

Inputs (6)

NameTypeDefaultDescription
imageIMAGEβ€”
depth_imageIMAGEβ€”
divergenceFLOAT5.000.05–10β€”
stereo_offset_exponentFLOAT1.00.1–3β€”
fill_techniqueCOMBO5 options: polylines_sharp, polylines_soft, naive, naive_interpolating, none
output_modeCOMBO3 options: L-R, R-L, L-R-L

Outputs (3)

NameTypeDescription
STEREO_IMAGEIMAGEβ€”
IMAGE_LIMAGEβ€”
IMAGE_RIMAGEβ€”