Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Write commands in two layers:

If you find yourself writing a literal model name, template name, or node id into a command, stop and point the agent at the tool that returns the current set instead. That keeps the command correct as the catalog moves, and it keeps the agent from going off on a tangent before it engages the right tool.

- **Build steps must leave the user a canvas-readable artifact: titled nodes + a saved workflow link.** Any step that has the agent build a workflow JSON tells it to give every node a `_meta.title` naming its role, and, when the user asked for a workflow rather than just an output, to `save_workflow` it and return the `get_workflow_canvas_url` link.
- **Build steps must leave the user a canvas-readable artifact: titled nodes + a saved workflow link.** Any step that has the agent build a workflow JSON tells it to give every node a `_meta.title` naming its role, and, when the user asked for a workflow rather than just an output, to `save_workflow` it with `overwrite: false` (a new name on collision, never replacing the user's existing workflow) and return the `get_workflow_canvas_url` link for the `workflow_id` the save returned (looked up with `list_saved_workflows` if the result omits it) — never by filename, which publishes a public share snapshot.

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions claude-code/commands/generate-3d.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Generate a 3D model using Comfy Cloud based on the user's description: $ARGUMENT

Approach: prefer a ready-made template over hand-building, and discover the current options with the tools rather than assuming a fixed catalog. Model, node, and template availability changes over time, so let the tools tell you what exists right now.

**Step 0 - Partner-API shortcut.** If the user named a provider or capability (Meshy, Tripo, Rodin, Tencent, and so on), find the matching node with `search_nodes` filtered by `category: "partner/3d"` (optionally add a `q` for the provider name). If a matching `partner/3d/...` node exists, try `partner_generate` first with `type: "3d"` and that provider's model slug, plus `prompt` and any optional fields (`seed`, `medias[]`). On success, return the artifact URL(s) and stop. If it returns "unknown model" or "not yet implemented", or says it "does not serve type" (3D has no `partner_generate` persist path today), continue below — the template path in step 1 does generate 3D on Comfy Cloud. `partner_generate` returns only the output, never a workflow: if the user asked to BUILD or CREATE a workflow (not just for an output), skip `partner_generate` and continue to Step 1, wiring the matching partner node into the workflow you build.
**Step 0 - Partner-API shortcut.** If the user named a provider or capability (Meshy, Tripo, Rodin, Tencent, and so on), find the matching node with `search_nodes` filtered by `category: "partner/3d"` (optionally add a `q` for the provider name). `partner_generate` returns only the output, never a workflow: if the user asked to BUILD or CREATE a workflow (not just for an output), skip `partner_generate` and continue to Step 1, wiring the matching partner node into the workflow you build. If a matching `partner/3d/...` node exists, try `partner_generate` first with `type: "3d"` and that provider's model slug, plus `prompt` and any optional fields (`seed`, `medias[]`). On success, return the artifact URL(s) and stop. If it returns "unknown model" or "not yet implemented", or says it "does not serve type" (3D has no `partner_generate` persist path today), continue below — the template path in step 1 does generate 3D on Comfy Cloud.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved

1. **Look for a template first.** Call `search_templates` with `tag: "Image to 3D"` (image-to-3D is the common case), and/or `q: "3d"` for the broader set. If a suitable template comes back, clone it as your base workflow: swap in the user's input (such as the reference image) and adjust settings instead of building from scratch. Cloning a template is almost always faster than hand-wiring nodes, so spend real effort here before falling through to step 2.

Expand Down Expand Up @@ -35,7 +35,7 @@ Approach: prefer a ready-made template over hand-building, and discover the curr

9. Tell the user where the files were saved. 3D outputs may include mesh files (.obj, .glb), textures, or rendered preview images.

10. If the user asked to BUILD or CREATE a workflow (not just for an output), after the run completes call `save_workflow` with the same JSON and a descriptive `name`, then `get_workflow_canvas_url` with the returned workflow id, and give the user that link. Mention that the saved layout is auto-generated and may need tidying. If you ran a subgraph template instead, tell the user the canvas shows one collapsed subgraph node and how to open it (double-click the node body, not its title, to step inside it, or right-click it and choose Unpack Subgraph to flatten it onto the canvas).
10. If the user asked to BUILD or CREATE a workflow (not just for an output), after the run completes call `save_workflow` with the same JSON, a descriptive `name`, and `overwrite: false` — on a name collision choose a new name rather than replacing the user's existing workflow. Then call `get_workflow_canvas_url` with the `workflow_id` from the save result; if the save result omits `workflow_id`, find it with `list_saved_workflows` — never pass the filename (`saved_workflow_filename` publishes a PUBLIC share snapshot). If you ran a template with `run_template`, call `get_template`, apply the same `input_overrides` you ran with to that body (same node ids or slot paths; inputs you did not override keep the template defaults), and `save_workflow` the result instead, so the canvas matches the run. Give the user the canvas link. Mention that the saved layout is auto-generated and may need tidying. If you ran a subgraph template instead, tell the user the canvas shows one collapsed subgraph node and how to open it (double-click the node body, not its title, to step inside it, or right-click it and choose Unpack Subgraph to flatten it onto the canvas).

11. **If the user asks to adjust the result** (different seed, prompt wording, steps/cfg, resolution, a different reference image) rather than a new subject: do NOT rebuild the workflow and do NOT re-send the JSON. Call `submit_workflow` with `from_prompt_id` set to the prompt_id of the run being adjusted and `input_overrides` holding ONLY the changed inputs ({nodeId: {inputName: value}}). If you do not know the node id, call `get_job_status` with `include_workflow: true` on that prompt_id first. A new reference image still goes through `upload_file` first; override the loader node's input with the returned filename. Then continue from step 7. If the result came from Step 0's `partner_generate` rather than a submitted workflow, there is no workflow to rerun: call `partner_generate` again with the changed fields. If the user wants the 3D MODEL itself edited (e.g. "keep this exact mesh, just retexture it") rather than the workflow's inputs changed, use `use_previous_output` / `partner_generate medias[]` instead.

Expand Down
4 changes: 2 additions & 2 deletions claude-code/commands/generate-audio.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Generate audio using Comfy Cloud based on the user's description: $ARGUMENTS

Follow these steps exactly:

**Step 0 — Route partner-API requests directly.** If the user named a provider, model, or capability (e.g. "ElevenLabs", "Stability Audio", "Sonilo"), do one `search_nodes` lookup with the named term. If the matching node's category starts with `partner/`, try `partner_generate` first — its description names providers, not model ids, so pass `type: "audio"` plus your best-guess model slug (a wrong one rejects **before queuing** and bounces back naming the closest real slugs, `Did you mean: …`), `prompt`, and any optional fields (`seed`/`duration`/`medias[]`). On a bounce, re-call once with the slug it names if it keeps the provider prefix of the slug you guessed (a `kling/…` suggestion for a `kling/…` guess), plus any `params.model` tier the bounce names (a tier-shaped guess is redirected to `<slug>` + `params: {"model": "<tier>"}`; re-calling the bare slug runs that entry's default tier at a different price), and say which slug you switched to. If that re-call bounces too, do not re-call again — handle it as "unknown model" with no close match named (below). The suggestions are ranked by token overlap across the whole registry, so one can belong to a provider the user never named — if none keeps your guess's provider prefix, do not re-call (the re-call is the call that queues and charges): stop and ask the user which model to use; inside `submit_batch` resend only the bounced item — its siblings may already be queued and charged. On success, return the artifact URL(s) and **stop** — do NOT continue with the workflow steps below. If `partner_generate` returns "unknown model" with no close match named, or "not yet implemented", or the matching node has no `partner/` prefix (OSS model), continue to Step 1. `partner_generate` returns only the output, never a workflow: if the user asked to BUILD or CREATE a workflow (not just for an output), skip `partner_generate` and continue to Step 1, wiring the matching partner node into the workflow you build.
**Step 0 — Route partner-API requests directly.** If the user named a provider, model, or capability (e.g. "ElevenLabs", "Stability Audio", "Sonilo"), do one `search_nodes` lookup with the named term. `partner_generate` returns only the output, never a workflow: if the user asked to BUILD or CREATE a workflow (not just for an output), skip `partner_generate` and continue to Step 1, wiring the matching node into the workflow you build if its category starts with `partner/` (an OSS match takes the normal steps below). If the matching node's category starts with `partner/`, try `partner_generate` first — its description names providers, not model ids, so pass `type: "audio"` plus your best-guess model slug (a wrong one rejects **before queuing** and bounces back naming the closest real slugs, `Did you mean: …`), `prompt`, and any optional fields (`seed`/`duration`/`medias[]`). On a bounce, re-call once with the slug it names if it keeps the provider prefix of the slug you guessed (a `kling/…` suggestion for a `kling/…` guess), plus any `params.model` tier the bounce names (a tier-shaped guess is redirected to `<slug>` + `params: {"model": "<tier>"}`; re-calling the bare slug runs that entry's default tier at a different price), and say which slug you switched to. If that re-call bounces too, do not re-call again — handle it as "unknown model" with no close match named (below). The suggestions are ranked by token overlap across the whole registry, so one can belong to a provider the user never named — if none keeps your guess's provider prefix, do not re-call (the re-call is the call that queues and charges): stop and ask the user which model to use; inside `submit_batch` resend only the bounced item — its siblings may already be queued and charged. On success, return the artifact URL(s) and **stop** — do NOT continue with the workflow steps below. If `partner_generate` returns "unknown model" with no close match named, or "not yet implemented", or the matching node has no `partner/` prefix (OSS model), continue to Step 1.

