Skip to main content
Stability API integrations can move to Comfy in one of two ways. Both run the same Stability models and bill the same Comfy credits. They differ in how much of your code changes.

Choose your path

Use the compatibility service if you have working Stability API code and want it running on Comfy with no other changes. Use native Comfy Router for new integrations. It is the same API as every other model on Router, with the Comfy SDKs, queued delivery, idempotent retries and one error format. Both paths need a Comfy API key. Create one in your Comfy workspace and export it:
Keep API keys on your server or in your local environment, not in browser JavaScript.

Compatibility service

The compatibility service at https://stability.comfy.org accepts Stability’s own paths and request bodies, runs each call on Comfy Router, and answers in Stability’s response and error shapes. To migrate, change two things:
  1. The base URL, from https://api.stability.ai to https://stability.comfy.org.
  2. The key in the Authorization: Bearer header, from your Stability key to your Comfy API key.
Everything else stays the same: paths, form fields, the Accept header, and how you read the response.

Before and after

Image inputs are sent the way Stability expects them, as multipart file parts. The compatibility service uploads each one to Comfy storage before the call runs.

Authentication

Send your Comfy API key as Authorization: Bearer <key>, the same header Stability uses. A request with no Bearer token, or with a key Comfy rejects, answers 401 with name set to unauthorized. GET /v1/engines/list, GET /v1/user/account and GET /v1/user/balance answer so that Stability SDKs that call them at startup keep working. They return fixed Stability-shaped JSON: the balance is always 0 and is not your Comfy credit balance. Generation is not gated on it. When your credits run out, a generation answers 402. Check your balance and usage in your Comfy workspace.

Response shapes

Responses follow Stability’s rules for each API version:
  • /v2beta/... returns the raw image bytes when Accept is image/* or is not set, and {"image": "<base64>", "finish_reason": "...", "seed": N} when Accept is application/json.
  • /v1/generation/... returns {"artifacts": [{"base64": "...", "seed": N, "finishReason": "..."}]} by default, with one artifact per image, and raw bytes when Accept is image/png.
  • /v2beta/3d/... returns the 3D model as a binary glTF (.glb) body.
An Accept value the path cannot answer is refused with 406.

Asynchronous endpoints

Two paths run asynchronously, as they do on Stability: /v2beta/stable-image/edit/replace-background-and-relight and /v2beta/stable-image/upscale/creative. The submit call answers 200 with a generation id. Poll GET /v2beta/results/{id} with the same key until it returns the result:

Errors

Errors use Stability’s envelope. A /v1/... path answers {"id": "...", "name": "...", "message": "..."}. A /v2beta/... path answers {"id": "...", "name": "...", "errors": ["..."]}. The message carries Router’s error detail. A validation failure lists one entry per invalid field, as field: message. Router errors map onto Stability statuses and names like this: A 429 or 503 carries Router’s Retry-After header when Router sent one. Wait that long before you retry.

Endpoint mapping

Every Stability endpoint available on Comfy, with its compatibility path and its native Router model ID. The compatibility path is the Stability path on https://stability.comfy.org. The three SD3.5 models and SD3.5 Flash share Stability’s generate/sd3 path and are chosen by the model form field, which defaults to sd3.5-large. “Async” means the compatibility path answers with an id you poll at /v2beta/results/{id}. On native Router, every model answers on the synchronous route, and can also be queued. A Stability path that is not in this table is not available on Comfy.

Native Comfy Router

Native Router calls send a JSON body to POST https://api.comfy.org/v2/models/stability/<slug> with your key in X-API-Key. The body uses Stability’s field names. Image inputs are Comfy-signed asset URLs rather than file uploads, and the response is JSON with a Comfy-signed URL valid for up to 24 hours. Image models return it in image. When an SDXL request returns more than one image (samples above 1), the response also carries images, which lists every Comfy-signed image URL in output order. image holds only the first, so read images to get every result. The two 3D models (stability/stable-fast-3d and stability/stable-point-aware-3d) return the GLB URL in model instead. Download each result before its URL expires. Each model page carries the full request schema, Python and TypeScript SDK snippets, and the queued variant for that model.

Synchronous example

stability/generate-core:
Response

Asynchronous example

stability/upscale-creative runs asynchronously at Stability. On the synchronous route, Router submits the job and polls it for you, then answers with the finished result in the same shape as above. It is billed once, when the job succeeds. For a long run, or to collect the result from another process, queue it instead:
The collected result has the same shape as the synchronous response. The image value in these examples is a placeholder; a real call must pass a Comfy-signed asset URL.

Pricing

Both paths bill your Comfy workspace credits per generation. See Comfy Router pricing for current per-model prices.

Next