跳转到内容
本站为社区维护的非官方中文翻译,与 Cloudflare, Inc. 无关联。本站不提供账户登录,请勿在任何非官方站点输入您的 Cloudflare 账户信息。官方文档:developers.cloudflare.com

Krea 2 Medium

Text-to-Image • krea

查看 MarkdownAgent 设置
  • 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 或省略则使用随机种子。
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。
image
stringformat: uri生成图像的预签名 URL。

API schema(原始)

输入
输出

这篇文档对您有帮助吗?