Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions comfy_api/latest/_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,17 @@ class CameraInfo(TypedDict):
Type = CameraInfo


@comfytype(io_type="LOAD3D_MODEL_INFO")
class Load3DModelInfo(ComfyTypeIO):
class Model3DTransform(TypedDict):
# Coordinate system: right-handed, Y-up, world space
position: dict[str, float | int] # scene units
quaternion: dict[str, float | int] # normalized, dimensionless; world rotation
scale: dict[str, float | int] # dimensionless multiplier

Type = list[Model3DTransform]


@comfytype(io_type="LOAD_3D")
class Load3D(ComfyTypeIO):
"""3D models are stored as a dictionary."""
Expand All @@ -786,6 +797,7 @@ class Model3DDict(TypedDict):
normal: str
camera_info: Load3DCamera.CameraInfo
recording: NotRequired[str]
model_3d_info: NotRequired[list[Load3DModelInfo.Model3DTransform]]

Type = Model3DDict

Expand Down Expand Up @@ -2298,6 +2310,7 @@ def as_dict(self):
"FlowControl",
"Accumulation",
"Load3DCamera",
"Load3DModelInfo",
"Load3D",
"Load3DAnimation",
"Photomaker",
Expand Down
4 changes: 3 additions & 1 deletion comfy_extras/nodes_load_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ def define_schema(cls):
IO.Load3DCamera.Output(display_name="camera_info"),
IO.Video.Output(display_name="recording_video"),
IO.File3DAny.Output(display_name="model_3d"),
IO.Load3DModelInfo.Output(display_name="model_3d_info"),
],
)

Expand All @@ -73,7 +74,8 @@ def execute(cls, model_file, image, **kwargs) -> IO.NodeOutput:
if model_file and model_file != "none":
file_3d = Types.File3D(folder_paths.get_annotated_filepath(model_file))
mesh_path = model_file
return IO.NodeOutput(output_image, output_mask, mesh_path, normal_image, image['camera_info'], video, file_3d)
model_3d_info = image.get('model_3d_info', [])
return IO.NodeOutput(output_image, output_mask, mesh_path, normal_image, image['camera_info'], video, file_3d, model_3d_info)

process = execute # TODO: remove

Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comfyui-frontend-package==1.44.19
comfyui-workflow-templates==0.9.85
comfyui-workflow-templates==0.9.91
comfyui-embedded-docs==0.5.1
torch
torchsde
Expand Down
Loading