Nodes/Dobidop ComfyStereo/Stereo Image Node
ComfyUI Node

Stereo Image Node

The Stereo Workhorse of ComfyStereo

By Dobidop·Created 2 years ago·Updated 3 months ago· 53
Stereo Image Node
  • image
  • depth_map
  • stereoscope
  • extended_depthmap_left
  • extended_depthmap_right
  • no_fill_imperfect_mask
modes
fill_techniqueGPU Warp (Fast)
divergence4.50
separation0.00
stereo_balance0.00
convergence_point0.50
stereo_offset_exponent1.0
depth_edge_blurtrue
extend_radius5
extend_edge_threshold10.0
extend_fade_distance5
skip_flat_depthfalse
flat_depth_threshold1.5
batch_size12

This is the node the rest of ComfyStereo exists to feed. Feed it an image and a depth map, and it hands you a left-eye/right-eye pair packed into one side-by-side frame - the thing you drop into a phone VR headset, a 3D TV, or a Quest. It's a direct port of the stereoscopic script from thygate's stable-diffusion-webui-depthmap-script, which is A1111 users' shorthand for "the last thing I miss from Auto1111" every time this subject comes up. If you want 3D out of a flat render, this is the cheap geometric route: no diffusion model involved, seconds per image, and the whole pipeline is GPU-accelerated.

How it works

Depth-based disparity, which sounds fancy and isn't. The depth map encodes distance per pixel (white close, black far, the usual convention). The node shifts pixels horizontally by an amount proportional to that distance - closer things move more, farther things less - to build the two eye views. divergence scales how aggressive that shift is, and convergence_point decides which depth lands on the screen plane, i.e. zero parallax. Set it to 0.5 and depth is balanced around the screen; push toward 1.0 and the background sits at the screen while the foreground pops out at you.

The hard part of any depth-to-stereo conversion is disocclusion: when you shift pixels, you reveal background that simply wasn't in the original image, and something has to fill the hole. That's the fill_technique enum. The default GPU Warp (Fast) batches frames on the GPU (the README claims 5–20x over CPU) and is what you'll leave on. The other seven options - Naive, Polylines Soft/Sharp, Hybrid Edge, and the "No fill" variants - trade quality and speed and mostly matter for edge cases. If you want pixel-perfect gaps, you skip the fill entirely and inpaint yourself.

The inputs that matter

  • image and depth_map - feed both; a flat or missing depth map is the #1 cause of a boring or broken result.
  • divergence (0.05–15, default 4.5) - the strength of the 3D effect. Keep it gentle; too high and the image feels like it's tearing apart and your eyes will hate you.
  • convergence_point (0–1, default 0.5) - where the scene meets the screen plane. 1.0 gives you pop-out, 0.0 gives natural recession.
  • modes - left-right, right-left, top-bottom, bottom-top, or red-cyan-anaglyph. Left-right is the safe default; anaglyph only makes sense if you actually own red-cyan glasses.
  • fill_technique - as above. Change it only when you see gaps.

