mirror of
https://github.com/Comfy-Org/comfy-remote-nodes.git
synced 2026-11-04 23:37:22 +00:00
[PR #20] [MERGED] Add MODEL_3D input encoder to close the encode-side gap #19
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-remote-nodes#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Comfy-Org/comfy-remote-nodes/pull/20
Author: @Kosinkadink
Created: 5/17/2026
Status: ✅ Merged
Merged: 5/17/2026
Merged by: @Kosinkadink
Base:
main← Head:feat/model3d-input-encoder📝 Commits (1)
01f71bdAdd MODEL_3D input encoder to close the encode-side gap📊 Changes
2 files changed (+88 additions, -1 deletions)
View changed files
📝
proxy_node.py(+2 -0)📝
serialization.py(+86 -1)📄 Description
Adds the symmetric client-side encoder for
File3Dvalues so a remote node descriptor can declare aMODEL_3Dinput and consume a 3D mesh from an upstream local node (e.g.Load3D,TencentTextToModelNode,MeshyTextToModelNode).Mirrors the existing AUDIO encoder (
encode_audio_input/is_audio_input) and VIDEO encoder (encode_video_input/is_video_input— PR #19) added atcomfy_remote_nodes/serialization.py:encode_model3d_input(file3d)reads the primary mesh bytes viaFile3D.get_data()(returns aBytesIO, percomfy_api.latest._util.geometry_types.File3D) and emits a{type: "model_3d", encoding: "glb_inline", data: b64, format: ...}envelope.encoding="glb_inline"is the generic single-file inline encoding the server-side decoder (decode_model3d_envelope) already dispatches on; the decoder hands the bytes toFile3D(BytesIO(...), format)regardless of whether the actual format is glb / obj / fbx / etc., so the encoding name is a logical "inline single-file 3D" tag and theformatextra picks the file extension at decode time.is_model3d_input(value)duck-types on theformatstring attribute +get_datacallable. Both are present on the upstreamFile3Dclass and theBundledFile3Dsubclass built lazily in_bundled_file3d_class(). Avoids importingFile3Dat module load (which would pull torch via thecomfy_apitree)._encode_oneinproxy_node.pydispatches AUDIO / VIDEO before MODEL_3D as defense-in-depth (theVideoInputshape —save_to+get_duration— does not expose aformatstring property, so VIDEO and MODEL_3D values don't collide either way).Multi-file bundles (
BundledFile3D-style values where every companion file matters — e.g. an OBJ with sibling .mtl + texture PNGs) are intentionally not supported on the encode path in this PR: the first server consumer is the Tencent Hunyuan3D MODEL_3D-input node family (TencentModelTo3DUVNode/Tencent3DPartNode/Tencent3DTextureEditNode/TencentSmartTopologyNode), and the upstream upload helperupload_3d_model_to_comfyapi(cls, model_3d, file_format)only uploads a single file (model_3d.get_data()). Bundle encode (bundle_inline) lands when a partner node actually needs the companion bytes.This unblocks 4 Tencent Hunyuan3D nodes (out of 6 in the module) that were deferred to a follow-up PR — see matrix coverage TODO #6. First server consumers ship in a paired comfy-rnp-server PR (
TencentModelTo3DUVNode_RNP+Tencent3DPartNode_RNP).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.