{"openapi":"3.0.2","info":{"title":"krea/krea-2-large","description":"The request body Comfy Router accepts for the model \"krea/krea-2-large\", 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":"a26e723005db"},"paths":{"/v2/models/krea/krea-2-large":{"post":{"operationId":"runRouterModel","summary":"Run krea/krea-2-large synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"example":{"aspect_ratio":"1:1","prompt":"a red circle","resolution":"1K"},"properties":{"aspect_ratio":{"description":"Aspect ratio. One of: 1:1, 4:3, 3:2, 16:9, 2.35:1, 4:5, 2:3, 9:16.","enum":["1:1","4:3","3:2","16:9","2.35:1","4:5","2:3","9:16"],"type":"string"},"creativity":{"default":"medium","description":"Prompt interpretation strength: raw=0, low=10, medium=50, high=100.","enum":["raw","low","medium","high"],"type":"string"},"image_style_references":{"description":"Style references to use for the generation","items":{"$ref":"#/components/schemas/KreaImageStyleReference"},"maxItems":10,"type":"array"},"moodboards":{"description":"Moodboards to use for generation. Currently limited to one moodboard.","items":{"$ref":"#/components/schemas/KreaMoodboard"},"maxItems":1,"type":"array"},"prompt":{"type":"string"},"resolution":{"description":"Resolution scale. One of: 1K.","enum":["1K"],"type":"string"},"seed":{"nullable":true,"type":"number"},"styles":{"description":"Styles (typically LoRAs) to use for the generation","items":{"$ref":"#/components/schemas/KreaStyle"},"type":"array"}},"required":["prompt","aspect_ratio","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":{"KreaImageStyleReference":{"properties":{"strength":{"format":"double","maximum":2,"minimum":-2,"type":"number"},"url":{"format":"uri","type":"string"}},"required":["strength"],"type":"object"},"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"},"KreaMoodboard":{"properties":{"id":{"format":"uuid","type":"string"},"strength":{"default":0.35,"format":"double","maximum":1.5,"minimum":-0.5,"type":"number"}},"required":["id"],"type":"object"},"KreaStyle":{"properties":{"id":{"type":"string"},"strength":{"format":"double","maximum":2,"minimum":-2,"type":"number"}},"required":["id","strength"],"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-2-large","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text"],"x-comfy-router-output-modalities":["image"]}
