How to run ComfyUI over remote MCP

An MCP client can run ComfyUI on a budgeted CloudGPU rental after the owner approves a live quote. The official ComfyUI template provides ComfyUI itself, not model weights. Use the current catalog template id and the exact gpu_model string from list_gpus, call ComfyUI’s HTTP API or a documented Job recipe, and explicitly save outputs before release. Stopping the GPU is a separate step from keeping the images.

Console deploy, tunnel limits, and the HTTP API shape are on Rent a GPU for ComfyUI. This page is the remote-MCP path. Card choice stays on How to choose a rental GPU for ComfyUI. A Raw GPU install is a different path: How to install ComfyUI and ComfyUI-Manager on a cloud GPU.

Preconditions

The owner has authorized the MCP connection. Remote Streamable HTTP is https://cloudgpu.app/mcp. Local stdio is the published cloudgpu-mcp 0.16.3 package. Setup is in the MCP guide. After authorization, read the tool list that session returns. Local and remote tool sets differ. If a name below is missing, skip it.

Call get_account and list_instances before a new allocation. Reuse a compatible running rental when ComfyUI is already up on that instance and the remaining caps cover the work. A row in list_gpus, or a template id in the catalog, is not proof that a particular workflow has passed acceptance.

Read GET /v1/public/compute-capabilities before relying on Jobs, storage, or output collection. On 2026-11-15 that document reported automatic_output_collection true, prepare_model_deployment true, job_rerun true, and full_disk_restore false.

Confirm the template id and the GPU string

Read GET https://cloudgpu.app/v1/public/gpu-catalog on the day you run. On the snapshot generated_at=2026-11-15T04:53:39.344Z, the template named ComfyUI has id flux-1-dev, min_vram_gb 24, and recommended_gpu RTX 4090 48G. That recommended_gpu value is only the hint on this snapshot. If list_templates is listed, confirm the ComfyUI row’s id against the catalog you just read. Pass template as that id.

gpu_model is the exact full string on the list_gpus row. Pass that full string in later calls. list_gpus can take the catalog minimum as a filter:

{
  "min_vram_gb": 24
}

Use the returned gpu_model and min_gpu_count in the calls below. min_vram_gb 24 is the template field on this catalog snapshot. It is not a measured fit for a workflow. Pick the card with the ComfyUI rental-GPU guide.

Quote, then start

Show the owner the quote before any create. Billing terms come from that quote: minute or started-hour, preauthorization, and the minimum. The pricing page is the billing source. This page does not restate it.

estimate_cost is the quote create_instance accepts. In cloudgpu-mcp 0.16.3 its quote_id is a local id of the form q_ plus 12 hex characters. quote_compute is a separate five-minute server quote whose id run_job describes as starting with quote_. Pass each id only to the tool that issued it.

{
  "gpu_model": "<full model string from list_gpus>",
  "gpu_count": "<min_gpu_count from that list_gpus row>",
  "hours": "<expected hours, including on-instance weight download>",
  "template": "flux-1-dev"
}

Read billing_increment_seconds, minimum_charge_usd, preauthorized_usd, and billing_description on the result. Set user_confirmed to true only after the owner approves that quote and the caps. max_spend_usd and max_hours below are example budget limits the owner chooses. They are not GPU sale prices. The servers destroy the instance when either cap is reached. The approved quote still supplies the increment, the minimum, and the preauthorization, and the budget has to cover the minimum shown on the quote.

{
  "quote_id": "<quote_id from that estimate_cost>",
  "user_confirmed": true,
  "max_spend_usd": "<example budget cap the owner approved>",
  "max_hours": "<example hour cap the owner approved>",
  "idle_minutes": 60
}

idle_minutes defaults to 60 in this schema. Installing packages and downloading models count as idle, so raise it when that work needs longer than the default. 0 turns the idle limit off. Any other value is at least 10. Local stdio can also refuse a cap above CLOUDGPU_MAX_SPEND_USD or CLOUDGPU_MAX_HOURS.

