Skip to content

The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.

[Partner Nodes] feat(Meshy): add Meshy T2.5 Smart Topology tnodes (#17280)

Alexander Piskundc0486a538d3
diff --git a/comfy_api_nodes/apis/meshy.py b/comfy_api_nodes/apis/meshy.py
index 4944cabcf..4cf3c5940 100644
--- a/comfy_api_nodes/apis/meshy.py
+++ b/comfy_api_nodes/apis/meshy.py
@@ -97,6 +97,30 @@ class MeshyMultiImageToModelRequest(BaseModel):
moderation: bool = Field(False)
+class MeshySmartTopologyTextToModelRequest(BaseModel):
+ mode: str = Field("preview")
+ model_type: str = Field("smart-topology")
+ prompt: str = Field(...)
+ ai_model: str = Field(...)
+ target_polycount: int = Field(...)
+ pose_mode: str = Field(...)
+ seed: int = Field(...)
+
+
+class MeshySmartTopologyImageToModelRequest(BaseModel):
+ image_url: str = Field(...)
+ model_type: str = Field("smart-topology")
+ ai_model: str = Field(...)
+ target_polycount: int = Field(...)
+ should_texture: bool = Field(...)
+ enable_pbr: bool | None = Field(...)
+ texture_resolution: str | None = Field(...)
+ texture_prompt: str | None = Field(...)
+ texture_image_url: str | None = Field(...)
+ pose_mode: str = Field(...)
+ seed: int = Field(...)
+
+
class MeshyRiggingRequest(BaseModel):
input_task_id: str = Field(...)
height_meters: float = Field(...)
diff --git a/comfy_api_nodes/nodes_heygen.py b/comfy_api_nodes/nodes_heygen.py
index ef0817b1d..c332ba2be 100644
--- a/comfy_api_nodes/nodes_heygen.py
+++ b/comfy_api_nodes/nodes_heygen.py
@@ -1253,9 +1253,10 @@ class HeyGenVoiceTextToSpeechNode(IO.ComfyNode):
expr="""
(
$t := $lookup(widgets, "model.text");
+ $promo := $now() < "2026-11-01T00:00:00.000Z";
$rate := widgets.model = "heygen-voice-1-turbo"
- ? 0.00572
- : ($now() < "2026-11-01T00:00:00.000Z" ? 0.02145 : 0.0429);
+ ? ($promo ? 0.00572 : 0.010725)
+ : ($promo ? 0.02145 : 0.0429);
$type($t) = "string" and $length($t) > 0
? {"type":"usd","usd": $length($t) * $rate / 1000}
: {"type":"usd","usd": $rate, "format":{"approximate":true,"suffix":"/1K chars"}}
diff --git a/comfy_api_nodes/nodes_meshy.py b/comfy_api_nodes/nodes_meshy.py
index 701a28e60..e42c2382b 100644
--- a/comfy_api_nodes/nodes_meshy.py
+++ b/comfy_api_nodes/nodes_meshy.py
@@ -12,6 +12,8 @@ from comfy_api_nodes.apis.meshy import (
MeshyRefineTask,
MeshyRiggedResult,
MeshyRiggingRequest,
+ MeshySmartTopologyImageToModelRequest,
+ MeshySmartTopologyTextToModelRequest,
MeshyTaskResponse,
MeshyTextToModelRequest,
MeshyTextureRequest,
@@ -21,6 +23,7 @@ from comfy_api_nodes.util import (
download_url_to_file_3d,
poll_op,
sync_op,
+ upload_image_to_comfyapi,
upload_images_to_comfyapi,
validate_string,
)
@@ -666,6 +669,232 @@ class MeshyMultiImageToModelNode(IO.ComfyNode):
)
+class MeshyTextToModelSmartTopologyNode(IO.ComfyNode):
+
+ @classmethod
+ def define_schema(cls):
+ return IO.Schema(
+ node_id="MeshyTextToModelSmartTopologyNode",
+ display_name="Meshy: Text to Model (Smart Topology)",
+ category="partner/3d/Meshy",
+ description="Generate a game-ready triangle mesh directly at a target face count.",
+ search_aliases=["meshy t2.5", "low poly"],
+ inputs=[
+ IO.Combo.Input("model", options=["meshy-t2.5"]),
+ IO.String.Input("prompt", multiline=True, default=""),
+ IO.Int.Input(
+ "target_polycount",
+ default=15000,
+ min=100,
+ max=30000,
+ display_mode=IO.NumberDisplay.number,
+ tooltip="Approximate number of triangles in the generated mesh.",
+ ),
+ IO.Combo.Input("pose_mode", options=["", "A-pose", "T-pose"], advanced=True),
+ IO.Int.Input(
+ "seed",
+ default=42,
+ min=0,
+ max=2147483647,
+ display_mode=IO.NumberDisplay.number,
+ control_after_generate=True,
+ tooltip="Seed controls whether the node should re-run; "
+ "results are non-deterministic regardless of seed.",
+ ),
+ ],
+ outputs=[
+ IO.Custom("MESHY_TASK_ID").Output(display_name="meshy_task_id"),
+ IO.File3DGLB.Output(display_name="GLB"),
+ IO.File3DFBX.Output(display_name="FBX"),
+ ],
+ hidden=[
+ IO.Hidden.auth_token_comfy_org,
+ IO.Hidden.api_key_comfy_org,
+ IO.Hidden.unique_id,
+ ],
+ is_api_node=True,
+ price_badge=IO.PriceBadge(expr='{"type":"usd","usd":0.286}'),
+ )
+
+ @classmethod
+ async def execute(
+ cls,
+ model: str,
+ prompt: str,
+ target_polycount: int,
+ pose_mode: str,
+ seed: int,
+ ) -> IO.NodeOutput:
+ validate_string(prompt, field_name="prompt", min_length=1, max_length=800)
+ response = await sync_op(
+ cls,
+ ApiEndpoint(path="/proxy/meshy/openapi/v2/text-to-3d", method="POST"),
+ response_model=MeshyTaskResponse,
+ data=MeshySmartTopologyTextToModelRequest(
+ prompt=prompt,
+ ai_model=model,
+ target_polycount=target_polycount,
+ pose_mode=pose_mode.lower(),
+ seed=seed,
+ ),
+ )
+ task_id = response.result
+ result = await poll_op(
+ cls,
+ ApiEndpoint(path=f"/proxy/meshy/openapi/v2/text-to-3d/{task_id}"),
+ response_model=MeshyModelResult,
+ status_extractor=lambda r: r.status,
+ progress_extractor=lambda r: r.progress,
+ )
+ return IO.NodeOutput(
+ task_id,
+ await download_url_to_file_3d(result.model_urls.glb, "glb"),
+ await download_url_to_file_3d(result.model_urls.fbx, "fbx"),
+ )
+
+
+class MeshyImageToModelSmartTopologyNode(IO.ComfyNode):
+
+ @classmethod
+ def define_schema(cls):
+ return IO.Schema(
+ node_id="MeshyImageToModelSmartTopologyNode",
+ display_name="Meshy: Image to Model (Smart Topology)",
+ category="partner/3d/Meshy",
+ description="Generate a game-ready triangle mesh directly at a target face count.",
+ search_aliases=["meshy t2.5", "low poly"],
+ inputs=[
+ IO.Combo.Input("model", options=["meshy-t2.5"]),
+ IO.Image.Input("image"),
+ IO.Int.Input(
+ "target_polycount",
+ default=15000,
+ min=100,
+ max=30000,
+ display_mode=IO.NumberDisplay.number,
+ tooltip="Approximate number of triangles in the generated mesh.",
+ ),
+ IO.DynamicCombo.Input(
+ "should_texture",
+ options=[
+ IO.DynamicCombo.Option(
+ "true",
+ [
+ IO.Boolean.Input(
+ "enable_pbr",
+ default=False,
+ tooltip="Generate PBR Maps (metallic, roughness, normal) "
+ "in addition to the base color.",
+ ),
+ IO.String.Input(
+ "texture_prompt",
+ default="",
+ multiline=True,
+ tooltip="Provide a text prompt to guide the texturing process. "
+ "Maximum 800 characters. Cannot be used at the same time as 'texture_image'.",
+ ),
+ IO.Image.Input(
+ "texture_image",
+ tooltip="Only one of 'texture_image' or 'texture_prompt' "
+ "may be used at the same time.",
+ optional=True,
+ ),
+ IO.Combo.Input("texture_resolution", options=["2k", "4k", "8k"]),
+ ],
+ ),
+ IO.DynamicCombo.Option("false", []),
+ ],
+ ),
+ IO.Combo.Input("pose_mode", options=["", "A-pose", "T-pose"], advanced=True),
+ IO.Int.Input(
+ "seed",
+ default=42,
+ min=0,
+ max=2147483647,
+ display_mode=IO.NumberDisplay.number,
+ control_after_generate=True,
+ tooltip="Seed controls whether the node should re-run; "
+ "results are non-deterministic regardless of seed.",
+ ),
+ ],
+ outputs=[
+ IO.Custom("MESHY_TASK_ID").Output(display_name="meshy_task_id"),
+ IO.File3DGLB.Output(display_name="GLB"),
+ IO.File3DFBX.Output(display_name="FBX"),
+ ],
+ hidden=[
+ IO.Hidden.auth_token_comfy_org,
+ IO.Hidden.api_key_comfy_org,
+ IO.Hidden.unique_id,
+ ],
+ is_api_node=True,
+ price_badge=IO.PriceBadge(
+ depends_on=IO.PriceBadgeDepends(widgets=["should_texture", "should_texture.texture_resolution"]),
+ expr="""
+ (
+ $credits := widgets.should_texture = "true"
+ ? ($lookup(widgets, "should_texture.texture_resolution") = "8k" ? 20 : 15)
+ : 5;
+ {"type":"usd","usd": $credits * 0.0572}
+ )
+ """,
+ ),
+ )
+
+ @classmethod
+ async def execute(
+ cls,
+ model: str,
+ image: Input.Image,
+ target_polycount: int,
+ should_texture: InputShouldTexture,
+ pose_mode: str,
+ seed: int,
+ ) -> IO.NodeOutput:
+ texture = should_texture["should_texture"] == "true"
+ texture_image_url = texture_prompt = None
+ if texture:
+ if should_texture["texture_prompt"] and should_texture["texture_image"] is not None:
+ raise ValueError("texture_prompt and texture_image cannot be used at the same time")
+ if should_texture["texture_prompt"]:
+ validate_string(should_texture["texture_prompt"], field_name="texture_prompt", max_length=800)
+ texture_prompt = should_texture["texture_prompt"]
+ if should_texture["texture_image"] is not None:
+ texture_image_url = await upload_image_to_comfyapi(
+ cls, should_texture["texture_image"], wait_label="Uploading texture"
+ )
+ response = await sync_op(
+ cls,
+ ApiEndpoint(path="/proxy/meshy/openapi/v1/image-to-3d", method="POST"),
+ response_model=MeshyTaskResponse,
+ data=MeshySmartTopologyImageToModelRequest(
+ image_url=await upload_image_to_comfyapi(cls, image, wait_label="Uploading base image"),
+ ai_model=model,
+ target_polycount=target_polycount,
+ should_texture=texture,
+ enable_pbr=should_texture.get("enable_pbr", None),
+ texture_resolution=should_texture.get("texture_resolution", None),
+ texture_prompt=texture_prompt,
+ texture_image_url=texture_image_url,
+ pose_mode=pose_mode.lower(),
+ seed=seed,
+ ),
+ )
+ task_id = response.result
+ result = await poll_op(
+ cls,
+ ApiEndpoint(path=f"/proxy/meshy/openapi/v1/image-to-3d/{task_id}"),
+ response_model=MeshyModelResult,
+ status_extractor=lambda r: r.status,
+ progress_extractor=lambda r: r.progress,
+ )
+ return IO.NodeOutput(
+ task_id,
+ await download_url_to_file_3d(result.model_urls.glb, "glb"),
+ await download_url_to_file_3d(result.model_urls.fbx, "fbx"),
+ )
+
+
class MeshyRigModelNode(IO.ComfyNode):
@classmethod
@@ -1034,6 +1263,8 @@ class MeshyExtension(ComfyExtension):
MeshyRefineNode,
MeshyImageToModelNode,
MeshyMultiImageToModelNode,
+ MeshyTextToModelSmartTopologyNode,
+ MeshyImageToModelSmartTopologyNode,
MeshyRigModelNode,
MeshyAnimateModelNode,
MeshyTextureNode,