Stereo Image Node
The Stereo Workhorse of ComfyStereo
- image
- depth_map
- stereoscope
- extended_depthmap_left
- extended_depthmap_right
- no_fill_imperfect_mask
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, orred-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 lowerdivergence. 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
divergenceandconvergence_point. Back off the divergence; most comfortable results live in the low-to-mid range. - Flat or stuttering video output - enable
skip_flat_depthso 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.
Inputs (16)
| Name | Type | Default | Description |
|---|---|---|---|
| image | IMAGE | — | |
| depth_map | IMAGE | — | |
| modes | COMBO | 5 options: left-right, right-left, top-bottom, bottom-top, red-cyan-anaglyph | |
| fill_technique | COMBO | GPU 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. |
| divergenceopt | FLOAT | 4.500.05–15 | The strength of the stereo effect. Higher values create a more pronounced 3D effect but may cause discomfort if too high. |
| separationopt | FLOAT | 0.00-5–5 | The 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_balanceopt | FLOAT | 0.00-0.95–0.95 | Adjusts 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_pointopt | FLOAT | 0.500–1 | Controls the depth at which the stereo effect converges. 0.0 means convergence at the back, 1.0 means convergence at the front. |
| stereo_offset_exponentopt | FLOAT | 1.00.1–2 | Controls 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_bluropt | BOOLEAN | true | Blur the depth map at foreground edges so the warp covers small silhouette gaps. Mesh-warp path only. |
| extend_radiusopt | INT | 50–30 | Max reach of silhouette extension (px). 0 disables. |
| extend_edge_thresholdopt | FLOAT | 10.00–100 | Min edge steepness to trigger extension (% depth jump per pixel). Higher = only crisp edges. |
| extend_fade_distanceopt | INT | 51–50 | Distance (px) over which the extended foreground tapers to background. |
| skip_flat_depthopt | BOOLEAN | false | When 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_thresholdopt | FLOAT | 1.50.1–10 | Maximum 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_sizeopt | INT | 121–64 | Number of frames to process before clearing GPU memory. Lower values use less memory but may be slower. |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| stereoscope | IMAGE | — |
| extended_depthmap_left | IMAGE | — |
| extended_depthmap_right | IMAGE | — |
| no_fill_imperfect_mask | MASK | — |