Before you begin
Each task on this page works in two places: on the Developer Platform at platform.comfy.org in your browser, and with comfy-cli in a terminal. Make sure you have these:- A workspace with Comfy Credits or an active plan: creating or starting a deployment needs one of them.
- For the comfy-cli tabs, comfy-cli signed in to your Comfy account: run
comfy cloud login.
Start a Build from Comfy Desktop, a Workflow file, or ComfyUI
If you don’t have a Build yet, you can start one from something you already have. Custom Builds shows the main browser flow, from a Workflow saved on Comfy Cloud. Pick the tab for what you start from.- Comfy Desktop snapshot
- Workflow file
- ComfyUI
- In Comfy Desktop, click Manage on your instance, and then click the Snapshots tab.
- If the instance’s current state isn’t listed, click Create Snapshot.
-
On the snapshot you want, click Export.

- On the Developer Platform, in the Developer Platform sidebar, click Deploy, and then click New build. If you have no Builds yet, click Start from scratch instead.
-
On the Start with a workflow or snapshot? step, drop the exported
.jsonfile onto the drop area, or click the area to browse.
Find your deployment
From here on, the page assumes you have a Build with at least one deployment. Every later task starts from the deployment, so find it first. Reading a deployment costs nothing. Pick the tab for the place you work in.- Developer Platform
- comfy-cli
- In the Developer Platform sidebar, click Deploy.
- In the Deployments section, click the deployment’s name.
v2. The Overview tab shows its Runtime configuration.Release a version of your Build
A published version of a Build never changes. To add a Custom Node, you publish a version, and then move the deployment onto it. To add a model or LoRA to one deployment without a new version, see Add a model to a running deployment. The Developer Platform calls a versionv1, v2, and so on. comfy-cli calls it a release.
- Developer Platform
- comfy-cli
- In the Developer Platform sidebar, click Deploy.
- In the Builds section, click your Build.
- Click New version, and make your changes in the steps.
- On the last step, click Save changes. The Build’s page shows Changed since vN, where N is the latest version.
- Click Publish. In the Choose build targets dialog, keep Serverless build selected, and then click Publish.
- Open the deployment’s page. When a newer version is ready, the page shows vN available under the deployment’s name.
- Click Change version.
- Select the version, and then click Update to vN.
- On the deployment’s page, click the History tab.
- On the version’s row, click Roll back to this version.
Change the GPU or region
The GPU decides how much VRAM a Workflow gets and what each worker costs per hour. The region decides where the deployment runs, and the GPUs you can pick depend on it.- Developer Platform
- comfy-cli
- On the deployment’s page, click Edit settings.
- In Edit deployment, select a GPU. Each GPU shows its VRAM and its price per hour.
- Click Save changes.
Scale the workers
Each worker is one GPU that runs your jobs. You set two numbers:- Always-warm workers: workers that stay running so jobs don’t wait for a GPU to start. With
0, the deployment turns its GPUs off when no jobs come in. - Max workers: the most workers the deployment runs at once when jobs arrive. Requests beyond that wait in the deployment’s queue until a worker is free.
- Developer Platform
- comfy-cli
- On the deployment’s page, click Edit settings.
- Set Always-warm workers and Max workers.
- Click Save changes.
Stop and start a deployment
Stop a deployment to keep it, with its URL and models, without running jobs. Start it again when you need it.- Developer Platform
- comfy-cli
- Click the arrow next to Start, and then select Start on vN.
- In the dialog, click Start on vN.
Call your deployment from your application
Your application sends API-format Workflows to the deployment’s URL with the Comfy API v2, using a workspace API key. Before you send a job, check that the deployment’s status reads Ready. A job on a deployment with0 always-warm workers can wait a few minutes while a GPU starts.
- Developer Platform
- comfy-cli
- On the deployment’s page, find Run via API on the Overview tab.
- Copy the Deployment URL.
- Click Create API key, and copy the key.
- Copy the Python, JavaScript, or cURL snippet.
- Run the snippet with the key in the
COMFY_API_KEYenvironment variable.
- Open Test this deployment.
- Select Quick test.
- Click Run.
COMFY_BASE_URL to the Deployment URL. See Choosing a base URL.
Add a model to a running deployment
You can add a model or LoRA to one deployment without publishing a new version of the Build. The file goes onto the same storage as the Build’s models, so every worker reads it from disk with no download. The deployment keeps its URL. The Build and your other deployments don’t change.Before you begin
Make sure you have these:- A deployment whose status reads Ready or Stopped: while it starts, stops, or updates, an add is refused.
- The model file on your computer: a file name of letters, digits,
.,_, and-, as Rules and errors describes.
Add the file
- Cloud editor
- Developer Platform
- comfy-cli
- In the cloud menu to the left of Run, select the deployment under Run on.
- In the Left sidebar, click Model Library, and then click + (tooltip Add models to this deployment).
- Drag a
.safetensorsfile into the dialog, and set What type of model is this? to the type that matches the folder, such as LoRA forloras. - Click Upload, and wait until the entry reads Ready.
Add the file with the deployment API
Add the file with the deployment API
- The deployment’s ID: it’s the first part of the Deployment URL, such as
dep-2bf42665-0a61-4702-962f-0774c6391e96inhttps://dep-2bf42665-0a61-4702-962f-0774c6391e96.run.comfy.app. - A workspace API key: see Getting an API key. The commands below read it from the
COMFY_API_KEYenvironment variable and send it in theX-API-Keyheader.
Ask for an upload link
kind is always model:blobId, an uploadUrl, and expiresAt, the time the link stops working:Upload the file
uploadUrl before expiresAt. The link takes only a body of the size you declared, and it needs the x-goog-if-generation-match: 0 header:Add the upload to the deployment
blobId and the model folder the file goes in, such as loras or checkpoints:202 with the deployment’s entry for the file, which reads adding:"filename" to the request. Without it, the file keeps the name you uploaded it with.Wait until the file reads ready
adding, the same upload, folder, and name return the same entry.Upload a large file in pieces. For a large file, ask for the upload in pieces, so an expired link or a dropped connection doesn’t restart the whole file. Add "parts": true to the upload request. The answer then holds a parts list instead of one uploadUrl. A file is split into at most 32 pieces of at least 64 MiB each, and can be up to 128 GiB.- PUT each piece’s bytes, from
offsetBytesforsizeBytesbytes of the file, to that piece’suploadUrl, with the samex-goog-if-generation-match: 0header. - If links expire before every piece is in, send
POST https://platformapi.comfy.org/builder/v1/blobs/<blobId>/partsfor fresh links to the pieces not stored yet. - When every piece is in, send
POST https://platformapi.comfy.org/builder/v1/blobs/<blobId>/complete. It joins the pieces into one file.
ready sooner after the upload ends.Use the added model
Name the file in your Workflow as you would a model in the Build. For a LoRA, set the loader’slora_name input to the file name, as Set lora_name in the Workflow shows, and send the job to the deployment.
A job that names a file still adding is refused before it reaches a worker. The API answers 422:
model_failed and the message my_style.safetensors was not added to this deployment. Remove it and add it again. A run from the Comfy Cloud editor is refused with the same sentence.
In the Comfy Cloud editor, a file uploaded with + shows in the loader lists once it reads Ready. For a file added on the Developer Platform or with comfy-cli, select the deployment under Run on, and then reload the page or press R; the editor doesn’t pick those files up on its own. Either way, the file shows in its loader Node’s list, such as the lora_name list of a Load LoRA (Model and CLIP) Node.
The deployment keeps its added models when it moves to another version, rolls back, stops, and starts. If a version you move to has its own file with the same folder and name, the deployment uses the version’s file.
Remove an added model
- Developer Platform
- comfy-cli
- Open the deployment’s page.
- Under Added models, on the file’s row, click Remove.
Rules and errors
An add follows these rules:- The file name is one name of letters, digits,
.,_, and-, and starts with a letter or digit. - The folder (
type) is a model folder, such asloras,checkpoints, orvae, or another folder insidemodels. It can’t becustom_nodesorconfigs, or a different capitalization of a known folder, such asLoRAs. - One file per folder and name: a name the Build’s version or the deployment already has in that folder is refused.
- The Build’s model setting applies: a Build set to Choose which models refuses every added model, and a Build that blocks a file name refuses that name.
error code and a message you can show:
Use workspace library models in API requests
A deployment runs.safetensors models from your workspace library, even when its release doesn’t include them. To pick a LoRA per request, upload it to the library once, and then name it in each Workflow you send.
Upload the LoRA to your workspace library
--type:Added my_style.safetensors to loras.Set lora_name in the Workflow
lora_name input to the library file name, including .safetensors:Send the request
lora_name to another library file name in the next request. You don’t need a new Build, release, or redeploy.
- A Workflow can name up to 100 library models. A loader that names a 101st library model fails as if the file were not in the library.
- Keep file names unique across the folders one loader reads. If the library has the same file name in two of those folders, a job sent through the API loads neither file.
Monitor a deployment
Check a deployment’s state when it starts, after you change it, and when jobs fail.- Developer Platform
- comfy-cli
- The status under the deployment’s name reads Queued, Provisioning, or Starting while the deployment comes up, and Ready when it serves jobs.
- While the deployment comes up, Deployment progress shows each step, such as Copying models. The deployment keeps starting on Comfy’s side, so you can close the page and come back.
- The Boot log tab shows what ComfyUI printed while the deployment started.
- The History tab lists the versions the deployment ran and what moved it.
Clean up
Deleting the last deployment of a Build in a region stops its storage cost, and deleting a version frees a place under your limit of Build versions. You can’t delete a Build or a version while a deployment uses it, so delete the deployment first.- Developer Platform
- comfy-cli
- Open the Build’s page.
- On the version’s row, open Version actions, and then select Delete version.
- Click Delete.
- On the Build’s page, click Delete.
- In the Delete build dialog, click Delete.
Fix a failing build or deployment
When a build or a deployment fails, its logs name the cause. Fix the cause, and then publish or start again.The build failed
The build failed
The deployment status reads Failed
The deployment status reads Failed
comfy deploy status prints the reason. For the log and the status changes, see Monitor a deployment.Fix what the error names, and then start the deployment again.The deployment takes a long time to start
The deployment takes a long time to start
comfy deploy status --deployment <deployment> --watch. The Copying models step takes longer the more models the version has. When you create a deployment on the Developer Platform, Estimated time in the deploy dialog shows how long the deployment takes to start.If the GPU you picked has no capacity, change the GPU or region. With comfy-cli, comfy deploy refs compute shows each GPU’s availability.The status reads Stopped: out of credits
The status reads Stopped: out of credits
The status reads Stop failed
The status reads Stop failed
comfy deploy stop --deployment <deployment> again.An update to a version failed
An update to a version failed
FAQ
For how deployments are billed, see Deployment billing in Usage and Limits.Can one Build come from multiple Workflows?
Can one Build come from multiple Workflows?
Next steps
Once your deployment is running, use these pages to send Workflows to it from your own code.Comfy SDKs
Comfy API v2
Workflow API format
Get started with comfy-cli
comfy cloud login.






