Skip to main content
The Comfy SDKs speak Comfy API v2. During the beta, a self-hosted ComfyUI does not serve v2 itself. comfy-api-proxy is a small open-source service that runs alongside your instance and serves the v2 contract in front of it.
The proxy is a stopgap. Once the v2 API stabilizes it moves into ComfyUI core and the proxy is no longer needed.

Install and run

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:
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.

Next steps