SDK (TypeScript)
import { ComfyDeploy } from "comfydeploy";
const comfyDeploy = new ComfyDeploy({
bearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await comfyDeploy.run.deployment.queue({
inputs: {
"num_inference_steps": 30,
"prompt": "A beautiful landscape",
"seed": 42,
},
webhook: "https://myapp.com/webhook",
deploymentId: "15e79589-12c9-453c-a41a-348fdd7de957",
});
// Handle the result
console.log(result);
}
run();from comfydeploy import ComfyDeploy
with ComfyDeploy(
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:
res = comfy_deploy.run.deployment.queue(request={
"inputs": {
"prompt": "A beautiful landscape",
"seed": 42,
},
"webhook": "https://myapp.com/webhook",
"deployment_id": "15e79589-12c9-453c-a41a-348fdd7de957",
})
assert res.create_run_response is not None
# Handle response
print(res.create_run_response)curl --request POST \
--url https://api.comfydeploy.com/api/run/deployment/queue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deployment_id": "12345678-1234-5678-1234-567812345678",
"inputs": {
"num_inference_steps": 30,
"prompt": "A futuristic cityscape",
"seed": 123456
},
"webhook": "https://myapp.com/webhook"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deployment_id: '12345678-1234-5678-1234-567812345678',
inputs: {num_inference_steps: 30, prompt: 'A futuristic cityscape', seed: 123456},
webhook: 'https://myapp.com/webhook'
})
};
fetch('https://api.comfydeploy.com/api/run/deployment/queue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.comfydeploy.com/api/run/deployment/queue",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'deployment_id' => '12345678-1234-5678-1234-567812345678',
'inputs' => [
'num_inference_steps' => 30,
'prompt' => 'A futuristic cityscape',
'seed' => 123456
],
'webhook' => 'https://myapp.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.comfydeploy.com/api/run/deployment/queue"
payload := strings.NewReader("{\n \"deployment_id\": \"12345678-1234-5678-1234-567812345678\",\n \"inputs\": {\n \"num_inference_steps\": 30,\n \"prompt\": \"A futuristic cityscape\",\n \"seed\": 123456\n },\n \"webhook\": \"https://myapp.com/webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.comfydeploy.com/api/run/deployment/queue")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deployment_id\": \"12345678-1234-5678-1234-567812345678\",\n \"inputs\": {\n \"num_inference_steps\": 30,\n \"prompt\": \"A futuristic cityscape\",\n \"seed\": 123456\n },\n \"webhook\": \"https://myapp.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comfydeploy.com/api/run/deployment/queue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"deployment_id\": \"12345678-1234-5678-1234-567812345678\",\n \"inputs\": {\n \"num_inference_steps\": 30,\n \"prompt\": \"A futuristic cityscape\",\n \"seed\": 123456\n },\n \"webhook\": \"https://myapp.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Endpoints
Queue Run
Create a new deployment run with the given parameters.
POST
/
run
/
deployment
/
queue
SDK (TypeScript)
import { ComfyDeploy } from "comfydeploy";
const comfyDeploy = new ComfyDeploy({
bearer: "<YOUR_BEARER_TOKEN_HERE>",
});
async function run() {
const result = await comfyDeploy.run.deployment.queue({
inputs: {
"num_inference_steps": 30,
"prompt": "A beautiful landscape",
"seed": 42,
},
webhook: "https://myapp.com/webhook",
deploymentId: "15e79589-12c9-453c-a41a-348fdd7de957",
});
// Handle the result
console.log(result);
}
run();from comfydeploy import ComfyDeploy
with ComfyDeploy(
bearer="<YOUR_BEARER_TOKEN_HERE>",
) as comfy_deploy:
res = comfy_deploy.run.deployment.queue(request={
"inputs": {
"prompt": "A beautiful landscape",
"seed": 42,
},
"webhook": "https://myapp.com/webhook",
"deployment_id": "15e79589-12c9-453c-a41a-348fdd7de957",
})
assert res.create_run_response is not None
# Handle response
print(res.create_run_response)curl --request POST \
--url https://api.comfydeploy.com/api/run/deployment/queue \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"deployment_id": "12345678-1234-5678-1234-567812345678",
"inputs": {
"num_inference_steps": 30,
"prompt": "A futuristic cityscape",
"seed": 123456
},
"webhook": "https://myapp.com/webhook"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
deployment_id: '12345678-1234-5678-1234-567812345678',
inputs: {num_inference_steps: 30, prompt: 'A futuristic cityscape', seed: 123456},
webhook: 'https://myapp.com/webhook'
})
};
fetch('https://api.comfydeploy.com/api/run/deployment/queue', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.comfydeploy.com/api/run/deployment/queue",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'deployment_id' => '12345678-1234-5678-1234-567812345678',
'inputs' => [
'num_inference_steps' => 30,
'prompt' => 'A futuristic cityscape',
'seed' => 123456
],
'webhook' => 'https://myapp.com/webhook'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.comfydeploy.com/api/run/deployment/queue"
payload := strings.NewReader("{\n \"deployment_id\": \"12345678-1234-5678-1234-567812345678\",\n \"inputs\": {\n \"num_inference_steps\": 30,\n \"prompt\": \"A futuristic cityscape\",\n \"seed\": 123456\n },\n \"webhook\": \"https://myapp.com/webhook\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.comfydeploy.com/api/run/deployment/queue")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"deployment_id\": \"12345678-1234-5678-1234-567812345678\",\n \"inputs\": {\n \"num_inference_steps\": 30,\n \"prompt\": \"A futuristic cityscape\",\n \"seed\": 123456\n },\n \"webhook\": \"https://myapp.com/webhook\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.comfydeploy.com/api/run/deployment/queue")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"deployment_id\": \"12345678-1234-5678-1234-567812345678\",\n \"inputs\": {\n \"num_inference_steps\": 30,\n \"prompt\": \"A futuristic cityscape\",\n \"seed\": 123456\n },\n \"webhook\": \"https://myapp.com/webhook\"\n}"
response = http.request(request)
puts response.read_body{
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Example:
"15e79589-12c9-453c-a41a-348fdd7de957"
The inputs to the workflow
Show child attributes
Show child attributes
Example:
{
"prompt": "A beautiful landscape",
"seed": 42
}
Example:
true
The GPU to override the machine's default GPU
Available options:
T4, L4, A10G, L40S, A100, A100-80GB, H100 Response
Successful Response
The ID of the run, use this to get the run status and outputs
Was this page helpful?
⌘I