Fibo · Structured Prompt
集成
模型 id
bria/fibo/generate/structured_prompt
# 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/fibo/generate/structured_prompt?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"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/bria/fibo/generate/structured_prompt?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/bria/fibo/generate/structured_prompt", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
# 1. Connect once (Claude Code; Cursor, VS Code, Claude Desktop: https://doitong.com/zh/developers/docs/mcp)
claude mcp add --transport http doitong-models https://api.doitong.com/v1/mcp \
--header "Authorization: Bearer $DOITONG_API_KEY"
# 2. Your agent calls the "run" tool with:
{
"model_id": "bria/fibo/generate/structured_prompt",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
}
通过 Doitong API 调用 Fibo · Structured Prompt 模型(bria/fibo/generate/structured_prompt)。智能体文档:https://doitong.com/zh/developers/models/bria/fibo/generate/structured_prompt.md
POST https://api.doitong.com/v1/run/bria/fibo/generate/structured_prompt?wait=20
Authorization: Bearer $DOITONG_API_KEY
Content-Type: application/json
{
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}
如果响应状态为 "queued" 或 "running",请轮询 GET https://api.doitong.com/v1/requests/REQUEST_ID?wait=20,直到状态变为 "succeeded";文件位于 outputs[].url。使用相同请求体 POST https://api.doitong.com/v1/quote/bria/fibo/generate/structured_prompt,可在运行前返回确切价格。
此请求: $0.01 10 API 积分 在此页面运行
你的新 API 密钥。 它仅在此时显示,并且已填入下方的代码和 API 密钥字段中。请妥善保密:切勿将其放入在浏览器中运行的代码。
构建请求
控件根据模型架构生成。更改控件时,代码和价格会同步更新。
POST
/run/bria/fibo/generate/structured_prompt?wait=20
报价 → $0.01
# 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/fibo/generate/structured_prompt?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"
const API = "https://api.doitong.com/v1";
const headers = {
"Authorization": "Bearer " + process.env.DOITONG_API_KEY,
"Content-Type": "application/json",
};
// Run the model; wait up to 20 s for the finished result in the same call
let res = await fetch(API + "/run/bria/fibo/generate/structured_prompt?wait=20", {
method: "POST",
headers,
body: JSON.stringify({
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
}),
});
let request = await res.json();
if (!res.ok) throw new Error(request.error.code + ": " + request.error.message);
// Not finished yet: long-poll until it is
while (request.status === "queued" || request.status === "running") {
res = await fetch(API + "/requests/" + request.id + "?wait=20", { headers });
request = await res.json();
}
if (request.status !== "succeeded") throw new Error(JSON.stringify(request.error));
console.log(request.outputs.map((o) => o.url), request.cost.credits + " API credits ($" + request.cost.usd + ")");
import os
import requests
API = "https://api.doitong.com/v1"
headers = {"Authorization": "Bearer " + os.environ["DOITONG_API_KEY"]}
payload = {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field",
}
# Run the model; wait up to 20 s for the finished result in the same call
r = requests.post(API + "/run/bria/fibo/generate/structured_prompt", params={"wait": 20}, json=payload, headers=headers)
request = r.json()
if not r.ok:
raise RuntimeError(request["error"]["code"] + ": " + request["error"]["message"])
# Not finished yet: long-poll until it is
while request["status"] in ("queued", "running"):
request = requests.get(API + "/requests/" + request["id"], params={"wait": 20}, headers=headers).json()
if request["status"] != "succeeded":
raise RuntimeError(request["error"])
print([o["url"] for o in request["outputs"]], request["cost"]["credits"], "API credits", "$" + request["cost"]["usd"])
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "run",
"arguments": {
"model_id": "bria/fibo/generate/structured_prompt",
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"wait_seconds": 20
}
}
}
关于 Fibo · Structured Prompt
类似语言模型的端点,返回图像的结构化提示,而不是图像本身。输入包括 `prompt`、现有的 `structured_prompt` 或参考 `image_url`,以及 `seed`。JSON 输出包括美学、光照、对象、摄影特征、简短描述、风格媒介和要渲染的文本等字段。
参数
发送规范名称或原生名称之一,不要同时发送两者。 规范名称
名称类型
默认值允许值
描述
prompt可选
类型string | null
用于生成图像的提示词。
structured_prompt可选
类型object
用于图像生成的结构化提示词。
structured_prompt.short_description可选
类型string | null
对目标输出图像的简要描述。
structured_prompt.objects可选
类型object[]
默认值[]
以列表形式指定生成图像的内容,记录每个对象的属性及其与其他对象的关系。
structured_prompt.objects[].description可选
类型string | null
目标输出对象的描述。
structured_prompt.objects[].location可选
类型string | null
对象在图像中的位置。
structured_prompt.objects[].relationship必填
类型string
对象与图像中其他对象的关系。
structured_prompt.objects[].relative_size可选
类型string | null
对象相对于图像的尺寸。
structured_prompt.objects[].shape_and_color可选
类型string | null
对象的形状和颜色。
structured_prompt.objects[].texture可选
类型string | null
对象的纹理。
structured_prompt.objects[].appearance_details可选
类型string | null
描述对象外观的详细信息。
structured_prompt.objects[].number_of_objects可选
类型integer | null
图像中的对象数量。
structured_prompt.objects[].pose可选
类型string | null
所描绘对象的姿势。
structured_prompt.objects[].expression可选
类型string | null
所描绘对象的表情。
structured_prompt.objects[].clothing可选
类型string | null
所描绘对象穿着的服装。
structured_prompt.objects[].action可选
类型string | null
所描绘对象执行的动作。
structured_prompt.objects[].gender可选
类型string | null
所描绘对象的性别。
structured_prompt.objects[].skin_tone_and_texture可选
类型string | null
所描绘对象的皮肤纹理和色调。
structured_prompt.objects[].orientation可选
类型string | null
所描绘对象的朝向。
structured_prompt.background_setting可选
类型string | null
生成图像的背景环境。
structured_prompt.lighting可选
类型object
生成图像的照明。
structured_prompt.lighting.conditions可选
类型string | null
生成图像的光照条件。
structured_prompt.lighting.direction可选
类型string | null
生成图像的光照方向。
structured_prompt.lighting.shadows可选
类型string | null
生成图像中要描绘的阴影。
structured_prompt.aesthetics可选
类型object
生成图像的美学特征。
structured_prompt.aesthetics.composition可选
类型string | null
生成图像的构图。
structured_prompt.aesthetics.color_scheme可选
类型string | null
生成图像的调色板。
structured_prompt.aesthetics.mood_atmosphere可选
类型string | null
生成图像的情绪和氛围。
structured_prompt.aesthetics.aesthetic_score可选
类型string | null
正在生成图像的美学评分。
structured_prompt.aesthetics.preference_score可选
类型string | null
正在生成图像的偏好评分。
structured_prompt.photographic_characteristics可选
类型object
生成图像的摄影属性。
structured_prompt.photographic_characteristics.depth_of_field可选
类型string | null
生成图像的景深。
structured_prompt.photographic_characteristics.focus可选
类型string | null
生成图像的焦点。
structured_prompt.photographic_characteristics.camera_angle可选
类型string | null
生成图像的相机角度。
structured_prompt.photographic_characteristics.lens_focal_length可选
类型string | null
生成图像的镜头设置,以焦距表示。
structured_prompt.style_medium可选
类型string | null
生成图像的艺术媒介。
structured_prompt.text_render可选
类型any[]
默认值[]
要包含在图像中的文本条目列表。
structured_prompt.context可选
类型string | null
生成图像的上下文。
structured_prompt.artistic_style可选
类型string | null
生成图像的艺术风格。
structured_prompt.trigger_word可选
类型string | null
structured_prompt.sub_trigger_word可选
类型string | null
structured_prompt.art_direction可选
类型string | null
structured_prompt.action_description可选
类型string | null
structured_prompt.actor_prefix可选
类型string | null
image_url可选
image
类型url · image
以文件或 URL 形式提供的参考图像。
seed可选
类型integer
默认值5555
控制随机性的种子,以获得可复现的结果。
必填
规范名称,也可接受
文件参数接受公开的 https:// URL、最大 10 MB 的 data: URI,或上传文件的 file_url。 文件
输出
GET /requests/req_8k2m4q7x1z9c3v5b6n0p2r4t
{
"id": "req_8k2m4q7x1z9c3v5b6n0p2r4t",
"object": "request",
"model": "bria/fibo/generate/structured_prompt",
"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": 10,
"usd": "0.01",
"charged": 10,
"refunded": 0
},
"input": {
"prompt": "A red fox trots through fresh snow at sunrise, soft golden light, shallow depth of field"
},
"output": {
"short_description": "string",
"objects": [
{
"description": "string",
"location": "string",
"relationship": "string",
"relative_size": "string",
"shape_and_color": "string",
"texture": "string",
"appearance_details": "string",
"number_of_objects": 1,
"pose": "string",
"expression": "string",
"clothing": "string",
"action": "string",
"gender": "string",
"skin_tone_and_texture": "string",
"orientation": "string"
}
],
"background_setting": "string",
"lighting": {
"conditions": "string",
"direction": "string",
"shadows": "string"
},
"aesthetics": {
"composition": "string",
"color_scheme": "string",
"mood_atmosphere": "string",
"aesthetic_score": "string",
"preference_score": "string"
},
"photographic_characteristics": {
"depth_of_field": "string",
"focus": "string",
"camera_angle": "string",
"lens_focal_length": "string"
},
"style_medium": "string",
"text_render": [],
"context": "string",
"artistic_style": "string"
},
"outputs": [
{
"type": "file",
"url": "https://content.doitong.com/dev-api/2026/10/20/req_8k2m4q7x1z9c3v5b6n0p2r4t/0-output.jpeg",
"content_type": "image/jpeg",
"file_size": 1843200,
"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 是模型自身的结果对象。
输出字段
- short_description
- string | null对目标输出图像的简要描述。
- objects
- array of object {description, location, relationship, relative_size, shape_and_color, texture, appearance_details, number_of_objects, pose, expression, clothing, action, gender, skin_tone_and_texture, orientation} | null以列表形式指定生成图像的内容,记录每个对象的属性及其与其他对象的关系。
- background_setting
- string | null生成图像的背景环境。
- lighting
- object {conditions, direction, shadows} | null生成图像的照明。
- aesthetics
- object {composition, color_scheme, mood_atmosphere, aesthetic_score, preference_score} | null生成图像的美学特征。
- photographic_characteristics
- object {depth_of_field, focus, camera_angle, lens_focal_length} | null生成图像的摄影属性。
- style_medium
- string | null生成图像的艺术媒介。
- text_render
- array of any | null要包含在图像中的文本条目列表。
- context
- string | null生成图像的上下文。
- artistic_style
- string | null生成图像的艺术风格。
其他 Bria Fibo 变体
更多模型:LLM
对于 AI 代理:此页面的 Markdown 版本位于 https://doitong.com/zh/developers/models/bria/fibo/generate/structured_prompt.md. 所有模型和指南: https://doitong.com/developers/llms.txt