ComfyUI-StereoVision

ComfyUI-StereoVision
★ 9

立体视觉自立体图深度图处理图像与视频生成
将基础图与深度图转换为立体图像与自立体图(Magic Eye)的ComfyUI节点,支持调节深度强度、图案与平铺参数,便于生成左右视图、立体视频及隐藏3D效果。
💡 用照片与深度图生成可调深度的左右视图或Magic Eye自立体图。
🍴 3 Forks💻 Python🔄 2025-09-18
📦
网盘下载
复制链接后前往夸克网盘下载
https://pan.quark.cn/s/b6135d9bd930
📦 requirements.txt
torch
Pillow
numpy
tqdm
numba
opencv-python
scipy
Stereoscopic Generator Demo
Autostereogram Generator Demo (Max Resolution: 1920x1080)
📄 README

StereoVision Plugin for ComfyUI

The StereoVision plugin for ComfyUI enables the creation of stereoscopic and autostereoscopic images and videos using depth maps. It supports both traditional stereoscopic image generation and autostereogram (Magic Eye) creation.

Components

The plugin provides two primary nodes:

  • Stereoscopic Generator: Creates side-by-side stereoscopic images from base images and depth maps
  • Autostereogram Generator: Produces autostereograms from depth maps
  • Stereoscopic Generator

    Usage

  • Input Requirements
  • Base Image: The source image for conversion
  • Depth Map: Corresponding depth information (lighter = closer, darker = further)
  • Node Setup
  • Add the Stereoscopic Generator node
  • Connect base image to base_image input
  • Connect depth map to depth_map input
  • Parameters
  • depth_scale: Controls 3D effect intensity (default: 80)
  • Higher values increase depth separation
  • Lower values produce subtler effects
  • Technical Considerations

  • Image Selection
  • Clear foreground/background separation improves results
  • Consistent depth mapping enhances effect quality
  • High-contrast scenes may require lower depth scale values
  • Processing Requirements
  • Higher resolution inputs require more processing time
  • Video processing may need significant computational resources
  • Example Output

    Seattle (Use cross-eyed technique to view 3D)

    Video Demonstration

    [](https://youtu.be/h_07IrxCBuk)

    Autostereogram Generator

    Usage

  • Input Requirements
  • Depth Map: Defines the hidden 3D image
  • Optional Texture: Custom pattern for the autostereogram
  • Core Parameters
  • pattern_div: Pattern width (integer)
  • Low values: Larger patterns, easier viewing
  • High values: Smaller patterns, more detail
  • depth_multiplier: Depth effect intensity
  • invert: Reverses depth perception
  • x_tiles, y_tiles: Pattern repetition count
  • Pattern Configuration
  • Pattern Types:
  • Random
  • Perlin
  • Dots
  • Lines
  • Checkers
  • Waves
  • Noise Parameters:
  • noise_scale: Pattern size
  • noise_octaves: Pattern complexity
  • Color Options:
  • Grayscale
  • RGB
  • Complementary
  • Batch Processing Controls
  • clamp_depth_to_first: When enabled, uses the first depth map frame for all outputs
  • clamp_texture_to_first: When enabled, uses the first texture frame for all outputs
  • These options are useful for:
  • Creating consistent autostereograms across multiple frames
  • Maintaining pattern continuity in animations
  • Reducing visual noise in batch processing
  • Output Settings
  • Custom width/height support
  • Default: matches depth map dimensions
  • Technical Parameters

    Pattern Division Effects:

  • 4: Large patterns, basic depth perception
  • 16: Fine patterns, detailed hidden images
  • Noise Configuration:

  • Scale Range: 0.5 (fine) to 2.0 (coarse)
  • Octaves: 2-6 (higher = more complex)
  • Example Output

    Harold (texture based)

    *Use parallel viewing technique to see the hidden 3D image*

    Harold (noise based)

    *Use parallel viewing technique to see the hidden 3D image*

    Video Demonstration

    [](https://youtu.be/aozwsNlLgHw)

    Implementation Notes

  • Performance Optimization
  • Match output resolution to viewing requirements
  • Consider computational load for video processing
  • Monitor memory usage with high-resolution inputs
  • Quality Control
  • Verify depth map accuracy
  • Test various pattern settings for optimal viewing
  • Validate output across different display sizes
  • Error Prevention
  • Ensure consistent input dimensions
  • Validate depth map grayscale values
  • Monitor processing resource usage
  • Technical Specifications

  • Input Formats: Standard image formats
  • Output Resolution: Configurable or source-matched
  • Processing: CPU-based computation
  • Memory Requirements: Scales with input resolution
  • Example Implementation

    For detailed implementation examples and advanced usage scenarios, refer to the plugin’s source code and example workflows.