Skip to content
Recraft logo

Recraft V4

Text-to-ImageRecraftProxied

Recraft V4 generates art-directed images with strong composition, accurate text rendering, and design taste built in. Fast and cost-efficient at standard resolution.

Model Info
Terms and Licenselink
More informationlink
PricingView pricing in the Cloudflare dashboard

Usage

TypeScript
const response = await env.AI.run(
'recraft/recraftv4',
{ prompt: 'A minimalist logo of a mountain range with a sun rising behind it' },
)
console.log(response)
Simple Generation

Examples

Scene Composition — Generate a complex compositional scene
TypeScript
const response = await env.AI.run(
'recraft/recraftv4',
{
prompt: 'A cozy cabin in the woods surrounded by tall pine trees, smoke rising from the chimney',
},
)
console.log(response)
Scene Composition
Custom Size — Specify output dimensions
TypeScript
const response = await env.AI.run(
'recraft/recraftv4',
{
prompt: 'A flat illustration of a workspace with a laptop, coffee cup, and potted plant',
size: '1024x1024',
},
)
console.log(response)
Custom Size
With Color Controls — Guide generation with specific brand colors
TypeScript
const response = await env.AI.run(
'recraft/recraftv4',
{
controls: { colors: [{ rgb: [255, 107, 53] }, { rgb: [0, 43, 91] }] },
prompt: 'An abstract geometric pattern suitable for a tech company brand identity',
},
)
console.log(response)
With Color Controls
Background Color — Set a specific background color
TypeScript
const response = await env.AI.run(
'recraft/recraftv4',
{
controls: { background_color: { rgb: [245, 245, 245] } },
prompt: 'A clean icon of a lightning bolt',
size: '1024x1024',
},
)
console.log(response)
Background Color

Parameters

prompt
stringrequired
size
string
style
string
substyle
string

API Schemas (Raw)

Input
Output