Visit ComfyUI Online for ready-to-use ComfyUI environment
Generates stereoscopic 3D images from RGB input and depth map, enhancing visual experience with depth perception.
The JNodes_CreateStereoscopicImageFromDepth
node is designed to generate a stereoscopic 3D image from a given RGB input image and its corresponding depth map. This node leverages the depth information to create a perception of depth, resulting in a 3D effect that can be viewed using stereoscopic methods. The primary benefit of this node is its ability to transform 2D images into immersive 3D visuals, enhancing the visual experience. It supports two modes of stereoscopic image creation: side-by-side (SBS) and over-under (OU), and offers the flexibility to swap the left and right images if needed. This node is particularly useful for AI artists looking to add a 3D dimension to their artwork, making it more engaging and visually appealing.
The input_image
parameter is the RGB input image that you want to convert into a stereoscopic image. It should be provided as a PyTorch tensor with the shape [1, height, width, 3]
. This image serves as the base for generating the 3D effect.
The depth_map
parameter is the depth map corresponding to the input image, also provided as a PyTorch tensor with the shape [1, height, width, 3]
. The depth map contains information about the distance of each pixel from the viewer, which is crucial for creating the stereoscopic effect.
The max_disparity
parameter defines the maximum disparity value used to create the 3D effect. It is an integer value with a default of 1000. This parameter controls the extent of the depth effect, with higher values resulting in a more pronounced 3D effect.
The mode
parameter specifies the format of the stereoscopic image. It can be set to either side-by-side (SBS)
or over-under (OU)
. This determines how the left and right images are combined to create the final stereoscopic image.
The swap_images
parameter is a boolean that, when set to True
, swaps the left and right images in the final stereoscopic image. This can be useful if the initial left and right images are not in the desired order. The default value is False
.
The output parameter IMAGE
is the resulting stereoscopic image, provided as a PyTorch tensor. This image combines the left and right views based on the specified mode (SBS or OU) and incorporates the depth information to create a 3D effect. The output can be used for further processing or directly for viewing with appropriate stereoscopic equipment.
input_image
and depth_map
have the same dimensions to avoid mismatches during processing.max_disparity
values to achieve the desired depth effect. Higher values will create a more pronounced 3D effect.swap_images
parameter if the left and right images appear reversed in the final output.mode
that best suits your viewing method: side-by-side (SBS)
for VR headsets or over-under (OU)
for certain 3D displays.mode
parameter.mode
parameter is set to either side-by-side (SBS)
or over-under (OU)
.input_image
and depth_map
do not match.input_image
and depth_map
have the same height and width dimensions before passing them to the node.input_image
or depth_map
tensors do not have the expected shape [1, height, width, 3]
.input_image
and depth_map
are provided as PyTorch tensors with the correct shape.© Copyright 2024 RunComfy. All Rights Reserved.