recraft/recraftv4_1_pro, served by Comfy Router from Recraft.
Quick start
Create a key in your Comfy workspace and export it asCOMFY_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_pro
Endpoint: POST https://api.comfy.org/v2/models/recraft/recraftv4_1_pro
- Wait for the result
- Queue and collect later
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 5object
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 generate. Recraft accepts 1-6.Range:
1 to 6string
required
The text prompt describing the image to generate
string
Possible values:
url, b64_jsonstring
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.GET /v2/models/recraft/recraftv4_1_pro/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
Base64-encoded image data (present instead of
url when the request set response_format: b64_json)string
Unique identifier for the generated image
string
URL to access the generated image (present when
response_format is url, the default)string
The resolved style id, returned by Recraft when style references are used (notably required-input models recraftv4_styles*); reusable as
style_id in later requests.Examples
Input
Output
Before you ship
The SDKs create anIdempotency-Key and reuse it for automatic retries. For manual retries, reuse the original key. Router can hold the connection for up to 10 minutes.
When a request fails, Router sends an X-Comfy-Error-Type response header explaining why. A 422 means Router rejected the input before calling the provider, and a 413 means the request body was larger than Router accepts. Download generated assets promptly because result URLs can expire.
Any size limit named in a field description above is the provider’s own bound on that field, quoted from the provider’s specification. Router applies a separate cap to the whole request body, which base64-encoded media counts against: see request body size.
Headers
Authentication, idempotency, request IDs, error buckets, retry pacing, spend limits.
Using the Router API
Model discovery, validation errors, retries, and billing.
Limitations
What Router does not do today, and what to use instead.