feat(api-nodes): add TencentSmartTopology node#12741
Conversation
02807fc to
c6c504e
Compare
📝 WalkthroughWalkthroughA new 🚥 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
comfy_api_nodes/nodes_hunyuan3d.py (1)
614-633: Validatepolygon_typeandface_levelbefore the API call.Line 614-Line 633 accept raw
strvalues and send them directly to Tencent. Add a local allowlist check to fail fast with clear errors instead of relying on remote validation.Suggested patch
async def execute( cls, model_3d: Types.File3D, polygon_type: str, face_level: str, seed: int, ) -> IO.NodeOutput: _ = seed file_format = model_3d.format.lower() if file_format not in cls.SUPPORTED_FORMATS: raise ValueError( f"Unsupported file format: '{file_format}'. " f"Supported: {', '.join(sorted(cls.SUPPORTED_FORMATS))}." ) + allowed_polygon_types = {"triangle", "quadrilateral"} + allowed_face_levels = {"low", "medium", "high"} + if polygon_type not in allowed_polygon_types: + raise ValueError( + f"Unsupported polygon_type: '{polygon_type}'. Supported: {', '.join(sorted(allowed_polygon_types))}." + ) + if face_level not in allowed_face_levels: + raise ValueError( + f"Unsupported face_level: '{face_level}'. Supported: {', '.join(sorted(allowed_face_levels))}." + ) model_url = await upload_3d_model_to_comfyapi(cls, model_3d, file_format) response = await sync_op(As per coding guidelines,
comfy_api_nodes/**integrations should have proper error handling for API failures.🤖 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 614 - 633, Add local allowlist validation for polygon_type and face_level before calling upload_3d_model_to_comfyapi and sync_op: define allowed sets for the polygon_type and face_level values expected by the Tencent endpoint, check the incoming polygon_type and face_level against those sets in the method (the same scope that references SUPPORTED_FORMATS, model_3d, upload_3d_model_to_comfyapi, SmartTopologyRequest), and raise a clear ValueError identifying the invalid parameter and showing allowed values if either is invalid; only proceed to upload_3d_model_to_comfyapi and the sync_op call when both values pass validation.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@comfy_api_nodes/nodes_hunyuan3d.py`:
- Line 605: Remove the billable badge addition until billing artifacts and tests
are updated: revert or remove the price_badge=IO.PriceBadge(...) entry (the
price_badge symbol / IO.PriceBadge usage) in the Hunyuan3D node definition so
the node is not marked billable in comfy_api_nodes/nodes_hunyuan3d.py; once the
Metronome rate cards and auto-billing tests are updated and passing,
re-introduce the price_badge with the agreed USD value and ensure corresponding
billing/test updates are committed together.
---
Nitpick comments:
In `@comfy_api_nodes/nodes_hunyuan3d.py`:
- Around line 614-633: Add local allowlist validation for polygon_type and
face_level before calling upload_3d_model_to_comfyapi and sync_op: define
allowed sets for the polygon_type and face_level values expected by the Tencent
endpoint, check the incoming polygon_type and face_level against those sets in
the method (the same scope that references SUPPORTED_FORMATS, model_3d,
upload_3d_model_to_comfyapi, SmartTopologyRequest), and raise a clear ValueError
identifying the invalid parameter and showing allowed values if either is
invalid; only proceed to upload_3d_model_to_comfyapi and the sync_op call when
both values pass validation.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
comfy_api_nodes/apis/hunyuan3d.pyis excluded by!comfy_api_nodes/apis/**
📒 Files selected for processing (1)
comfy_api_nodes/nodes_hunyuan3d.py
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@comfy_api_nodes/util/client.py`:
- Line 86: The shared constant QUEUED_STATUSES was broadened with "wait", which
changes polling behavior for all poll_op() callers; scope "wait" to Tencent
callers instead: remove "wait" from the QUEUED_STATUSES constant and update the
Tencent poll_op call sites (e.g., in nodes_hunyuan3d.py where poll_op(...) is
invoked for Tencent) to pass queued_statuses=[*QUEUED_STATUSES, "wait"] (or
equivalent explicit list) so only Tencent polling treats "wait" as a queued
status while other callers keep the original default.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 78759527-e109-4a00-af64-d2319ed4e5bd
📒 Files selected for processing (1)
comfy_api_nodes/util/client.py
API Node PR Checklist
Scope
Pricing & Billing
If Need pricing update:
QA
Comms