curl --request POST \
--url https://platformapi.comfy.org/deploy/v1/deployments/{id}/models \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"blobId": "<string>",
"type": "<string>",
"filename": "<string>"
}
'import requests
url = "https://platformapi.comfy.org/deploy/v1/deployments/{id}/models"
payload = {
"blobId": "<string>",
"type": "<string>",
"filename": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({blobId: '<string>', type: '<string>', filename: '<string>'})
};
fetch('https://platformapi.comfy.org/deploy/v1/deployments/{id}/models', 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://platformapi.comfy.org/deploy/v1/deployments/{id}/models",
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([
'blobId' => '<string>',
'type' => '<string>',
'filename' => '<string>'
]),
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://platformapi.comfy.org/deploy/v1/deployments/{id}/models"
payload := strings.NewReader("{\n \"blobId\": \"<string>\",\n \"type\": \"<string>\",\n \"filename\": \"<string>\"\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://platformapi.comfy.org/deploy/v1/deployments/{id}/models")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"blobId\": \"<string>\",\n \"type\": \"<string>\",\n \"filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/deploy/v1/deployments/{id}/models")
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 \"blobId\": \"<string>\",\n \"type\": \"<string>\",\n \"filename\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"filename": "<string>",
"status": "adding",
"sizeBytes": 123,
"failure": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Add a model file to a deployment
Adds a model file the workspace uploaded (an upload of kind model) to the deployment, with no new release, and answers 202 with its entry. The entry reads adding until the deployment’s workers can use the file, then ready, or failed. On a stopped deployment it reads ready once the upload is whole and matches its declared size and sha256, and the next start places the file. An upload sent in pieces may be added before its pieces land. 404 UPLOAD_NOT_FOUND is an upload that is not the deployment’s workspace’s, is not a model, is gone, or was sent in one piece whose file is not there at its declared size. Each 409 names why: MODEL_POLICY where the release’s model policy is an allow list or blocks the file’s name, MODEL_NAME_TAKEN where the release or the deployment already has a file at that folder and name, DEPLOYMENT_BUSY while the deployment is neither running nor stopped, MODEL_STORAGE_EXCEEDED where the release’s models and the added files would need more storage than the deployment can be given, MODEL_LIST_TOO_LARGE where the deployment’s model list would be longer than its workers can be given, and VOLUME_SHARED where the deployment’s disk is mounted by another deployment. 503 SERVICE_UNAVAILABLE is also where another deployment of the same build’s storage could not be read and none plainly mounts this deployment’s disk; the same add may succeed if retried. A refusal adds nothing. The same add again (the same upload, folder and name) while its entry still reads adding is not MODEL_NAME_TAKEN: it starts that entry’s work again and answers 202 with it, so a client may retry an add whose answer it did not get. An add that fails after writing its entry leaves it adding; the same add again starts it, or removing the entry frees the name.
curl --request POST \
--url https://platformapi.comfy.org/deploy/v1/deployments/{id}/models \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"blobId": "<string>",
"type": "<string>",
"filename": "<string>"
}
'import requests
url = "https://platformapi.comfy.org/deploy/v1/deployments/{id}/models"
payload = {
"blobId": "<string>",
"type": "<string>",
"filename": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({blobId: '<string>', type: '<string>', filename: '<string>'})
};
fetch('https://platformapi.comfy.org/deploy/v1/deployments/{id}/models', 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://platformapi.comfy.org/deploy/v1/deployments/{id}/models",
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([
'blobId' => '<string>',
'type' => '<string>',
'filename' => '<string>'
]),
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://platformapi.comfy.org/deploy/v1/deployments/{id}/models"
payload := strings.NewReader("{\n \"blobId\": \"<string>\",\n \"type\": \"<string>\",\n \"filename\": \"<string>\"\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://platformapi.comfy.org/deploy/v1/deployments/{id}/models")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"blobId\": \"<string>\",\n \"type\": \"<string>\",\n \"filename\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://platformapi.comfy.org/deploy/v1/deployments/{id}/models")
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 \"blobId\": \"<string>\",\n \"type\": \"<string>\",\n \"filename\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"type": "<string>",
"filename": "<string>",
"status": "adding",
"sizeBytes": 123,
"failure": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}ボディ
レスポンス
Accepted; the entry reads adding.