This commit implements the core functionality for 360° panoramic depth estimation with multi-plane synchronization for ComfyUI. ## Core Modules Implemented ### Phase 1: Foundation ✅ - core/cubemap.py: CubemapData structure with adjacency mapping - core/projection.py: Equirectangular ↔ Cubemap conversions * Fast vectorized implementations * Bilinear interpolation * Round-trip accuracy optimized ### Phase 2: Depth Integration ✅ - core/depth_interface.py: Generic depth model interface * Compatible with any ComfyUI depth node * Global/per-face/adaptive normalization * Batch processing utilities - core/consistency.py: Depth boundary enforcement * Weighted boundary blending * Seam validation metrics * Gaussian smoothing ### Phase 3: Multi-plane Synchronization ✅ - core/synchronization.py: Cross-face sync algorithms * SyncedSelfAttention with boundary awareness * SyncedConv2d with cross-face padding * SyncedGroupNorm across all faces * MultiplaneSyncProcessor orchestrator ### Phase 4: ComfyUI Nodes ✅ Created 15 production-ready nodes: **Projection Nodes (4):** - EquirectToCubemap: Convert 360° → cubemap - CubemapToEquirect: Convert cubemap → 360° - ExtractCubemapFace: Extract single face - InsertCubemapFace: Insert processed face **Depth Nodes (5):** - ApplyDepthToCubemapFace: Single face depth - BatchCubemapDepth: All 6 faces with consistency - MergeCubemapDepth: Combine RGB + depth - ExtractDepthChannel: Visualize depth - NormalizeCubemapDepth: Normalize depth values **Utility Nodes (6):** - CubemapPreview: Visualize in multiple layouts - CubemapSeamValidator: Validate depth continuity - CubemapInfo: Display cubemap properties - EnforceDepthConsistency: Manual boundary blending - SmoothCubemapDepth: Gaussian noise reduction - CreateEmptyCubemap: Create blank cubemap ### Phase 5: Testing & Documentation 🚧 - tests/test_projection.py: Unit tests for projection math - README.md: Comprehensive user documentation * Installation instructions * Node reference * Troubleshooting guide * Example workflows - Updated IMPLEMENTATION_PLAN.md: 85% complete ## Utilities - utils/visualization.py: Cubemap preview layouts - utils/validation.py: PSNR, SSIM, seam quality metrics ## Technical Highlights - **Windows Compatible**: Pure Python, cross-platform paths - **GPU Accelerated**: PyTorch with CPU fallback - **Modular Design**: Independent, reusable components - **Type Safe**: Comprehensive type hints - **Well Documented**: Docstrings on all public APIs ## Next Steps - Real-world testing with ComfyUI depth nodes - Performance benchmarking - Example workflow JSON files - Community release preparation ## Statistics - 15 ComfyUI nodes - ~2,500 lines of core code - ~1,000 lines of tests and utils - 100% Windows compatible - Ready for integration testing Based on DreamCube (ICCV 2025) by Yukun Huang et al. https://github.com/yukun-huang/DreamCube
46 lines
1.1 KiB
Python
46 lines
1.1 KiB
Python
"""
|
|
ComfyUI-DreamCube Core Package
|
|
|
|
Core algorithms for cubemap projection and depth processing.
|
|
"""
|
|
|
|
from .cubemap import CubemapData, create_empty_cubemap, create_cubemap_from_faces
|
|
from .projection import (
|
|
equirect_to_cubemap,
|
|
equirect_to_cubemap_fast,
|
|
cubemap_to_equirect,
|
|
cubemap_to_equirect_fast,
|
|
face_coords_to_vector,
|
|
vector_to_lonlat,
|
|
lonlat_to_vector,
|
|
vector_to_face_coords
|
|
)
|
|
from .depth_interface import DepthModelInterface
|
|
from .consistency import DepthConsistencyEnforcer
|
|
from .synchronization import (
|
|
SyncedSelfAttention,
|
|
SyncedConv2d,
|
|
SyncedGroupNorm,
|
|
MultiplaneSyncProcessor
|
|
)
|
|
|
|
__all__ = [
|
|
"CubemapData",
|
|
"create_empty_cubemap",
|
|
"create_cubemap_from_faces",
|
|
"equirect_to_cubemap",
|
|
"equirect_to_cubemap_fast",
|
|
"cubemap_to_equirect",
|
|
"cubemap_to_equirect_fast",
|
|
"face_coords_to_vector",
|
|
"vector_to_lonlat",
|
|
"lonlat_to_vector",
|
|
"vector_to_face_coords",
|
|
"DepthModelInterface",
|
|
"DepthConsistencyEnforcer",
|
|
"SyncedSelfAttention",
|
|
"SyncedConv2d",
|
|
"SyncedGroupNorm",
|
|
"MultiplaneSyncProcessor"
|
|
]
|