- Third-party
更小、更快、更具成本效益。大量的后训练使输出在多次生成之间格外稳定一致。最擅长插画、动漫、绘画以及其他富有表现力的艺术风格。
| 模型信息 | |
|---|---|
| 条款和许可证 | 链接 ↗ |
| 更多信息 | 链接 ↗ |
| 定价 | 在 Cloudflare 仪表板中查看定价 ↗ |
用法
const response = await env.AI.run(
'krea/krea-2-medium',
{
prompt: "An igloo village glowing with Aurora's colors.",
aspect_ratio: '1:1',
resolution: '1K',
},
)
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": "krea/krea-2-medium",
"input": {
"prompt": "An igloo village glowing with Aurora'\''s colors.",
"aspect_ratio": "1:1",
"resolution": "1K"
}
}'
{
"state": "Completed",
"result": {
"image": "https://examples.aig.cloudflare.com/krea/krea-2-medium/default.png"
},
"gatewayMetadata": {
"keySource": "Unified"
}
}参数
prompt
stringrequired描述要生成的图像的文本提示词。aspect_ratio
stringrequiredenum: 1:1, 4:3, 3:2, 16:9, 2.35:1, 4:5, 2:3, 9:16生成图像的宽高比。resolution
stringrequiredenum: 1K分辨率缩放比例。seed
number | null用于可复现生成的随机种子。传入 null 或省略则使用随机种子。▶styles[]
array要应用于生成的风格(通常为 LoRA)。▶image_style_references[]
arraymaxItems: 10用于驱动视觉风格的参考图像(最多 10 张)。creativity
stringdefault: lowenum: raw, low, medium, high提示词扩写模式。`raw` 禁用扩写;`low`、`medium`、`high` 控制扩写强度。不影响 K2 Intensity、Complexity 或 Movement 滑块 LoRA。intensity
integerdefault: 0minimum: -100maximum: 100K2 Intensity 滑块(-100 至 100)。0 表示禁用该滑块 LoRA。complexity
integerdefault: 0minimum: -100maximum: 100K2 Complexity 滑块(-100 至 100)。0 表示禁用该滑块 LoRA。movement
integerdefault: 0minimum: -100maximum: 100K2 Movement 滑块(-100 至 100)。0 表示禁用该滑块 LoRA。▶moodboards[]
arraymaxItems: 1情绪板参考(目前限制为一个)。image
stringformat: uri生成图像的预签名 URL。