- Fix sign loss bug in all 6 CPU fill functions where even exponents
(e.g., stereo_offset_exponent=2.0) caused depth values on opposite
sides of the convergence point to produce identical offsets
- Changed from: offset = (normalized_depth ** exponent) * divergence
- Changed to: offset = sign(depth) * abs(depth)**exponent * divergence
- This matches the GPU warp implementation which was already correct
- Affected functions: enhanced_inverse_mapping_with_mask,
naive_mapping_with_mask, inverse_mapping_with_mask,
apply_stereo_divergence_inverse, apply_stereo_divergence_naive,
apply_stereo_divergence_polylines
Additional fixes:
- Replace Unicode checkmarks (✓/✗) with ASCII ([OK]/[--]) in __init__.py
for Windows cp1252 compatibility
- Add tests/ to .gitignore (tests kept in dev branch only)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Update installation section to show both traditional requirements.txt
method and modern pip optional dependencies approach.
Users can now choose between:
- pip install -e ".[vr]" for VR viewing
- pip install -e ".[ai]" for AI stereo generation
- pip install -e ".[all]" for everything
This provides a cleaner installation experience aligned with
Python packaging best practices.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Changes:
- Bump version to 2.0.0 to reflect major feature additions
- Update description to reflect comprehensive stereo toolkit
- Add optional-dependencies sections:
- [vr] for PyOpenXR VR viewing
- [ai] for StereoDiffusion AI generation
- [all] for complete installation
Users can now install with:
pip install -e . # Base only
pip install -e ".[vr]" # Base + VR viewing
pip install -e ".[ai]" # Base + AI stereo
pip install -e ".[all]" # Everything
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Combines three powerful stereoscopic tools into one comprehensive package:
1. Core Stereo Generation
- Depth-based stereo conversion with GPU acceleration
- Advanced fill techniques (Polylines, GPU Warp, Hybrid Edge, etc.)
- Edge-aware depth blurring for artifact reduction
- Side-by-Side, Top-Bottom, and Red-Cyan Anaglyph output formats
2. Native VR Viewing (Optional - requires PyOpenXR)
- Auto-launch directly into VR headset without browser
- Support for all VR headsets (Quest, Vive, Index, WMR)
- Multiple projection types (Flat, Curved, 180° Dome, 360° Sphere)
- Image and video playback support
3. StereoDiffusion AI (Optional - requires diffusers)
- AI-powered stereo generation using diffusion models
- DDIM inversion with null-text optimization
- Bilateral Neighbor Attention for stereo consistency
- Works with ComfyUI MODEL/CLIP/VAE or HuggingFace models
Changes:
- Added native_viewer/ module with PyOpenXR implementation
- Added native_nodes.py with 3 VR viewer nodes
- Added stereodiffusion_nodes.py with AI stereo generation
- Added supporting modules: model_wrappers, model_loader, inversion,
stereo_utils, diffusion_utils
- Updated __init__.py with graceful optional dependency handling
- Consolidated all requirements into single requirements.txt
- Comprehensive README with setup guides and troubleshooting
- Added NOTICE and licenses/ for proper attribution
The package now offers 6+ nodes total with modular installation options.
Users can install just the base, or add VR viewing and/or AI generation.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Convolution and max pooling with integer division padding can create
slightly different output sizes due to rounding (e.g., 448 vs 449).
This caused errors when using torch.where to combine tensors.
Solution: Crop all tensors to match the original depth tensor shape
before applying the blur masks.
Fixes the error: "The size of tensor a (448) must match the size of
tensor b (449) at non-singleton dimension 3"
ComfyUI uses [H, W, C] tensor format, but the code was incorrectly
assuming [C, H, W] format. This caused dimension mismatch errors
during interpolation.
Changes:
- Convert tensors from [H, W, C] to [C, H, W] using permute()
- Fix grayscale conversion to check channels correctly
- Add safety checks for tensor dimensions
- Fix interpolate call to work with proper tensor shapes
Fixes the error: "Input and output must have the same number of
spatial dimensions, but got input with spatial dimensions of
[656, 448, 3]"
- test_standalone.py: Comprehensive test suite covering all features
- create_test_images.py: Generates synthetic test images
- Updates .gitignore to exclude test output artifacts
Test Coverage:
- Basic stereo generation
- Different divergence levels
- Depth map blurring (direction-aware)
- Stereo balance control (validates bug fix)
- Multiple output modes (left-right, top-bottom, anaglyph)
All tests pass successfully (5/5) on CPU with NumPy/Numba.
New Feature: Convergence Point Control
- Adds convergence_point parameter (0.0-1.0) to control zero parallax plane
- Allows compositional control over what appears "at screen" vs pops out/recedes
- Default 0.5 maintains backward compatibility (mid-depth at screen)
Use Cases:
- 1.0 (pop-out mode): All content floats forward, nothing recedes
- 0.0 (window mode): All content recedes, subtle depth effect
- 0.6-0.7: Portrait mode - face at screen, background recedes
- 0.3-0.4: Landscape mode - foreground pops, horizon recedes
Implementation:
- Shifts normalized depth range so convergence_point maps to zero parallax
- Simple mathematical transformation: depth - convergence_point
- Objects at convergence depth have zero shift (appear at screen)
- Objects closer have positive parallax (pop out)
- Objects further have negative parallax (recede)
Updates:
- stereoimage_generation.py: Add convergence logic to apply_stereo_divergence
- GenerateStereo.py: Add convergence_point input parameter
- README.md: Document convergence feature with use cases and examples
Major performance improvements:
- Add GPU-accelerated directional motion blur using PyTorch
- Automatic GPU/CPU detection with fallback
- Eliminate CPU-GPU transfers in depth processing pipeline
- 5-20x faster depth blur operations on CUDA GPUs
Implementation details:
- New directional_motion_blur_gpu() function using torch operations
- Sobel edge detection via conv2d instead of scipy
- Dilation via max pooling approximation
- Hybrid approach: GPU for blur, CPU for stereo shifts (JIT-compiled)
Maintains full backward compatibility:
- Automatic fallback to numpy/scipy if no GPU
- Works with existing parameters and workflows
- Zero configuration required
Updates:
- stereoimage_generation.py: Add GPU functions, update create_stereoimages
- GenerateStereo.py: Pass tensors directly, avoid conversions
- README.md: Document GPU acceleration feature
- Fix stereo balance parameter not being applied to divergence values
The balance was calculated but never used to modify the left/right divergence,
causing the stereo balance slider to have no effect
- Fix hardcoded depth_blur_strength value (was 5, now uses divergence)
- Fix directional_motion_blur parameter usage (was passing divergence twice)
- Fix typos in README (negativbely -> negatively, threshhold -> threshold)
Resolves the issue where adjusting stereo balance doesn't affect the output.
- Add permissions for issue writing in the workflow
- Modify condition to check repository owner instead of fork status
- Update action version from `main` to `v1` for stability and consistency