Commit Graph
99 Commits
Author SHA1 Message Date
DobidopandClaude Sonnet 4.5 a33c104559 Fix convergence sign preservation in CPU stereo fill modes
- 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>
2026-02-06 11:57:04 +01:00
Dobidop 9bb9266845 Refactor imports and improve error handling in VR viewer components; update requirements for clarity 2026-02-06 11:16:33 +01:00
Dobidop 1add28da4a Update project version and description 2025-11-26 08:52:40 +01:00
Dobidop cfbd041bc9 Merge pull request #11 from Dobidop/claude/review-codebase-bugs-01Dh7NHVv4uypSYkgYCdmqjy
Claude/review codebase bugs 01 dh7 nh vv4uyp s ykg y cdmqjy
2025-11-25 22:26:47 +01:00
Dobidop 8433a19c06 Update README to remove optional model parameters
Removed optional model parameters from README.
2025-11-25 22:17:05 +01:00
Dobidop 5c18d89d29 Revise README description for ComfyStereo
Updated project description for clarity and conciseness.
2025-11-25 22:15:54 +01:00
Dobidop db10283942 Merge pull request #10 from Dobidop/claude/review-codebase-bugs-01Dh7NHVv4uypSYkgYCdmqjy
Claude/review codebase bugs 01 dh7 nh vv4uyp s ykg y cdmqjy
2025-11-25 22:14:54 +01:00
DobidopandClaude 41ba85c95c Add pip optional dependencies installation instructions to README
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>
2025-11-25 22:13:35 +01:00
DobidopandClaude cc0488be08 Update pyproject.toml for v2.0.0 with optional dependencies
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>
2025-11-25 22:13:09 +01:00
Dobidop a916353c16 update 2025-11-25 22:11:27 +01:00
DobidopandClaude c2b3bb5a50 Merge ComfyStereoViewer and StereoscopeGenerator into unified ComfyStereo
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>
2025-11-25 22:10:56 +01:00
Dobidop 18d1d2fd8a Removed debug 2025-11-22 22:49:31 +01:00
Dobidop df02624829 Add debug prints for results shapes and handle list input in generate_mask 2025-11-22 22:30:55 +01:00
Dobidop b4b6cb7fa9 Add GPU-accelerated stereo divergence functions and memory management improvements 2025-11-22 22:18:59 +01:00
Claude 85c7d9348a Fix tensor size mismatch in GPU blur function
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"
2025-11-20 09:54:27 +00:00
Claude 12b7a23c8d Fix tensor dimension error in ComfyUI integration
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]"
2025-11-20 09:40:04 +00:00
Claude e309d4111b Add standalone test suite for non-ComfyUI testing
- 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.
2025-11-18 12:55:49 +00:00
Claude 673648f0d2 Add convergence point control for depth composition
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
2025-11-17 13:38:30 +00:00
Claude 749ea55bbc Implement GPU acceleration for depth processing
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
2025-11-17 13:34:08 +00:00
Claude ad95a89d58 Code quality improvements and bug fixes
- Fix stereo balance comment to correctly describe behavior
- Add division by zero protection for flat depth maps
- Remove commented code (matplotlib imports, debug saves, LazyStereo class)
- Clean up code formatting and improve readability

This improves maintainability and prevents crashes on edge cases.
2025-11-17 12:06:28 +00:00
Claude 032947e443 Fix stereo balance bug and other issues
- 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.
2025-11-17 11:51:03 +00:00
Dobidop f528c0680f Merge pull request #9 from ComfyNodePRs/update-publish-yaml
Update Github Action for Publishing to Comfy Registry
2025-08-31 13:30:27 +02:00
Dobidop feaf6d88ff Update pyproject.toml 2025-03-23 19:45:54 +01:00
Dobidop a8c487756a Merge pull request #8 from scm6079/main
Support for Numpy 2
2025-03-23 19:44:33 +01:00
Scott Moore 86a82402cd Support for Numpy 2
Converted calls of np.float_ to np.float64
2025-03-22 17:18:28 -07:00
Dobidop 602303a7eb Update README.md 2025-03-09 14:08:15 +01:00
Dobidop 2efa100724 Update README.md 2025-03-09 13:23:09 +01:00
Dobidop 1025ab1732 Improved depth map blur, simplified DeoVr loading
Improved depth map blur
Improved DeoVr loading
Simplified loading media to DeoVR
2025-03-09 00:26:08 +01:00
Dobidop 4fc71eb3cb Update README.md 2025-02-26 18:08:59 +01:00
Dobidop e7afb825e7 Update README.md 2025-02-26 17:38:11 +01:00
Dobidop 7162475b6d minor 2025-02-25 20:53:10 +01:00
Dobidop 55ba9158da Update pyproject.toml 2025-02-25 20:27:17 +01:00
Dobidop abccc9fcb3 Update pyproject.toml 2025-02-25 20:26:21 +01:00
Dobidop 4ffd381825 Update README.md 2025-02-25 20:25:44 +01:00
Dobidop a384a5d80a Update pyproject.toml 2025-02-25 20:17:43 +01:00
Dobidop 6a383c7a30 Added DeoVR View node 2025-02-25 20:14:55 +01:00
snomiao 360395c071 chore(publish): update workflow for node publishing
- 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
2025-02-21 22:11:02 +00:00
Dobidop c1998fd196 Update .gitignore 2025-02-21 22:34:04 +01:00
Dobidop c96f6eb73f Create .gitignore 2025-02-21 22:18:14 +01:00
Dobidop b069859424 Update pyproject.toml 2025-02-21 22:09:24 +01:00
Dobidop ffc5e7d1c1 Update pyproject.toml 2025-02-21 22:07:49 +01:00
Dobidop ca7024dc9e Create publish.yml 2025-02-21 22:04:38 +01:00
Dobidop e7388aa489 Create pyproject.toml 2025-02-21 22:03:07 +01:00
Dobidop 377f771950 Update README.md 2025-02-21 21:58:53 +01:00
Dobidop 046e788d3d Merge pull request #6 from Dobidop/dev
Dev
2025-02-21 21:57:51 +01:00
Dobidop c250d0b2b8 Merge branch 'main' into dev 2025-02-21 21:56:51 +01:00
Dobidop ebcb9c5aed Retried reset 2025-02-21 09:23:23 +01:00
Dobidop ff6f9fd67b Retried reset.. 2025-02-21 09:21:53 +01:00
Dobidop c2c6903553 Fixed bug for edge aware depth blur 2025-02-20 18:27:10 +01:00
Dobidop c1fa30f3fb Merge pull request #5 from Dobidop/main
Restored from main
2025-02-20 16:48:43 +01:00