跳转到内容

Krea 2 Medium

集成

模型 id krea/v2/medium/text-to-image
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/krea/v2/medium/text-to-image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此请求: $0.03 30 API 积分 · ≈ ₽3.23 在此页面运行

获取 API 密钥
Krea 文生图 参考输入 #text-to-image#image-generation#style-reference#krea

文本生成图像,支持创意程度、八种宽高比,以及可选的风格参考图、预设风格和情绪板

Krea · 图像

你的第一个结果将在此显示

在下方构建请求,并使用你的 API 密钥运行。输出会复制到我们的存储中,可永久保存或免费保存 7 天。

构建请求

控件根据模型架构生成。更改控件时,代码和价格会同步更新。

•必填 88 / 5000

指定所需图像内容的文本。

aspect_ratio 默认 1:1

输出图像的宽高比。

高级 creativity · seed · enable_safety_checker · image_style_references · styles · moodboards
creativity 默认 medium

提示词解释灵活度:较低设置更贴合提示词,较高设置带来更强的创造性,但可能偏离提示词。

使生成结果可复现的随机种子。

默认 []

使用最多 10 个参考图像指导生成图像的风格;提供此列表为可选项。

默认 []

可选的基于 LoRA 的 Krea 风格预设,最多 10 项。每项使用其在 Krea 风格目录中的 `id` 标识风格。

默认 []

可选的生成灵感板,通过条目的 UUID `id` 选择。当前每个请求最多只能指定一个灵感板。

POST /run/krea/v2/medium/text-to-image?wait=20 报价 → $0.03
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.ru/v1/run/krea/v2/medium/text-to-image?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  }'

# Still "queued" or "running"? Poll with the id from the response:
curl "https://api.doitong.ru/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

你的密钥会保留在此浏览器中:仅发送到 Doitong API;只有勾选“记住”后才会保存到 localStorage。 获取 API 密钥

关于 Krea 2 Medium

根据最长 5000 个字符的文本提示词生成图像。`aspect_ratio` 提供八种选项,范围从 1:1 到 2.35:1 及 9:16。`creativity` 从 raw 到 high,控制结果遵循提示词的程度。你可以使用最多 10 个 `image_style_references`、最多 10 个预设 `styles` 或一个情绪板引导外观,并设置 `seed` 以获得可复现结果。

参数

名称类型 默认值允许值 描述
prompt必填
类型string
≤ 5,000 个字符
指定所需图像内容的文本。
aspect_ratio可选
类型enum
默认值1:1
1:14:33:216:92.35:14:52:39:16
输出图像的宽高比。
creativity可选
类型enum
默认值medium
rawlowmediumhigh
提示词解释灵活度:较低设置更贴合提示词,较高设置带来更强的创造性,但可能偏离提示词。
seed可选
类型integer | null
使生成结果可复现的随机种子。
image_style_references可选
类型object[]
默认值[]
≤ 10 个项目
使用最多 10 个参考图像指导生成图像的风格;提供此列表为可选项。
image_style_references[].image_url必填
类型url · image
可公开访问的参考图像 URL。
image_style_references[].strength可选
类型number
默认值1
-2 – 2
设置参考图像对生成图像的影响;使用负值可使结果偏离该参考图像。
styles可选
类型object[]
默认值[]
≤ 10 个项目
可选的基于 LoRA 的 Krea 风格预设,最多 10 项。每项使用其在 Krea 风格目录中的 `id` 标识风格。
styles[].id必填
类型string
使用 Krea 风格目录中的标识符选择风格;所选预设基于 LoRA。
styles[].strength可选
类型number
默认值1
-2 – 2
设置风格对生成图像的影响;使用负值可使结果偏离该风格。
moodboards可选
类型object[]
默认值[]
≤ 1 个项目
可选的生成灵感板,通过条目的 UUID `id` 选择。当前每个请求最多只能指定一个灵感板。
moodboards[].id必填
类型string
标识 Krea 灵感板的 UUID。
moodboards[].strength可选
类型number
默认值0.23
0 – 1
灵感板对图像生成的影响强度。
enable_safety_checker可选
类型boolean
默认值true
调用方获得授权后,可将其设置为 false 以放宽审核。
必填

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "krea/v2/medium/text-to-image",
  "status": "succeeded",
  "created_at": "2026-10-20T12:00:00Z",
  "started_at": "2026-10-20T12:00:02Z",
  "completed_at": "2026-10-20T12:00:09Z",
  "queue_position": null,
  "cost": {
    "credits": 30,
    "usd": "0.03",
    "charged": 30,
    "refunded": 0
  },
  "input": {
    "prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
  },
  "output": {
    "images": [
      {
        "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
        "content_type": "image/jpeg",
        "file_name": "0-output.jpeg",
        "file_size": 1843200,
        "width": 1024,
        "height": 768
      }
    ],
    "seed": 42
  },
  "outputs": [
    {
      "type": "image",
      "url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
      "content_type": "image/jpeg",
      "file_size": 1843200,
      "width": 1024,
      "height": 768,
      "stored": true
    }
  ],
  "error": null,
  "metrics": {
    "inference_seconds": 6.8
  },
  "urls": {
    "self": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.ru/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t/cancel"
  }
}
你的文件,由你选择每个 outputs[].url 都是存储中的副本:可永久保存(按 GB-月付费),也可免费保存 7 天,由账户设置或 ?storage= 决定。
每个模型的结构相同图像、视频和音频均包含 type、url、content_type、width、height 和 duration。output 是模型自身的结果对象。
输出字段
images
array of object {url, content_type, file_name, file_size, width, height}模型生成的图像。
seed
integer图像生成过程中使用的种子。

更多模型:文生图

对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/krea/v2/medium/text-to-image.md. 所有模型和指南: https://doitong.com/developers/llms.txt