feat: add model_info output to Load3D node (#14144)
Some checks are pending
Detect Unreviewed Merge / detect (push) Waiting to run
Python Linting / Run Ruff (push) Waiting to run
Python Linting / Run Pylint (push) Waiting to run
Build package / Build Test (3.10) (push) Waiting to run
Build package / Build Test (3.11) (push) Waiting to run
Build package / Build Test (3.12) (push) Waiting to run
Build package / Build Test (3.13) (push) Waiting to run
Build package / Build Test (3.14) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.10, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.11, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-stable (12.1, , linux, 3.12, [self-hosted Linux], stable) (push) Waiting to run
Full Comfy CI Workflow Runs / test-unix-nightly (12.1, , linux, 3.11, [self-hosted Linux], nightly) (push) Waiting to run
Execution Tests / test (macos-latest) (push) Waiting to run
Execution Tests / test (ubuntu-latest) (push) Waiting to run
Execution Tests / test (windows-latest) (push) Waiting to run
Test server launches without errors / test (push) Waiting to run
Unit Tests / test (macos-latest) (push) Waiting to run
Unit Tests / test (ubuntu-latest) (push) Waiting to run
Unit Tests / test (windows-2022) (push) Waiting to run

This commit is contained in:
Terry Jia 2026-05-29 03:06:00 -04:00 committed by GitHub
parent b10a61615c
commit e7214d78ee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View File

@ -777,6 +777,17 @@ class Load3DCamera(ComfyTypeIO):
Type = CameraInfo 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") @comfytype(io_type="LOAD_3D")
class Load3D(ComfyTypeIO): class Load3D(ComfyTypeIO):
"""3D models are stored as a dictionary.""" """3D models are stored as a dictionary."""
@ -786,6 +797,7 @@ class Load3D(ComfyTypeIO):
normal: str normal: str
camera_info: Load3DCamera.CameraInfo camera_info: Load3DCamera.CameraInfo
recording: NotRequired[str] recording: NotRequired[str]
model_3d_info: NotRequired[list[Load3DModelInfo.Model3DTransform]]
Type = Model3DDict Type = Model3DDict
@ -2298,6 +2310,7 @@ __all__ = [
"FlowControl", "FlowControl",
"Accumulation", "Accumulation",
"Load3DCamera", "Load3DCamera",
"Load3DModelInfo",
"Load3D", "Load3D",
"Load3DAnimation", "Load3DAnimation",
"Photomaker", "Photomaker",

View File

@ -47,6 +47,7 @@ class Load3D(IO.ComfyNode):
IO.Load3DCamera.Output(display_name="camera_info"), IO.Load3DCamera.Output(display_name="camera_info"),
IO.Video.Output(display_name="recording_video"), IO.Video.Output(display_name="recording_video"),
IO.File3DAny.Output(display_name="model_3d"), IO.File3DAny.Output(display_name="model_3d"),
IO.Load3DModelInfo.Output(display_name="model_3d_info"),
], ],
) )
@ -73,7 +74,8 @@ class Load3D(IO.ComfyNode):
if model_file and model_file != "none": if model_file and model_file != "none":
file_3d = Types.File3D(folder_paths.get_annotated_filepath(model_file)) file_3d = Types.File3D(folder_paths.get_annotated_filepath(model_file))
mesh_path = 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 process = execute # TODO: remove