Serve the Comfy API v2 in front of your own ComfyUI so the official SDKs can run workflows against it
The Comfy SDKs speak Comfy API v2. A self-hosted ComfyUI serves v2 through comfy-api-proxy, a small open-source service that runs alongside your instance.
Install and run
pip install comfy-api-proxycomfy-api-proxy
By default it proxies the ComfyUI on 127.0.0.1:8188 and serves the v2 API on 127.0.0.1:8189. Use --comfyui and --port to change either.Run it with --comfyui-base-dir /path/to/ComfyUI if you also want to upload model files into your install.
Point the SDK at it
Set the base URL and construct the client as usual:
export COMFY_BASE_URL="http://127.0.0.1:8189"
from comfy_sdk import Comfyclient = Comfy()
import { Comfy } from "@comfyorg/sdk";const client = new Comfy();
Everything in the SDK guide works the same way against the proxy as against Comfy Cloud.
Authentication
Authentication is not required by default. If the proxy is configured with a static bearer token, pass that token as the SDK API key: Comfy(api_key="...").
The proxy binds to loopback only by default. If you expose it beyond loopback, for example in front of a ComfyUI on a rented GPU, configure a bearer token or put an authenticating reverse proxy in front of it.