[Partner Nodes] make "obj" output optional in Hunyuan3D Text and Image to 3D#13449
[Partner Nodes] make "obj" output optional in Hunyuan3D Text and Image to 3D#13449comfyui-wiki merged 3 commits intomasterfrom
Conversation
…e to 3D Signed-off-by: bigcat88 <bigcat88@icloud.com>
📝 WalkthroughWalkthroughThe PR modifies two execute implementations to make OBJ file extraction optional instead of required. Previously, missing OBJ files would cause errors. Now, the code calls 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
comfy_api_nodes/nodes_hunyuan3d.py (1)
384-408: Minor: inconsistent fallback between OBJ-present vs OBJ-absent branches.When the OBJ archive is present but a specific PBR map is missing, the code falls back to
torch.zeros(1, 1, 1, 3)formetallic/normal/roughness(lines 394-396). When the OBJ archive is entirely absent, those same outputs becomeNone(lines 405-407). Same goes fortexture_image:obj_result.texturemay beNoneeven with OBJ present (line 393), but no zero-tensor fallback is applied there either.This is functionally fine (downstream nodes can handle
None), but the asymmetry is a tiny papercut for graph authors who may need to special-case bothNoneand a 1×1×1×3 zero tensor. Consider unifying — either always emitNonewhen missing, or always emit a zero-tensor placeholder. Not blocking.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@comfy_api_nodes/nodes_hunyuan3d.py` around lines 384 - 408, Unify the missing-PBR/map fallback behavior so both branches emit the same types: update the OBJ-present branch (where get_file_from_response, download_and_extract_obj_zip, and obj_result are used) to return the same None placeholders used in the OBJ-absent branch (or conversely change the OBJ-absent branch to use torch.zeros(1,1,1,3) placeholders) for metallic/normal/roughness and texture_image so IO.NodeOutput always has a consistent schema; adjust the construction of the IO.NodeOutput return values to use the chosen common fallback (reference obj_result, torch.zeros, download_url_to_file_3d and IO.NodeOutput to locate the code).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@comfy_api_nodes/nodes_hunyuan3d.py`:
- Around line 384-408: Unify the missing-PBR/map fallback behavior so both
branches emit the same types: update the OBJ-present branch (where
get_file_from_response, download_and_extract_obj_zip, and obj_result are used)
to return the same None placeholders used in the OBJ-absent branch (or
conversely change the OBJ-absent branch to use torch.zeros(1,1,1,3)
placeholders) for metallic/normal/roughness and texture_image so IO.NodeOutput
always has a consistent schema; adjust the construction of the IO.NodeOutput
return values to use the chosen common fallback (reference obj_result,
torch.zeros, download_url_to_file_3d and IO.NodeOutput to locate the code).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 5c4af8d2-0181-4c7a-a0c1-3d7b7e70266e
📒 Files selected for processing (1)
comfy_api_nodes/nodes_hunyuan3d.py
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms