- Third-party
- Zero data retention
Recraft V3 is the previous-generation text-to-image model from Recraft, well-suited to design-quality compositions, brand-aware imagery, and accurate text rendering.
| Model Info | |
|---|---|
| Terms and License | link ↗ |
| More information | link ↗ |
| Zero data retention | Yes |
| Pricing | View pricing in the Cloudflare dashboard ↗ |
Usage
const response = await env.AI.run(
'recraft/recraftv3',
{ prompt: 'A minimalist logo of a mountain range with a sun rising behind it' },
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv3",
"input": {
"prompt": "A minimalist logo of a mountain range with a sun rising behind it"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/recraft/recraftv3/simple-generation.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Examples
Scene Composition — Generate a complex compositional scene
const response = await env.AI.run(
'recraft/recraftv3',
{
prompt: 'A cozy cabin in the woods surrounded by tall pine trees, smoke rising from the chimney',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv3",
"input": {
"prompt": "A cozy cabin in the woods surrounded by tall pine trees, smoke rising from the chimney"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/recraft/recraftv3/scene-composition.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Custom Size — Specify output dimensions
const response = await env.AI.run(
'recraft/recraftv3',
{
prompt: 'A flat illustration of a workspace with a laptop, coffee cup, and potted plant',
size: '1024x1024',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv3",
"input": {
"prompt": "A flat illustration of a workspace with a laptop, coffee cup, and potted plant",
"size": "1024x1024"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/recraft/recraftv3/custom-size.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}With Color Controls — Guide generation with specific brand colors
const response = await env.AI.run(
'recraft/recraftv3',
{
prompt: 'An abstract geometric pattern suitable for a tech company brand identity',
controls: { colors: [{ rgb: [255, 107, 53] }, { rgb: [0, 43, 91] }] },
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv3",
"input": {
"prompt": "An abstract geometric pattern suitable for a tech company brand identity",
"controls": {
"colors": [
{
"rgb": [
255,
107,
53
]
},
{
"rgb": [
0,
43,
91
]
}
]
}
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/recraft/recraftv3/with-color-controls.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Background Color — Set a specific background color
const response = await env.AI.run(
'recraft/recraftv3',
{
prompt: 'A clean icon of a lightning bolt',
controls: { background_color: { rgb: [245, 245, 245] } },
size: '1024x1024',
},
)
console.log(response)curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \
--header "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
--header "Content-Type: application/json" \
--data '{
"model": "recraft/recraftv3",
"input": {
"prompt": "A clean icon of a lightning bolt",
"controls": {
"background_color": {
"rgb": [
245,
245,
245
]
}
},
"size": "1024x1024"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/recraft/recraftv3/background-color.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}Parameters
prompt
stringrequiredsize
stringstyle
stringsubstyle
string▶controls{}
objectimage
string