Skip to content

Commit 656c321

Browse files
authored
Fix bug in StereoToMonoScopic node
1 parent bc77b1f commit 656c321

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

__init__.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
E2CNode,
77
E2ENode,
88
E2PNode,
9-
MonoScopicToStereo,
9+
MonoScopicToStereoNode,
1010
Pad180To360Node,
1111
PasteImageWithCoordsNode,
1212
RollImageNode,
1313
SplitFacesNode,
1414
StackFacesNode,
15-
StereoToMonoScopic,
15+
StereoToMonoScopicNode,
1616
)
1717

1818
NODE_CLASS_MAPPINGS = {
@@ -28,8 +28,8 @@
2828
"Paste Image with Coords": PasteImageWithCoordsNode,
2929
"Pad 180 to 360 Equirectangular": Pad180To360Node,
3030
"Crop 360 to 180 Equirectangular": Crop360To180Node,
31-
"Crop Stereo to Monoscopic": StereoToMonoScopic,
32-
"Merge Monoscopic into Stereo": MonoScopicToStereo,
31+
"Crop Stereo to Monoscopic": StereoToMonoScopicNode,
32+
"Merge Monoscopic into Stereo": StereoToMonoScopicNode,
3333
}
3434

3535
NODE_DISPLAY_NAME_MAPPINGS = {

nodes.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -564,7 +564,7 @@ def crop_360_to_180_image(self, image: torch.Tensor) -> Tuple[torch.Tensor]:
564564
return (cropped_img,)
565565

566566

567-
class StereoToMonoScopic:
567+
class StereoToMonoScopicNode:
568568
"""
569569
Split a stereo image into 2 monoscopic images.
570570
"""
@@ -627,7 +627,7 @@ def split_stereo_image(
627627
"""
628628
_, height, width, channels = image.shape
629629

630-
if split_direction == "horizontal":
630+
if split_direction == "vertical":
631631
# Split horizontally (by height)
632632
mid_point = height // 2
633633
if height % 2 != 0: # If height is odd
@@ -641,7 +641,7 @@ def split_stereo_image(
641641
# Even height, just split in the middle
642642
first_half = image[:, :mid_point, :, :]
643643
second_half = image[:, mid_point:, :]
644-
elif split_direction == "vertical":
644+
elif split_direction == "horizontal":
645645
# Split vertically (by width)
646646
mid_point = width // 2
647647
if width % 2 != 0: # If width is odd
@@ -665,7 +665,7 @@ def split_stereo_image(
665665
return (first_half, second_half)
666666

667667

668-
class MonoScopicToStereo:
668+
class MonoScopicToStereoNode:
669669
"""
670670
Merge two monoscopic images into a stereo image.
671671
"""

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-pytorch360convert"
33
description = "A collection of custom nodes for working with and converting between 360 degree equirectangular images, cubemap, and perspective images. Panoramic 360 images are also sometimes known as VR photography (virtual reality), HDRI environments (ex: skyboxes), image spheres, spherical images, 360 pano."
4-
version = "1.0.2"
4+
version = "1.0.3"
55
license = {file = "LICENSE"}
66
dependencies = ["pytorch360convert"]
77

0 commit comments

Comments
 (0)