Skip to main content
API Reference for recraft/recraftv4_1_vector, served by Comfy Router from Recraft.

Quick start

Create a key at platform.comfy.org/profile/api-keys and export it as COMFY_API_KEY. The Python and TypeScript snippets use the Comfy SDKs (pip install comfy-sdk, npm install @comfyorg/sdk); the cURL snippet is the same call over raw HTTP. Model ID: recraft/recraftv4_1_vector Endpoint: POST https://api.comfy.org/v2/models/recraft/recraftv4_1_vector

Schema

Input

object
The controls for the generated image
integer
Defines artistic tone of your image. At a simple level, the person looks straight at the camera in a static and clean style. Dynamic and eccentric levels introduce movement and creativity.Range: 0 to 5
object
RGB color values
integer[]
required
object[]
An array of preferable colors
integer[]
required
boolean
Do not embed text layouts
string
The model to use for generation (e.g., “recraftv3”). This field is NOT constrained to an enum: the proxy forwards whatever the caller sends. The spellings Comfy ships — the set Comfy Router addresses as recraft/<model> — are recraftv2, recraftv3, recraftv4, recraftv4_pro, recraftv4_1, recraftv4_1_utility, recraftv4_1_pro, recraftv4_1_utility_pro, recraftv4_styles, recraftv4_styles_pro, recraftv4_1_vector, recraftv4_1_utility_vector, recraftv4_1_pro_vector, recraftv4_1_utility_pro_vector, recraftv4_styles_vector and recraftv4_styles_pro_vector. They are written out here rather than named by reference because the RecraftGenerationModel component that declares them is $ref-ed by nothing and is therefore pruned from the spec served at GET /openapi, so a pointer to it would dangle in the served document. The four recraftv4_styles* spellings additionally require style_id — see that field.
integer
The number of images to generateRange: 1 to 6
string
required
The text prompt describing the image to generate
string
The size of the generated image (e.g., “1024x1024”)
string
The style to apply to the generated image (e.g., “digital_illustration”)
string
The style ID to apply to the generated image (e.g., “123e4567-e89b-12d3-a456-426614174000”). If style_id is provided, style should not be provided. REQUIRED by the four recraftv4_styles* models: Recraft rejects those without a style_id or style reference. Mint one with POST /proxy/recraft/styles, which this same proxy serves under the same credentials. Nothing on this route enforces the pairing — the body is forwarded to Recraft unchanged, so a recraftv4_styles* call without it reaches the partner and comes back 4xx.
Generated from the schema Router serves at GET /v2/models/recraft/recraftv4_1_vector/openapi.json, the same document it validates a call against before the request reaches the provider.

Output

integer
required
Unix timestamp when the generation was created
integer
required
Number of credits used for the generation
object[]
required
Array of generated image information
string
Unique identifier for the generated image
string
URL to access the generated image

Examples

Input

Output

Before you ship

The snippets above are the shortest working call. Three things are the same for every model and are documented once on the Comfy Router headers page: send an Idempotency-Key on every paid call and reuse it when you retry, expect the connection to be held up to Router’s 10 minute deadline, and keep X-Comfy-Request-Id from every response. The SDKs do all three for you; the cURL tab does none of them. On failure, X-Comfy-Error-Type names the bucket, and a 422 means the body failed the model’s schema and was never billed.

Headers

Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.

Quick Start

Typed error handling in Python and TypeScript, reading the 422, walking the catalog.

Limitations

What Router does not do today, and what to use instead.