- サードパーティ
- ゼロデータ保持
Recraft V4 は、構図、正確なテキスト描画、デザインセンスを備えたアートディレクション画像を生成します。標準解像度では高速かつコスト効率に優れています。
| モデル情報 | |
|---|---|
| 利用規約とライセンス | リンク ↗ |
| 詳細情報 | リンク ↗ |
| ゼロデータ保持 | はい |
| 料金 | Cloudflare ダッシュボードで料金を見る ↗ |
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)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/recraftv4",
"input": {
"prompt": "A minimalist logo of a mountain range with a sun rising behind it"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4/simple-generation.png"
},
"state": "Completed"
}場面構成 — 複雑な構図のシーンを生成します
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)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/recraftv4",
"input": {
"prompt": "A cozy cabin in the woods surrounded by tall pine trees, smoke rising from the chimney"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4/scene-composition.png"
},
"state": "Completed"
}カスタムサイズ — 出力サイズを指定します
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)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/recraftv4",
"input": {
"prompt": "A flat illustration of a workspace with a laptop, coffee cup, and potted plant",
"size": "1024x1024"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4/custom-size.png"
},
"state": "Completed"
}色の制御あり — 指定したブランドカラーで生成を案内します
const response = await env.AI.run(
'recraft/recraftv4',
{
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/recraftv4",
"input": {
"prompt": "An abstract geometric pattern suitable for a tech company brand identity",
"controls": {
"colors": [
{
"rgb": [
255,
107,
53
]
},
{
"rgb": [
0,
43,
91
]
}
]
}
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4/with-color-controls.png"
},
"state": "Completed"
}背景色 — 特定の背景色を指定します
const response = await env.AI.run(
'recraft/recraftv4',
{
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/recraftv4",
"input": {
"prompt": "A clean icon of a lightning bolt",
"controls": {
"background_color": {
"rgb": [
245,
245,
245
]
}
},
"size": "1024x1024"
}
}'
{
"gatewayMetadata": {
"keySource": "Unified"
},
"result": {
"image": "https://pub-04a6d208d361438ea01b797e6973bd19.r2.dev/catalog/recraft__recraftv4/background-color.png"
},
"state": "Completed"
}prompt
string必須size
stringstyle
stringsubstyle
string▶controls{}
objectimage
string