{"openapi":"3.0.2","info":{"title":"krea/krea-3","description":"The request body Comfy Router accepts for the model \"krea/krea-3\", and the response body it returns. The INPUT schema is the same schema the server validates a call against before it reaches the provider, so what is published and what is enforced cannot differ. `x-comfy-router-input-modalities` records the media kinds the model is documented to accept; the request schema is shared across sibling models and may admit media kinds this model ignores. The OUTPUT schema describes the provider's native result document exactly as Router returns it: Router does not validate, narrow or re-envelope the response, so the output schema is descriptive rather than enforced, and Comfy owns no output shape of its own.","version":"694b79344b82"},"paths":{"/v2/models/krea/krea-3":{"post":{"operationId":"runRouterModel","summary":"Run krea/krea-3 synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"example":{"prompt":"A ceramic coffee mug on a clean studio background","resolution":"1k"},"properties":{"aspect_ratio":{"description":"1:1, 4:5, 3:4, 2:3, 9:16, 5:4, 4:3, 3:2, 16:9 or 21:9. Use with resolution; omit for automatic framing.","type":"string"},"image_urls":{"description":"Input image URLs, up to 8. More than 8 entries is rejected before any fetch (400 on /proxy/krea; Comfy Router's schema check answers 422 first). The image_url returned by uploading the image to POST /proxy/krea/assets (multipart form field `file`) is always accepted. Whether other public https URLs are accepted depends on the environment: where they are not, any link that is not an https URL on the host app-uploads.krea.ai is rejected with 400 saying 'image_urls must be image_url values returned by POST /proxy/krea/assets', so upload the image instead; where they are, any public https image URL is accepted, and a URL that is malformed or not https is rejected with 400 (a URL whose port is numeric but out of range is not caught by this check and can fail with a 502 instead). In that case a request with any image_urls entry that is not an app-uploads.krea.ai link (a public https URL, or a base64 data: URI where those are accepted) is also rejected with 400 before any fetch unless the whole request body is sent as application/json rather than multipart, is valid UTF-8, is at most 25100288 bytes, and carries only the fields this schema declares. For a well-formed https URL in that case, a reference the caller can fix is rejected with 400 naming its host: its host does not resolve or is not publicly reachable when checked before the fetch, it redirects more than the allowed number of times, to a URL that is not https, or to a host that is not publicly reachable, it returns a 4xx other than 408 or 429, it is not an image, it is an image in a format that cannot be read, its image size header is not within the first 2 MiB, or a response with no declared length or chunked encoding ends before its image size header. Any other failure fetching it fails with a 502 error on POST /proxy/krea (Comfy Router answers it with 500 internal_error): a transient DNS, TLS or connection failure, a timeout, an origin 408, 429, 5xx or other non-200 status, or a host that passed that check but does not resolve or is not publicly reachable when the fetch connects. Some of these clear on retry (a resolver error, timeout, dropped connection, an origin answering 5xx, 408 or 429, or a host whose DNS answer switches to a non-public address between the host check and the connection, which on retry can succeed or get the 400 for a non-public host); others fail the same way every time, for example a TLS certificate the fetch does not trust (self-signed, expired or for the wrong host name), or an origin answering a 2xx other than 200 or a 3xx the fetch does not follow (such as 204, 206, 300, 304 or 305, or a 301, 302, 303, 307 or 308 with no Location), so if a retry fails the same way, upload the image instead. A request queued through Comfy Router does not retry such a failure when any of its image_urls is not an app-uploads.krea.ai link, so resubmit it yourself if the cause can clear. Where other URLs are not accepted, an app-uploads.krea.ai link that is not a live upload fails with a 5xx error; where they are, it is rejected with 400 like any other unreachable reference. While a server has not yet learned which applies, any https URL with a host that is not an app-uploads.krea.ai link, public or not, fails with a 503 error that is safe to retry (a queued request is retried on it automatically). A queued request's 400 carries only the generic invalid_input detail, so it shows neither the host nor the wording above, and the queue does not retry it. A queued 400 can come from any field, not only image_urls (for example an unsupported resolution or thinking_mode), so check the other fields first. If they are valid, upload each image to POST /proxy/krea/assets and resubmit with those image_url values and a new Idempotency-Key (or none): reusing the key with a changed body is refused with 409 invalid_input, which says nothing about the images, and reusing it with the same body is answered 201 with the original request_id and Idempotent-Replayed: true, so it does not start a new run, and its result URL returns the same 400 (its status URL answers 200 with error_type invalid_input). Where other public https URLs are accepted, if that resubmit also fails with 400, the image itself is the problem (for example it is not a supported image, or its image size header is not within the first 2 MiB). Where they are not, the same uploaded image fails with a 5xx (500 internal_error on Comfy Router) instead of that 400, and the image is still the problem, so uploading it again does not help. Only the first 2 MiB of each image is read to find its size, so an image whose size information cannot be read inside that window (such as a JPEG with over 2 MiB of embedded metadata, or a paletted PNG whose transparency data, or with none the start of its first image-data chunk, sits past 2 MiB, such as after over 2 MiB of text or color-profile chunks) is rejected with 400 saying its image size header is not within the first 2 MiB, uploaded or not; re-save it without the large metadata, or save a paletted PNG as a non-paletted PNG. Send an internationalized host in its ASCII (punycode) form; a non-ASCII host name is rejected as not existing. Omit for text-to-image.","items":{"type":"string"},"maxItems":8,"type":"array"},"model":{"description":"berry (default, quality) or jam (speed).","type":"string"},"negative_prompt":{"maxLength":1024,"type":"string"},"prompt":{"description":"What to generate. With image_urls, the editing instruction; describe what should change and what should stay the same.","type":"string"},"regional_edit":{"description":"Set true for a local edit that keeps the rest of the image. Needs model berry and at least one image in image_urls.","type":"boolean"},"resolution":{"description":"1k or 2k.","type":"string"},"seed":{"nullable":true,"type":"integer"},"thinking_mode":{"description":"fast (default), high or ultra. High and ultra plan complex edits in more detail and take longer. Ultra needs resolution 2k.","type":"string"}},"required":["prompt","resolution"],"type":"object"}}}},"responses":{"200":{"description":"OK - the model's native JSON output, returned unchanged; the schema describes the provider's terminal result document as Router returns it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/KreaJob"},{"properties":{"result":{"description":"The finished generation. Not nullable here, unlike on `KreaJob`: a terminal job whose `result` carries no `urls` is answered as a Comfy Router error, so a `200` always carries it.","properties":{"style_id":{"description":"Set by loraTraining jobs rather than by a generation; a `200` for these models carries `urls`.","type":"string"},"urls":{"description":"The generated images, as downloadable links. At least one, because a `completed` job with an empty `urls` is `success_without_output` and never reaches this document.","items":{"format":"uri","type":"string"},"minItems":1,"type":"array"}},"required":["urls"],"type":"object"},"status":{"description":"Always `completed` on this document: it is the only status Router reports as a success, and Krea's vocabulary is matched without a case fold.","enum":["completed"],"type":"string"}},"required":["status","result"],"type":"object"}],"description":"Comfy Router output schema for the Krea 2 and Krea 3 image models: the terminal `GET /proxy/krea/jobs/{job_id}` job document, forwarded unchanged. Every Krea generate operation is SUBMIT-AND-POLL — `POST /proxy/krea/generate/image/krea/krea-2/{size}` answers with this same `KreaJob` document in a NOT-YET-FINISHED state (a `job_id`, a pending `status`, a null `result`), and Router makes that submit and then polls `GET /proxy/krea/jobs/{job_id}` on the caller's behalf for all three size operations, applying the terminal-state rule below. So the body a caller receives is the finished job rather than that pending handle. The three sizes — medium, medium-turbo and large — share one status route and this one document shape, and `krea/krea-2` resolves to the same medium operation `krea/krea-2-medium` does.\nThe generated images are at `result.urls[]`, an array of downloadable links. `result` is null until the job finishes, and a caller must key completion off `result.urls` rather than off `result` being present: `KreaJobResult`'s other field, `style_id`, is what a loraTraining job returns, so a `result` carrying only a style id is a job that generated no image. Router draws the same line — a `completed` whose `result.urls` is empty is `success_without_output`, not a finished generation.\n`status` is Krea's own lowercase nine-value vocabulary — `backlogged`, `queued`, `scheduled`, `processing`, `sampling`, `intermediate-complete`, `completed`, `failed`, `cancelled` — forwarded unchanged and compared without a case fold. `completed` is the only terminal SUCCESS. `intermediate-complete` reads like a terminal state and is not: it is a partial preview of a generation that is still running, and polling continues through it — treating it as finished would return a preview as the result. `failed` and `cancelled` are both terminal FAILURES; a cancelled job is one the provider stopped, not a success that produced nothing. Through Router that distinction is already settled, because a terminal job carrying no `result.urls` is answered as a Comfy Router error rather than with the provider document. A failed job's `error.code` chooses that error: `content_policy` is `content_policy_violation`, `invalid_request` and `validation_failed` are `invalid_input` with the reason in `upstream_detail`, and every other code, like a cancelled job, is `provider_error`. Krea sets `error` only on a failed job, so a `200` carries none.\nThe composition NARROWS `KreaJob` rather than republishing it, because `KreaJob` describes every poll of the job — including the pending ones the caller never sees — while this document describes only the body a `200` carries. Router reports success on exactly one shape: `status` `completed` AND a `result.urls` with at least one non-empty entry. A still-running status is polled again rather than returned, and every other terminal reading is a Comfy Router error rather than this document, so `status` is narrowed to the single terminal success and `result` is required non-null with a non-empty `urls`. Left unnarrowed, the schema would publish `intermediate-complete` with a null `result` as a valid `200` — the preview-as-result outcome the paragraph above says Router forbids — and a generated client would type the finished asset as optional. Narrowing `status` here is safe in a way it is NOT for BFL (see `BFLRouterResultOutput`, which declines the same narrowing): Krea's vocabulary is compared WITHOUT a case fold, so `completed` is the only spelling that can reach a `200`. `minItems: 1` and not a per-item `minLength`, because Router's rule is that at least ONE element is non-empty, not that every one is.","example":{"completed_at":"2027-01-01T00:00:37Z","created_at":"2027-01-01T00:00:00Z","job_id":"7f1c2e84-5b90-4a37-8d61-2c0f9ab4e153","result":{"urls":["https://example.invalid/krea/krea-2/generated.png"]},"status":"completed"}}}}}}}}},"components":{"schemas":{"KreaJob":{"properties":{"completed_at":{"format":"date-time","nullable":true,"type":"string"},"created_at":{"format":"date-time","type":"string"},"error":{"allOf":[{"$ref":"#/components/schemas/KreaJobError"}]},"job_id":{"format":"uuid","type":"string"},"result":{"allOf":[{"$ref":"#/components/schemas/KreaJobResult"}],"nullable":true},"status":{"description":"Available options: backlogged, queued, scheduled, processing, sampling, intermediate-complete, completed, failed, cancelled","enum":["backlogged","queued","scheduled","processing","sampling","intermediate-complete","completed","failed","cancelled"],"type":"string"}},"required":["job_id","status","created_at","completed_at","result"],"type":"object"},"KreaJobError":{"description":"Set only when status is failed. A cancelled job carries none.","properties":{"code":{"description":"Why the job failed: content_policy, invalid_request, validation_failed, model_unavailable, insufficient_balance, timeout, auto_cancelled, provider_error, internal or node_app_node_failed. Treat an unknown code as internal.","type":"string"},"message":{"description":"Optional. Free-form provider text for provider_error and internal.","type":"string"},"param":{"description":"The request parameter to change, present with invalid_request and validation_failed.","type":"string"}},"required":["code"],"type":"object"},"KreaJobResult":{"properties":{"style_id":{"type":"string"},"urls":{"items":{"format":"uri","type":"string"},"type":"array"}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"krea/krea-3","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text","image"],"x-comfy-router-output-modalities":["image"]}
