mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-01-10 18:05:16 +00:00
add fov and mask for load 3d node (#6308)
* add fov and mask for load 3d node * some comments
This commit is contained in:
parent
a39ea87bca
commit
953693b137
@ -26,6 +26,7 @@ class Load3D():
|
|||||||
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
|
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
|
||||||
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
||||||
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
|
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
|
||||||
|
"fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}),
|
||||||
}}
|
}}
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE", "MASK", "STRING")
|
RETURN_TYPES = ("IMAGE", "MASK", "STRING")
|
||||||
@ -37,13 +38,22 @@ class Load3D():
|
|||||||
CATEGORY = "3d"
|
CATEGORY = "3d"
|
||||||
|
|
||||||
def process(self, model_file, image, **kwargs):
|
def process(self, model_file, image, **kwargs):
|
||||||
imagepath = folder_paths.get_annotated_filepath(image)
|
if isinstance(image, dict):
|
||||||
|
image_path = folder_paths.get_annotated_filepath(image['image'])
|
||||||
|
mask_path = folder_paths.get_annotated_filepath(image['mask'])
|
||||||
|
|
||||||
load_image_node = nodes.LoadImage()
|
load_image_node = nodes.LoadImage()
|
||||||
|
output_image, ignore_mask = load_image_node.load_image(image=image_path)
|
||||||
|
ignore_image, output_mask = load_image_node.load_image(image=mask_path)
|
||||||
|
|
||||||
output_image, output_mask = load_image_node.load_image(image=imagepath)
|
return output_image, output_mask, model_file,
|
||||||
|
else:
|
||||||
return output_image, output_mask, model_file,
|
# to avoid the format is not dict which will happen the FE code is not compatibility to core,
|
||||||
|
# we need to this to double-check, it can be removed after merged FE into the core
|
||||||
|
image_path = folder_paths.get_annotated_filepath(image)
|
||||||
|
load_image_node = nodes.LoadImage()
|
||||||
|
output_image, output_mask = load_image_node.load_image(image=image_path)
|
||||||
|
return output_image, output_mask, model_file,
|
||||||
|
|
||||||
class Load3DAnimation():
|
class Load3DAnimation():
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -67,6 +77,7 @@ class Load3DAnimation():
|
|||||||
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
||||||
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
|
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
|
||||||
"animation_speed": (["0.1", "0.5", "1", "1.5", "2"], {"default": "1"}),
|
"animation_speed": (["0.1", "0.5", "1", "1.5", "2"], {"default": "1"}),
|
||||||
|
"fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}),
|
||||||
}}
|
}}
|
||||||
|
|
||||||
RETURN_TYPES = ("IMAGE", "MASK", "STRING")
|
RETURN_TYPES = ("IMAGE", "MASK", "STRING")
|
||||||
@ -78,13 +89,20 @@ class Load3DAnimation():
|
|||||||
CATEGORY = "3d"
|
CATEGORY = "3d"
|
||||||
|
|
||||||
def process(self, model_file, image, **kwargs):
|
def process(self, model_file, image, **kwargs):
|
||||||
imagepath = folder_paths.get_annotated_filepath(image)
|
if isinstance(image, dict):
|
||||||
|
image_path = folder_paths.get_annotated_filepath(image['image'])
|
||||||
|
mask_path = folder_paths.get_annotated_filepath(image['mask'])
|
||||||
|
|
||||||
load_image_node = nodes.LoadImage()
|
load_image_node = nodes.LoadImage()
|
||||||
|
output_image, ignore_mask = load_image_node.load_image(image=image_path)
|
||||||
|
ignore_image, output_mask = load_image_node.load_image(image=mask_path)
|
||||||
|
|
||||||
output_image, output_mask = load_image_node.load_image(image=imagepath)
|
return output_image, output_mask, model_file,
|
||||||
|
else:
|
||||||
return output_image, output_mask, model_file,
|
image_path = folder_paths.get_annotated_filepath(image)
|
||||||
|
load_image_node = nodes.LoadImage()
|
||||||
|
output_image, output_mask = load_image_node.load_image(image=image_path)
|
||||||
|
return output_image, output_mask, model_file,
|
||||||
|
|
||||||
class Preview3D():
|
class Preview3D():
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -98,6 +116,7 @@ class Preview3D():
|
|||||||
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
|
"bg_color": ("STRING", {"default": "#000000", "multiline": False}),
|
||||||
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
|
||||||
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
|
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
|
||||||
|
"fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}),
|
||||||
}}
|
}}
|
||||||
|
|
||||||
OUTPUT_NODE = True
|
OUTPUT_NODE = True
|
||||||
|
Loading…
Reference in New Issue
Block a user