Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

Add node for preview 3d animation (#6594)

Terry Jia768e03586870
diff --git a/comfy_extras/nodes_load_3d.py b/comfy_extras/nodes_load_3d.py
index 436131aba..3b969e45f 100644
--- a/comfy_extras/nodes_load_3d.py
+++ b/comfy_extras/nodes_load_3d.py
@@ -20,7 +20,6 @@ class Load3D():
"width": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
"height": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
"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"],),
"fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}),
@@ -67,10 +66,8 @@ class Load3DAnimation():
"width": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
"height": ("INT", {"default": 1024, "min": 1, "max": 4096, "step": 1}),
"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"],),
- "animation_speed": (["0.1", "0.5", "1", "1.5", "2"], {"default": "1"}),
"fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}),
}}
@@ -104,7 +101,28 @@ class Preview3D():
return {"required": {
"model_file": ("STRING", {"default": "", "multiline": False}),
"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"],),
+ "fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}),
+ }}
+
+ OUTPUT_NODE = True
+ RETURN_TYPES = ()
+
+ CATEGORY = "3d"
+
+ FUNCTION = "process"
+ EXPERIMENTAL = True
+
+ def process(self, model_file, **kwargs):
+ return {"ui": {"model_file": [model_file]}, "result": ()}
+
+class Preview3DAnimation():
+ @classmethod
+ def INPUT_TYPES(s):
+ return {"required": {
+ "model_file": ("STRING", {"default": "", "multiline": False}),
+ "material": (["original", "normal", "wireframe", "depth"],),
"light_intensity": ("INT", {"default": 10, "min": 1, "max": 20, "step": 1}),
"up_direction": (["original", "-x", "+x", "-y", "+y", "-z", "+z"],),
"fov": ("INT", {"default": 75, "min": 10, "max": 150, "step": 1}),
@@ -124,11 +142,13 @@ class Preview3D():
NODE_CLASS_MAPPINGS = {
"Load3D": Load3D,
"Load3DAnimation": Load3DAnimation,
- "Preview3D": Preview3D
+ "Preview3D": Preview3D,
+ "Preview3DAnimation": Preview3DAnimation
}
NODE_DISPLAY_NAME_MAPPINGS = {
"Load3D": "Load 3D",
"Load3DAnimation": "Load 3D - Animation",
- "Preview3D": "Preview 3D"
+ "Preview3D": "Preview 3D",
+ "Preview3DAnimation": "Preview 3D - Animation"
}