The agent guide sets a server quote’s expires_at 5 minutes after the quote is issued. quote_compute is described as a five-minute server quote. create_instance fails when the billing quote stored inside the local quote has expired, and the recovery is another estimate_cost plus a new approval. The same local wrapper rejects its own quote_id after 15 minutes and deletes that id when create_instance takes it. A second create_instance with the same id is refused. create_instance is not idempotent. If the call times out, use list_instances and look for an instance already created with that GPU before calling create_instance again. The agent guide states that POST /v1/gpu/instances has no idempotency key and that the same request sent twice can start two machines.

Poll get_status with the returned instance_id until status is running. Keep the id.

Job alternative

run_job runs one command from start to finish and releases the GPU when the command ends. It still needs a fresh quote and an explicit approval. Send a stable idempotency_key and keep it. A retry of the same submission uses that same key and the same body. A new key is a new Job. If you omit the key, 0.16.3 generates one and returns it; retain that returned value.

Pass quote_id from quote_compute when that tool is listed. For a whole-hour source, run_job also requires billing_quote_id and billing_accepted true. The schema describes billing_quote_id as the source-specific billing quote, expiring after five minutes, and the MCP guide names estimate_cost and POST /v1/gpu/billing-quote as that quote. Pass billing_quote_id only when the response you just received contains it, and only after the owner accepts that quote’s minimum and billing period. create_instance does not take billing_quote_id; it attaches the billing quote stored by estimate_cost.

template is the catalog id above when the Job should start the official ComfyUI template. gpu_model, when you send it, is still the full list_gpus string.

Download weights on the instance

The template includes ComfyUI, not checkpoints, text encoders, VAE, or LoRAs. Download those files on the instance, into the matching folders under ComfyUI/models/ documented on the ComfyUI rental page. That page caps the public tunnel at 3 MB/s and describes it as the path for JSON and finished images.

prepare_model_deployment is preparation only. In 0.16.3 it takes model_references (1–4) and an optional workflow, and it returns a reviewed setup script for the existing ComfyUI template. The tool description names the categories checkpoints, loras, vae, diffusion_models, text_encoders, clip, controlnet, and upscale_models. Downloads go from the public model host to the rented GPU. The tool does not start a GPU, execute a graph, or install custom nodes. Pass the returned setup_script to create_instance only after the owner approves that script. If run_command is on the session list, a download command belongs on the instance. Remote MCP does not provide local SSH transfers; do not invent one when run_command is absent.

Call the workflow

get_status may return api_url while status is running. The ComfyUI rental page documents the form https://<16-char-id>-i.cloudgpu.app, a reverse tunnel to ComfyUI port 8188, live only while the instance runs. The tunnel adds no authentication and accepts only the registered hostname. api_url is absent once the instance stops.

Queue with POST /prompt and a workflow exported in ComfyUI API format. Poll GET /history/{prompt_id}. Download with GET /view. Node ids belong to the exported graph. The request shape is on the rental page. prepare_model_deployment prepares a setup script and does not generate an image.

Workflow-specific installs stay on their own guides: FLUX.1-dev in ComfyUI, ControlNet in ComfyUI, and AnimateDiff in ComfyUI.

Optional Job recipe

list_task_templates and prepare_task_template are local read-only tools in cloudgpu-mcp 0.16.3. The published catalog still includes comfyui-workflow. If the current session does not list them, skip the recipe.

The recipe’s documented scope is an already prepared ComfyUI application listening on loopback, a reviewed API-format workflow in an immutable Workspace, and explicit persistence. It does not install custom nodes. It does not start a GPU. run_job still needs a fresh quote, user_confirmed true, the caps, and a new idempotency_key.

{
  "template_id": "comfyui-workflow",
  "workspace_version_id": "<wsv_… of the Workspace version that holds the workflow>",
  "workflow_path": "<relative path of the reviewed API-format workflow>",
  "persist_results": true,
  "comfy_port": 8188
}

