https://www.runcomfy.com/comfyui/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/servers/yyyyyyy-yyyy-yyyy-yyyyyyyyyyyy
.https://yyyyyyy-yyyy-yyyy-yyyyyyyyyyyy-comfyui.runcomfy.com
.Note: Please use this ComfyUI URL in a trusted environment, DO NOT SHARE IT publicly.
Ensure that "Enable Development Mode Options" is activated in the Settings menu.
Download the workflow_api.json
file by clicking on the Save (API Format)
button.
The following file is AnimateDiff + ControlNet + Auto Mask | Restyle Video, which will be used as an example.
import requests
url = "<https://yyyyyyy-yyyy-yyyy-yyyyyyyyyyyy-comfyui.runcomfy.com/upload/image>"
payload = {}
files=[
('image',('zzzz.mp4',open('path_to_video/image','rb'),'application/octet-stream'))
]
headers = {}
response = requests.post(url, headers=headers, data=payload, files=files)
print(response.json())
The response will be something like:
{
"name": "zzzz.mp4",
"subfolder": "",
"type": "input"
}
The zzzz.mp4
is the file you uploaded via the API in the input
folder. Sometimes it may contain suffixes like '(1)' or '(1)(1)' if a file with the same name already exists.
Basic HTTP API: