Y7 SBS (Image)
Turn any flat photo into a side-by-side 3D image (no stereo camera, no API key)
- base_image
- depth_map
- IMAGE
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_scaleoff, or raisedepth_blur_strengthto smooth the depth edges driving the artifacts. - Looks flat:
depth_scaletoo low, or your depth map has almost no range. Depth Anything gives much better separation than MiDaS. - Checking it on a monitor: switch
modeto cross-eyed, or just pickanaglyphand 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
_LRto 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.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| base_image | IMAGE | The main image to convert to a side-by-side 3D image | |
| depth_map | IMAGE | Grayscale depth map where brighter areas appear closer and darker areas further away | |
| method | COMBO | mesh_warping | Select 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_scale | INT | 40 | Controls the strength of the 3D effect - higher values create more pronounced depth |
| mode | COMBO | Parallel: For normal, parallel viewing (left eye sees left image) -Cross-eyed: For cross-eyed viewing (left eye sees right image) | |
| output_type | COMBO | sbs | Choose 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_strength | INT | 73–33 | Controls 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)
| Name | Type | Description |
|---|---|---|
| IMAGE | IMAGE | — |