Repository navigation
Releases
Releases · regiellis/comfy-api-proxy-go
v0.2.0
Performance
- Uploads gather 1 MB before hashing and writing to the spool file, where they handled the
multipart reader's 4 KB pieces one by one. One core moves about 890 MB/s where it moved 450
(BenchmarkUploadInput: 464 to 1111 MB/s), and 8 cores about 2000 MB/s. - An output ComfyUI cannot size is remembered as 0, so polling a job whose file is gone no
longer sends aHEAD /viewon every read.
Added
- Value outputs: strings a node returns instead of a file (
PreviewAny's text,SaveText's
text) are listed astextoutputs with a signed id, and their content is served from
ComfyUI's history astext/plainwithnosniff. The Python proxy drops them
(Comfy-Org/comfy-api-proxy#22).
Changed
- BREAKING CHANGE: a command-line mistake (an unknown command or flag, a bad flag value,
an unexpected argument) exits 2, as the Python proxy's argparse does. It exited 1. - BREAKING CHANGE:
sdk.WithBaseURL("")andsdk.WithRouterBaseURL("")count as not
given and fall back toCOMFY_BASE_URL/COMFY_ROUTER_BASE_URL, as an emptyWithAPIKey
already did. An empty base URL used to target Comfy Cloud even withCOMFY_BASE_URLset.
v0.1.1
Fixed
- The SDK's documentation shows on pkg.go.dev.
LICENSEis now the plain MIT text with both
copyright lines, and the attribution to Comfy Org's projects moved toNOTICE. The extra
paragraph had kept pkg.go.dev from recognizing the license, so it hid v0.1.0's docs. - A binary built with
go installreports its module version in--versionand the startup
panel, where it printeddev.
v0.1.0
The first release: a Go port of Comfy-Org's Python comfy-api-proxy and a Go client for the
Comfy API v2. An independent project, not affiliated with or endorsed by Comfy Org.
Added
comfy-api-proxy, one static binary serving the Comfy API v2 (/api/v2/*) in front of a
self-hosted ComfyUI. It submits, reads, lists, and cancels jobs, streams each job's events as
Server-Sent Events bridged from ComfyUI's WebSocket, uploads and downloads assets with blake3
dedup, signs output asset ids the way the Python proxy signs them, and places model files
under--comfyui-base-dirbehind guards. The Python proxy's black-box HTTP suite passes
against it, 82 of 82.- Release binaries for Linux and macOS (amd64, arm64) and Windows (amd64). The background
service commands build and follow the reference on Windows but are untested there. - The CLI:
run,start,stop,status, andconfig, with the Python proxy's flags
accepted unchanged. Configuration from flags,COMFY_PROXY_*environment variables, or a TOML
file, with every value's source reported. - Bind scopes (
local,global,localhost, or a literal IP), a bearer token required for any
non-loopback bind, the browser origin guard, and per-origin CORS. --state-dir: jobs, idempotency keys, and assets in SQLite across restarts, compatible with a
state directory written by the Python proxy.comfyui_token, a bearer token sent to a ComfyUI behind an authenticating gateway.sdk, a Go client for the Comfy API v2 and Comfy Router, ported from the Pythoncomfy-sdk:
jobs, events, assets, typed errors, retries, andWithProxyMetadatafor job labels against
this proxy.task bench, which measures this proxy against the Python reference.
Fixed (relative to the Python proxy)
- A job that finishes between the proxy's history read and its queue read no longer reads as
expired. - An event stream no longer hangs when the terminal message arrives before the stream's
WebSocket connects, or under constant broadcast frames from ComfyUI and custom nodes. - Outputs always arrive on the event stream before the terminal status.
- Uploads spool to disk while hashing instead of being read into memory.
- Asset expiry persists in the state database, and expired assets are cleaned up with or
without a state directory. expires_inpast year 9999 is a 422, not a 500.
Security
golang.org/x/text0.43.0, for GO-2026-5970 (an infinite loop on invalid input, reachable
through the access log's terminal styling).task securityrunsgovulncheckover the proxy
and the docs site, and CI runs it on every push.
Fixed (relative to the Python proxy, from its open issues)
public_url(--public-url,COMFY_PROXY_PUBLIC_URL) sets the origin of every link in a
response, so a proxy behind a TLS-terminating reverse proxy returnshttps://links
(Comfy-Org/comfy-api-proxy#31).- Outputs report their real
size_bytes, read from ComfyUI's/viewonce per output and
cached, on the job and onGET /api/v2/assets/{id}(Comfy-Org/comfy-api-proxy#26).
Fixed (during the port)
- A CORS origin written in mixed case now matches, as in the Python proxy: the scheme and host
are lowercased.