1. Use `search_templates` with queries like "audio generation", "text to audio", "music generation", or "sound effects" and set `media_type` to "audio" to find a pre-built audio workflow template. If a good template exists, use it as the base workflow instead of building from scratch.

Expand All @@ -30,7 +30,7 @@ Follow these steps exactly:

8. Tell the user where the audio file was saved and how to play it. Audio outputs are saved to disk but not previewed inline.

9. If the user asked to BUILD or CREATE a workflow (not just for an output), after the run completes call `save_workflow` with the same JSON and a descriptive `name`, then `get_workflow_canvas_url` with the returned workflow id, and give the user that link. Mention that the saved layout is auto-generated and may need tidying. If you ran a subgraph template instead, tell the user the canvas shows one collapsed subgraph node and how to open it (double-click the node body, not its title, to step inside it, or right-click it and choose Unpack Subgraph to flatten it onto the canvas).
9. If the user asked to BUILD or CREATE a workflow (not just for an output), after the run completes call `save_workflow` with the same JSON, a descriptive `name`, and `overwrite: false` — on a name collision choose a new name rather than replacing the user's existing workflow. Then call `get_workflow_canvas_url` with the `workflow_id` from the save result; if the save result omits `workflow_id`, find it with `list_saved_workflows` — never pass the filename (`saved_workflow_filename` publishes a PUBLIC share snapshot). If you ran a template with `run_template`, call `get_template`, apply the same `input_overrides` you ran with to that body (same node ids or slot paths; inputs you did not override keep the template defaults), and `save_workflow` the result instead, so the canvas matches the run. Give the user the canvas link. Mention that the saved layout is auto-generated and may need tidying. If you ran a subgraph template instead, tell the user the canvas shows one collapsed subgraph node and how to open it (double-click the node body, not its title, to step inside it, or right-click it and choose Unpack Subgraph to flatten it onto the canvas).

10. **If the user asks to adjust the result** (different seed, prompt wording, steps/cfg, resolution, a different reference image) rather than a new subject: do NOT rebuild the workflow and do NOT re-send the JSON. Call `submit_workflow` with `from_prompt_id` set to the prompt_id of the run being adjusted and `input_overrides` holding ONLY the changed inputs ({nodeId: {inputName: value}}). If you do not know the node id, call `get_job_status` with `include_workflow: true` on that prompt_id first. A new reference image still goes through `upload_file` first; override the loader node's input with the returned filename. Then continue from step 6. If the result came from Step 0's `partner_generate` rather than a submitted workflow, there is no workflow to rerun: call `partner_generate` again with the changed fields. If the user wants the AUDIO itself edited (e.g. "keep this exact clip, just add an echo") rather than the workflow's inputs changed, use `use_previous_output` / `partner_generate medias[]` instead.

Expand Down
Loading
Loading