comfy_port defaults to 8188. Optional timeout_seconds and image_count use the schema defaults unless the owner sets them. The recipe writes that many PNG files plus task-summary.json under $CLOUDGPU_OUTPUT_DIR. The 0.16.3 template record says its validation is local HTTP protocol fixtures and that real GPU generation is not yet accepted. The MCP guide says complete ComfyUI recipes are not certified.

Reuse a running rental

Reuse the same instance_id only when that instance is still running, ComfyUI is already available on it, and the work stays inside the original max_spend_usd, max_hours, and idle_minutes. Check get_status before the next command. Do not extend those caps to keep the rental.

run_job and prepare_job_rerun provision separately. prepare_job_rerun reads parameters from a successful Job and does not start a GPU. It does not reuse the old quote or the old idempotency key. A Workspace version reuses the selected project files. With full_disk_restore false, that version is not the operating system and not the installed custom nodes. Rent, reuse, and release boundaries are in the rent-and-reuse guide. Quotes and Jobs are in GPU Jobs for AI agents and the quote and reuse note.

Save the images, then release

Confirm saved files, or Job output_collection status succeeded, before stop_instance and before treating a finished Job as saved. Tool names, outputs.files, and the local-versus-remote split are in How to save GPU results over remote MCP. A remote session must not pass an instance path to save_workspace or upload_artifact.

Do not leave an idle GPU running only to consume time that was already authorized. max_spend_usd does not pay for storage. Read get_storage when it is listed, otherwise authenticated GET /v1/storage. Leave accept_storage_charges false unless the owner has agreed to paid storage. A budget-limited agent key cannot consent to paid storage.

Keep the original Job id or instance id. A lost response is a reason to poll that id. stopping and needs_attention are not a confirmed release and are not permission to allocate again.

Limits that change the result

An expired quote does not start a GPU. Call the quote tool again and wait for a new approval. create_instance is not idempotent; run_job is retried only with the same idempotency_key and the same body.

api_url exists only while the instance runs. The tunnel has no authentication and a 3 MB/s cap. Collection can fail and the GPU can still be released. Weights are not in the template. prepare_model_deployment and comfyui-workflow do not install custom nodes.

Tool rules are in AGENTS.md. Connection and quote fields are in the MCP guide and the agent guide. Budget cap parameters are in How to set GPU budget caps over remote MCP.

Questions and answers

Does the ComfyUI template include model weights?

No. On the catalog snapshot generated_at 2026-11-15T04:53:39.344Z, the template named ComfyUI has id flux-1-dev and provides ComfyUI itself. Checkpoints, text encoders, VAE, and LoRAs are not included. Download them on the instance into the matching folders under ComfyUI/models/. The public tunnel is capped at 3 MB/s.

Can an MCP client call ComfyUI over the public HTTPS endpoint?

Yes, while the instance is running and get_status returns api_url. The rental page documents the form https://<16-char-id>-i.cloudgpu.app, a reverse tunnel to ComfyUI port 8188. Queue with POST /prompt using a workflow exported in API format, poll GET /history/{prompt_id}, and download with GET /view. The tunnel adds no authentication and accepts only the registered hostname. api_url is absent once the instance stops. prepare_model_deployment prepares a setup script and does not generate an image.

Does a GPU budget cap cover storage or weight downloads?

max_spend_usd bounds GPU spend for that instance or Job. Time spent downloading weights on the instance counts toward that cap and toward idle_minutes. Storage has separate eligibility, quota, retention, and charges. Read get_storage when it is listed, or authenticated GET /v1/storage. Leave accept_storage_charges false unless the owner has agreed to paid storage. A budget-limited agent key cannot consent to paid storage.

What happens if the quote expires?

An expired server quote does not start a GPU. docs/agents sets expires_at 5 minutes after the quote, and quote_compute is a five-minute server quote. Call estimate_cost or quote_compute again, show the new quote, and wait for another approval. create_instance is not idempotent: a second call can start another machine. If a create call times out, list instances and look for one already created before calling create_instance again.