From 517669aaa3d583cab492673b43c8db4f1fa322ff Mon Sep 17 00:00:00 2001 From: Terry Jia Date: Tue, 17 Dec 2024 13:42:24 -0500 Subject: [PATCH] add preview 3d node (#6070) * add preview 3d node * mark 3d nodes as EXPERIMENTAL --- comfy_extras/nodes_load_3d.py | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/comfy_extras/nodes_load_3d.py b/comfy_extras/nodes_load_3d.py index 45254c5b..b72a357b 100644 --- a/comfy_extras/nodes_load_3d.py +++ b/comfy_extras/nodes_load_3d.py @@ -32,6 +32,7 @@ class Load3D(): RETURN_NAMES = ("image", "mask", "mesh_path") FUNCTION = "process" + EXPERIMENTAL = True CATEGORY = "3d" @@ -72,6 +73,7 @@ class Load3DAnimation(): RETURN_NAMES = ("image", "mask", "mesh_path") FUNCTION = "process" + EXPERIMENTAL = True CATEGORY = "3d" @@ -84,12 +86,39 @@ class Load3DAnimation(): return output_image, output_mask, model_file, +class Preview3D(): + @classmethod + def INPUT_TYPES(s): + return {"required": { + "model_file": ("STRING", {"default": "", "multiline": False}), + "show_grid": ([True, False],), + "camera_type": (["perspective", "orthographic"],), + "view": (["front", "right", "top", "isometric"],), + "material": (["original", "normal", "wireframe", "depth"],), + "bg_color": ("STRING", {"default": "#000000", "multiline": False}), + "light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}), + "up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],), + }} + + OUTPUT_NODE = True + RETURN_TYPES = () + + CATEGORY = "3d" + + FUNCTION = "process" + EXPERIMENTAL = True + + def process(self, model_file, **kwargs): + return {"ui": {"model_file": [model_file]}, "result": ()} + NODE_CLASS_MAPPINGS = { "Load3D": Load3D, - "Load3DAnimation": Load3DAnimation + "Load3DAnimation": Load3DAnimation, + "Preview3D": Preview3D } NODE_DISPLAY_NAME_MAPPINGS = { "Load3D": "Load 3D", - "Load3DAnimation": "Load 3D - Animation" + "Load3DAnimation": "Load 3D - Animation", + "Preview3D": "Preview 3D" } \ No newline at end of file