The rest is refinement. separation adds a flat horizontal shift, stereo_balance pushes the effect toward one eye, stereo_offset_exponent curves the depth mapping, and the depth_edge_blur/extend_* group extends foreground silhouettes so the warp covers small gaps at edges. For video batches there's skip_flat_depth (skips near-flat frames so fades don't produce garbage) and batch_size (frames processed before GPU memory is cleared - drop it if you're running out of VRAM).

Outputs

  • stereoscope - the side-by-side (or top-bottom/anaglyph) result. The one you view or encode.
  • extended_depthmap_left / extended_depthmap_right - the processed depth maps per eye; handy for debugging or further compositing.
  • no_fill_imperfect_mask - a MASK of the regions the fill couldn't reconstruct. Wire this into an inpaint pass if you're chasing clean output rather than fast output.

Install

From ComfyUI Manager, search "ComfyStereo" and install. Or manually:

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

Then restart ComfyUI. The base requirements.txt pulls in torch, opencv, numba, scipy and friends; the VR and diffusion extras come along in the same file, which means one pip install gets you everything even if you only use this node.

Troubleshooting

  • Black or empty regions in the output - the fill is losing the battle. Try a different fill_technique, or lower divergence. For the absolute best gaps, output the mask and inpaint.
  • Depth map looks wrong - check the convention: white = near, black = far. A reversed map produces stereo that feels inverted, which is worse than none.
  • Eye strain / tearing - that's divergence and convergence_point. Back off the divergence; most comfortable results live in the low-to-mid range.
  • Flat or stuttering video output - enable skip_flat_depth so near-uniform frames are duplicated instead of warped.

Where it sits in a workflow

It's the engine room of a classic pipeline: Depth Anything V2 (via comfyui_controlnet_aux) estimates a depth map from your image, StereoImageNode warps it, and you feed the result to a native VR viewer or export it as an SBS video. The README ships a ready-made Video2Stereo.json workflow that chains exactly this for video. The one thing it won't do is invent content - which is precisely what StereoDiffusion, the pack's other stereo node, is for.

Categorysd

Inputs (16)

NameTypeDefaultDescription
imageIMAGE
depth_mapIMAGE
modesCOMBO5 options: left-right, right-left, top-bottom, bottom-top, red-cyan-anaglyph
fill_techniqueCOMBOGPU Warp (Fast)The technique used to fill in disoccluded areas. 'GPU Warp (Fast)' uses a fast GPU-based warping method. 'No fill' leaves disoccluded areas black. 'No fill - Reverse projection' attempts to fill using reverse projection but may have artifacts. 'Imperfect fill - Hybrid Edge' uses a hybrid edge-based method that can produce better results but may still have imperfections. The various 'Fill' options use different algorithms to attempt to fill in missing areas, with varying quality and performance characteristics.
divergenceoptFLOAT4.500.05–15The strength of the stereo effect. Higher values create a more pronounced 3D effect but may cause discomfort if too high.
separationoptFLOAT0.00-5–5The separation of the stereo pairs. Positive values increase separation, while negative values decrease it. Adjusting this can help fine-tune the 3D effect and reduce ghosting.
stereo_balanceoptFLOAT0.00-0.95–0.95Adjusts the balance between the left and right images. Positive values favor the left image, while negative values favor the right image. This can help correct for any imbalance in the stereo effect.
convergence_pointoptFLOAT0.500–1Controls the depth at which the stereo effect converges. 0.0 means convergence at the back, 1.0 means convergence at the front.
stereo_offset_exponentoptFLOAT1.00.1–2Controls the curve of the depth mapping. Higher values create a more pronounced effect at closer depths, while lower values create a more uniform effect across all depths.
depth_edge_bluroptBOOLEANtrueBlur the depth map at foreground edges so the warp covers small silhouette gaps. Mesh-warp path only.
extend_radiusoptINT50–30Max reach of silhouette extension (px). 0 disables.
extend_edge_thresholdoptFLOAT10.00–100Min edge steepness to trigger extension (% depth jump per pixel). Higher = only crisp edges.
extend_fade_distanceoptINT51–50Distance (px) over which the extended foreground tapers to background.
skip_flat_depthoptBOOLEANfalseWhen enabled, frames whose depth maps have negligible gradients and tiny pixel displacement are skipped — the original frame is duplicated instead of warped. Useful for video batches containing fades or near-uniform depth frames. Controlled by flat_depth_threshold.
flat_depth_thresholdoptFLOAT1.50.1–10Maximum effective pixel displacement (in pixels) below which a frame is considered flat and skipped when skip_flat_depth is enabled. Only skips if there are also no detectable depth edges. Raise this to skip more frames; lower it to be more conservative.
batch_sizeoptINT121–64Number of frames to process before clearing GPU memory. Lower values use less memory but may be slower.

Outputs (4)

NameTypeDescription
stereoscopeIMAGE
extended_depthmap_leftIMAGE
extended_depthmap_rightIMAGE
no_fill_imperfect_maskMASK