Generate an image
Run this on the hosted Comfy Cloud connector (https://cloud.comfy.org/mcp). The user signs in with that connector's OAuth flow. Use the signed-in account. There is no API key to collect in chat, and there is no local ComfyUI install to start.
The server's tool descriptions name the parameters and the current model ids. When the user opens the built-in generate-image prompt, that prompt is the long procedure. Follow the live tool descriptions for arguments. Discover template, model, and node names with the tools. Do not copy them from memory into the graph.
What to do
- When they supply a source image,
upload_file it first and use the returned name in whichever route runs below (partner_generate media inputs, a template input, or a loader node). Do not inline image bytes.
- If the user named a provider or model and wants a finished image, look that name up with
search_nodes. When the match is a partner model, call partner_generate for an image. Its description names providers, not model ids, so pass your best-guess model slug. A wrong slug is rejected before the job is queued, and the error names the closest real slugs (Did you mean). Re-call once, and only when a suggestion keeps the provider prefix of the slug you guessed. If the bounce names a params.model tier, send that tier with the slug. A tier-shaped guess belongs in params.model; re-calling the bare slug runs that entry's default tier at a different price. Say which slug you switched to. If that re-call bounces too, stop. Suggestions are ranked across the whole registry, so one may name a provider the user never asked for. If none keeps your guess's provider prefix, do not re-call — that call queues and charges — and ask which model to use. Inside submit_batch, resend only the bounced item. If the tool says "unknown model" with no close match, or "not yet implemented", or the node is not a partner node, continue below. If they asked to build or create a workflow, skip partner_generate and wire the partner node into the graph instead. When partner_generate succeeds, it returns the output only: show the image or signed URL it returns, leaving the query string as returned, and stop. Do not continue to a template or graph, which would run and charge a second generation.
- Otherwise prefer a template. Search with
search_templates for the task they described. When one fits, read get_template_schema and run it with run_template. Hand-build a graph only when nothing fits, using search_models and search_nodes for the pieces.
- A graph needs an input that carries the request and a save or output node wired to the final image. Partner nodes often omit the save node; add one, or the job returns nothing. Give every node a
_meta.title that names its role in plain words.
- Wait with
wait_for_job, then get_output. Show the image from what that tool returns. When it includes a download command and this session has a shell, run that command unchanged. In chat, show the image or the signed URL. Leave the signed URL's query string as returned.
- When they asked for a workflow they can reopen,
save_workflow and return the link from get_workflow_canvas_url. Say that the saved layout is auto-generated. When the run used a subgraph template, say the canvas shows one collapsed node: double-click the node body to step inside, or right-click and unpack it.
- When they ask to adjust this result (seed, prompt wording, steps, cfg, resolution, or a different reference) rather than a new subject, do not rebuild the graph and do not re-send the JSON. Call
submit_workflow with from_prompt_id set to 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 still goes through upload_file; override the loader input with the returned name. If that result came from partner_generate, there is no workflow to rerun: call partner_generate again with the changed fields. If they want this exact image edited ("keep this picture, make it night") rather than the workflow's inputs changed, use use_previous_output or partner_generate media inputs.
Discovery does not spend generation credits. A generation needs an active Comfy Cloud subscription. If a run is refused, check get_billing_status and report what it says.
1---2name: generate-image3description: Generate, edit, or restyle a still image on Comfy Cloud. Use when the user asks to create, draw, design, edit, inpaint, or restyle a picture, photo, illustration, poster, or other still image, including from text or from a source image they provide.4metadata:5 source: https://skillmd.com/skills/comfy-org/generate-image6---78# Generate an image910Run this on the hosted Comfy Cloud connector (`https://cloud.comfy.org/mcp`). The user signs in with that connector's OAuth flow. Use the signed-in account. There is no API key to collect in chat, and there is no local ComfyUI install to start.1112The server's tool descriptions name the parameters and the current model ids. When the user opens the built-in `generate-image` prompt, that prompt is the long procedure. Follow the live tool descriptions for arguments. Discover template, model, and node names with the tools. Do not copy them from memory into the graph.1314## What to do15161. When they supply a source image, `upload_file` it first and use the returned name in whichever route runs below (`partner_generate` media inputs, a template input, or a loader node). Do not inline image bytes.172. If the user named a provider or model and wants a finished image, look that name up with `search_nodes`. When the match is a partner model, call `partner_generate` for an image. Its description names providers, not model ids, so pass your best-guess model slug. A wrong slug is rejected before the job is queued, and the error names the closest real slugs (`Did you mean`). Re-call once, and only when a suggestion keeps the provider prefix of the slug you guessed. If the bounce names a `params.model` tier, send that tier with the slug. A tier-shaped guess belongs in `params.model`; re-calling the bare slug runs that entry's default tier at a different price. Say which slug you switched to. If that re-call bounces too, stop. Suggestions are ranked across the whole registry, so one may name a provider the user never asked for. If none keeps your guess's provider prefix, do not re-call — that call queues and charges — and ask which model to use. Inside `submit_batch`, resend only the bounced item. If the tool says "unknown model" with no close match, or "not yet implemented", or the node is not a partner node, continue below. If they asked to build or create a workflow, skip `partner_generate` and wire the partner node into the graph instead. When `partner_generate` succeeds, it returns the output only: show the image or signed URL it returns, leaving the query string as returned, and stop. Do not continue to a template or graph, which would run and charge a second generation.183. Otherwise prefer a template. Search with `search_templates` for the task they described. When one fits, read `get_template_schema` and run it with `run_template`. Hand-build a graph only when nothing fits, using `search_models` and `search_nodes` for the pieces.194. A graph needs an input that carries the request and a save or output node wired to the final image. Partner nodes often omit the save node; add one, or the job returns nothing. Give every node a `_meta.title` that names its role in plain words.205. Wait with `wait_for_job`, then `get_output`. Show the image from what that tool returns. When it includes a download command and this session has a shell, run that command unchanged. In chat, show the image or the signed URL. Leave the signed URL's query string as returned.216. When they asked for a workflow they can reopen, `save_workflow` and return the link from `get_workflow_canvas_url`. Say that the saved layout is auto-generated. When the run used a subgraph template, say the canvas shows one collapsed node: double-click the node body to step inside, or right-click and unpack it.227. When they ask to adjust this result (seed, prompt wording, steps, cfg, resolution, or a different reference) rather than a new subject, do not rebuild the graph and do not re-send the JSON. Call `submit_workflow` with `from_prompt_id` set to 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 still goes through `upload_file`; override the loader input with the returned name. If that result came from `partner_generate`, there is no workflow to rerun: call `partner_generate` again with the changed fields. If they want this exact image edited ("keep this picture, make it night") rather than the workflow's inputs changed, use `use_previous_output` or `partner_generate` media inputs.2324Discovery does not spend generation credits. A generation needs an active Comfy Cloud subscription. If a run is refused, check `get_billing_status` and report what it says.