跳转到内容

Bria Text-to-Image Base

集成

模型 id bria/text-to-image/base
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/bria/text-to-image/base?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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

此请求: $0.16 160 API 积分 在此页面运行

获取 API 密钥
Bria AI · 图像

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

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

构建请求

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

•必填

指导图像生成的文本提示词。

aspect_ratio 默认 1:1

不使用引导时的生成输出宽高比;使用引导方法时,会改用其引导图像的宽高比并忽略此设置。

num_images 默认 4

请求的图像数量;使用任何引导方法时都会覆盖为 1。

高级 negative_prompt · medium · num_inference_steps · guidance_scale · seed · prompt_enhancement · guidance
默认

用于图像生成的负面文本提示词。

medium

生成图像所使用的媒介。留空或赋值为 null 可自动选择媒介。

默认 30

用于优化输出图像的模型迭代次数,可选。

默认 5

图像选择对提示词的遵循强度,以 CFG(Classifier Free Guidance)表示。

用于生成可复现图像的种子:模型版本不变时,相同的提示词和种子会生成相同图像。

默认 []

生成引导图像,通过可在一次推理中组合的方法提供,最多支持 4 种方法。

POST /run/bria/text-to-image/base?wait=20 报价 → $0.16
# Run the model; wait up to 20 s for the finished result in the same call
curl -X POST "https://api.doitong.com/v1/run/bria/text-to-image/base?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.com/v1/requests/REQUEST_ID?wait=20" \
  -H "Authorization: Bearer $DOITONG_API_KEY"

运行此请求

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

关于 Bria Text-to-Image Base

根据 `prompt` 生成图像,`aspect_ratio` 支持从 1:1 到 16:9 的选项,每次请求生成 1 到 4 张图像(默认 4)。控制项包括 `negative_prompt`、范围为 0 到 20 的 `guidance_scale`、范围为 20 到 50 的 `num_inference_steps` 以及可选的 `prompt_enhancement`。`medium` 可选 photography 或 art,`guidance` 最多接受 4 张组合引导图。

参数

发送规范名称或原生名称之一,不要同时发送两者。 规范名称

名称类型 默认值允许值 描述
prompt必填
类型string
指导图像生成的文本提示词。
negative_prompt可选
类型string
默认值
用于图像生成的负面文本提示词。
num_images可选 num_outputs
类型integer
默认值4
1 – 4
请求的图像数量;使用任何引导方法时都会覆盖为 1。
aspect_ratio可选
类型enum
默认值1:1
1:12:33:23:44:34:55:49:1616:9
不使用引导时的生成输出宽高比;使用引导方法时,会改用其引导图像的宽高比并忽略此设置。
seed可选
类型integer | null
0 – 2,147,483,647
用于生成可复现图像的种子:模型版本不变时,相同的提示词和种子会生成相同图像。
num_inference_steps可选
类型integer
默认值30
20 – 50
用于优化输出图像的模型迭代次数,可选。
guidance_scale可选
类型number
默认值5
0 – 20
图像选择对提示词的遵循强度,以 CFG(Classifier Free Guidance)表示。
prompt_enhancement可选
类型boolean
默认值false
提示词增强开关:true 会将所提供的提示词扩展为更多变体并加入更丰富的描述,从而生成更多样、更具创意的图像。
medium可选
类型enum
photographyart
生成图像所使用的媒介。留空或赋值为 null 可自动选择媒介。
guidance可选
类型object[]
默认值[]
生成引导图像,通过可在一次推理中组合的方法提供,最多支持 4 种方法。
guidance[].image_url必填
类型url · image
由 base64 编码的 guidance_method_1 引导图像;选择 guidance_method_1 时必须提供图像。支持的格式:jpeg、jpg、png、webp;最大大小为 12 MB。组合引导方法时,每张引导图像必须具有相同的宽高比,该宽高比也决定输出宽高比。
guidance[].method可选
类型enum
controlnet_cannycontrolnet_depthcontrolnet_recoloringcontrolnet_color_grid
可选的生成引导类型。一次推理最多可组合 4 种引导方法。
guidance[].scale可选
类型number
默认值1
0 – 1
引导效果的强度。
必填 规范名称,也可接受

输出

GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
  "id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
  "object": "request",
  "model": "bria/text-to-image/base",
  "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": 160,
    "usd": "0.16",
    "charged": 160,
    "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.com/v1/requests/req_8k2m4q7x1z9c3v5b6n0p2r4t",
    "cancel": "https://api.doitong.com/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/bria/text-to-image/base.md. 所有模型和指南: https://doitong.com/developers/llms.txt