ComfyUI Node

Y7 SBS (Image)

Turn any flat photo into a side-by-side 3D image (no stereo camera, no API key)

By yushan777·Created about a year ago·Updated 2 months ago· 47
Y7 SBS (Image)
  • base_image
  • depth_map
  • IMAGE
methodmesh_warping
depth_scale40
mode
output_typesbs
depth_blur_strength7

The 30-second pitch

Y7 SBS (Image) takes one ordinary image plus its depth map and produces an actual stereoscopic 3D pair - the kind you can load on a Meta Quest, Apple Vision Pro, a 3D TV, or one of those cardboard viewers. It's one of only two nodes in the tiny ComfyUI-Y7-SBS-2Dto3D pack, and it's pure pixel math, not inference: no model files, no API key, no GPU-heavy checkpoint. The whole trick is that the name isn't a lie - you supply a depth map and it does the stereo shifting for you.

The one thing you must bring is the depth. The standard path is a monocular depth estimator: the README pushes Kijai's ComfyUI-DepthAnythingV2 nodes (Depth Anything V2 over MiDaS, "more dense, higher-fidelity... sharper edges"), which read a grayscale map out of your image where brighter pixels are closer. That map is the entire source of the 3D illusion.

How it works

Both eye views are generated by shifting pixels horizontally based on depth: near (bright) pixels move more than far (dark) ones, so the two views diverge on foreground and meet at infinity. You pick the shifting strategy in method:

  • mesh_warping (default): warps a coordinate mesh with eye_separation = depth_scale / (2 * width). Smoother, more natural depth with curved distortion.
  • grid_sampling: per-pixel horizontal disparity applied through grid_sample. Faster, and reads as the classic stereo effect.

Either way it's bilinear sampling with border padding, scaled by depth_scale. Then two more choices decide the final look. mode flips which eye view lands where: parallel (left view on the left, for VR/3D displays) or cross-eyed (swapped - so you can free-view 3D on a normal monitor with no hardware). output_type picks the layout: sbs (side-by-side, double width - what VR players expect), top-bottom (over/under), or anaglyph (a single red-cyan image for cheap glasses). For anaglyph the code builds the stereo pair internally, then merges red from the left eye with green/blue from the right, applying a 0.5 convergence to cut ghosting. Note it needs an RGB image - a 1-channel input will trip its assertion.

The inputs that actually matter

  • base_image and depth_map - your photo and its depth map. Resolution mismatch is handled for you; the depth map gets resized to match.
  • depth_scale (default 40) - the strength of the 3D effect. Close-ups like higher values; push it too far and you get tearing and ghosting at depth edges.
  • depth_blur_strength (default 7, 3–33, odd) - blurs depth transitions before shifting. Lower = sharp separation between layers, higher = smoother planes at the cost of some distortion. The node silently rounds an even value up to the next odd.

Output: a single IMAGE - double width for sbs, double height for top-bottom, unchanged size for anaglyph. Wire it straight into a PreviewImage or SaveImage.

Installing it

ComfyUI Manager → Custom Nodes Manager → search Y7 or Y7 SBS → install → restart ComfyUI. That's the recommended route. Manual:

cd /path/to/ComfyUI/custom_nodes
git clone https://github.com/yushan777/ComfyUI-Y7-SBS-2Dto3D comfyui-y7-sbs-2dto3d
pip install -r requirements.txt

requirements.txt is literally just torch - there are no models in this pack. The real download is upstream: Kijai's DepthAnythingV2 with the depth_anything_v2_vitl_fp16 variant (~671MB) is the README's suggested starting point.

Troubleshooting

  • Tearing or ghosting: back depth_scale off, or raise depth_blur_strength to smooth the depth edges driving the artifacts.
  • Looks flat: depth_scale too low, or your depth map has almost no range. Depth Anything gives much better separation than MiDaS.
  • Checking it on a monitor: switch mode to cross-eyed, or just pick anaglyph and grab some red-cyan glasses.
  • VR viewer showing it as VR180: some apps (immerGallery) guess format from aspect ratio - the README suggests suffixing the filename with _LR to force side-by-side.

One honest limit to keep in mind: the depth map only describes the original camera view. Push the effect too far and you're revealing pixels that were never there - that's where the tearing comes from, and no amount of settings fixes it.

CategoryY7 SBS

Inputs (7)

NameTypeDefaultDescription
base_imageIMAGEThe main image to convert to a side-by-side 3D image
depth_mapIMAGEGrayscale depth map where brighter areas appear closer and darker areas further away
methodCOMBOmesh_warpingSelect the 3D rendering method: - mesh_warping: produces smoother, more natural depth with curved distortion - grid_sampling: faster, simpler pixel shifting for a classic stereo effect
depth_scaleINT40Controls the strength of the 3D effect - higher values create more pronounced depth
modeCOMBOParallel: For normal, parallel viewing (left eye sees left image) -Cross-eyed: For cross-eyed viewing (left eye sees right image)
output_typeCOMBOsbsChoose output format: - sbs: Side-by-side stereoscopic image (left/right) for 3D viewing - top-bottom: Over-under stereoscopic image (left eye on top, right eye on bottom) - anaglyph: Red-cyan anaglyph for viewing with red-cyan 3D glasses
depth_blur_strengthINT73–33Controls how much to blur the depth map transitions. Higher values create smoother depth transitions but may lose detail. 3-15. Odd values only.

Outputs (1)

NameTypeDescription
IMAGEIMAGE