Doubao Seedream 5.0 Lite API 接口、参数 & 代码示例
doubao/doubao-seedream-5.0-lite
Doubao Seedream 5.0 Lite(豆包图像创作模型 5.0 Lite)是字节跳动推出的一款专业级图像创作与多模态创意模型。作为 Seedream 系列的最新轻量化(Lite)迭代版本,它不仅在画面表现上继承了豆包一贯的高水准,更在实时检索、跨模态推理及一致性上实现了跨越式的升级。
- 模型 ID
- doubao/doubao-seedream-5.0-lite
- 模型系列
- Doubao
- 更新日期
- 模型能力
- 图片生成
- 模型价格(每张)
- ¥ 0.25
Doubao Seedream 5.0 Lite 模型介绍:
Doubao-Seedream-5.0-lite(豆包图像创作模型 5.0 Lite)是字节跳动推出的一款专业级图像创作与多模态创意模型。
作为 Seedream 系列的最新轻量化(Lite)迭代版本,它不仅在画面表现上继承了豆包一贯的高水准,更在实时检索、跨模态推理及一致性上实现了跨越式的升级。
核心升级与亮点能力
- 首次引入“联网实时检索”生图
这是该模型最瞩目的突破。模型原生支持将实时网络信息与生图融合。
- 时效性创作:能够理解当天或最新的时事、天气、资讯,并将其视觉化。例如,你可以直接让它“制作一张上海未来5日的天气预报图,包含温度和穿搭建议”,它能通过联网获取真实数据并直接生成极具设计感的可视化图表或插画。
- 强大的多模态理解与推理
Seedream 5.0 Lite 已经从纯粹的“文生图”演变为一个通用多模态创意引擎。
- 草图/逻辑转化:用户可以输入粗略的草图或抽象的逻辑线索,模型能够深度理解并将其直接转化为商业级的设计稿。
- 数据可视化:能够完美消化原始数据或知识集,将其转化为用于演示或海报的清晰视觉图表。
- 精准的指令遵循与细节控制
相比此前的 4.5 版本,5.0 Lite 在空间逻辑和笔刷风格的控制上更加精准。
- 能够完美识别和执行复杂的相机角度、特定艺术流派的笔刷质感。
- 局部高保真编辑:在对图像进行局部修改时,可以做到“保持动作和主体不变,仅将服装材质从金属换成透明清水”,并能完美呈现透出的皮肤细节。
- 极致的主体与特征一致性
在进行“多图参考”或组图生成时,5.0 Lite 带来了极高的稳定性:
- 无论是面部细节还是背景特征,在多轮、批量输出中都能保持极高的一致性。
- 能够很好地保留自然的肤色、神态和姿势,极大降低了 AI 生图常见的“崩坏”和“串味”概率。
核心应用场景
由于 5.0 Lite 兼顾了超高的生成速度与影音级质量,它的应用广度非常高:
| 应用方向 | 典型场景 |
|---|---|
| 商业设计与营销 | 品牌与创意海报、电商运营视觉、UI 界面设计、社交媒体配图、字体与元素资源。 |
| 内容与影视创作 | 故事及短片分镜创作、原创角色/游戏前期设定、漫画绘制、儿童读物插画。 |
| UGC 与娱乐玩法 | 智能照片编辑、一键换背景、无损滤镜与色彩分级、肖像风格化及趣味 Meme 梗图制作。 |
API 接口地址:
https://wcode.net/api/gpt/v1/images/generations
此 API 接口兼容 OpenAI 的 Images 接口规范,可直接使用 OpenAI 的 SDK 来调用。仅需替换以下配置即可:
base_url替换为https://wcode.net/api/gpt/v1api_key替换为从 https://platform.wcode.net 获取到的 API Key具体可参考下方的各编程语言代码示例中的 OpenAI SDK 调用示例。
请求方法:
POST
各编程语言代码示例:
# TODO: 以下代码中的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
curl --request POST 'https://wcode.net/api/gpt/v1/images/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer API_KEY' \
--data '{
"model": "doubao/doubao-seedream-5.0-lite",
"prompt": "一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"
}'
import Foundation
let headers = [
"Authorization": "Bearer API_KEY", // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
"Content-Type": "application/json"
]
let parameters = [
"model": "doubao/doubao-seedream-5.0-lite",
"prompt": "一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"
] as [String : Any]
let postData = try! JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "https://wcode.net/api/gpt/v1/images/generations")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 60.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if let data = data {
print(String(data: data, encoding: .utf8) ?? "")
}
})
dataTask.resume()
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<void> main() async {
final response = await http.post(
Uri.parse('https://wcode.net/api/gpt/v1/images/generations'),
headers: {
'Authorization': 'Bearer API_KEY', // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
'Content-Type': 'application/json',
},
body: jsonEncode({
'model': 'doubao/doubao-seedream-5.0-lite',
'prompt': '一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云',
}),
);
print(response.body);
}
require 'uri'
require 'json'
require 'net/http'
url = URI("https://wcode.net/api/gpt/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer API_KEY' # TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
request["Content-Type"] = 'application/json'
request.body = {
model: 'doubao/doubao-seedream-5.0-lite',
prompt: '一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云'
}.to_json
response = http.request(request)
puts response.read_body
#[tokio::main]
pub async fn main() {
let client = reqwest::Client::new();
let response = client.post("https://wcode.net/api/gpt/v1/images/generations")
.header("Authorization", "Bearer API_KEY") // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
.header("Content-Type", "application/json")
.json(&serde_json::json!({
"model": "doubao/doubao-seedream-5.0-lite",
"prompt": "一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"
}))
.send()
.await
.unwrap();
println!("{}", response.text().await.unwrap());
}
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "https://wcode.net/api/gpt/v1/images/generations");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Content-Type: application/json");
headers = curl_slist_append(headers, "Authorization: Bearer API_KEY"); // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
const char *data = "{\"model\":\"doubao/doubao-seedream-5.0-lite\",\"prompt\":\"一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云\"}";
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, data);
CURLcode ret = curl_easy_perform(hnd);
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://wcode.net/api/gpt/v1/images/generations"
payload := []byte(`{"model":"doubao/doubao-seedream-5.0-lite","prompt":"一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"}`)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(payload))
req.Header.Add("Authorization", "Bearer API_KEY") // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
respBody, _ := io.ReadAll(res.Body)
fmt.Println(string(respBody))
}
using System.Net.Http.Json;
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY"); // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
var payload = new {
model = "doubao/doubao-seedream-5.0-lite",
prompt = "一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"
};
var response = await client.PostAsJsonAsync("https://wcode.net/api/gpt/v1/images/generations", payload);
Console.WriteLine(await response.Content.ReadAsStringAsync());
var client = new RestClient("https://wcode.net/api/gpt/v1/images/generations");
var request = new RestRequest("", Method.Post);
request.AddHeader("Authorization", "Bearer API_KEY"); // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
request.AddHeader("Content-Type", "application/json");
request.AddJsonBody(new {
model = "doubao/doubao-seedream-5.0-lite",
prompt = "一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"
});
var response = client.Execute(request);
Console.WriteLine(response.Content);
const axios = require('axios');
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://wcode.net/api/gpt/v1/images/generations',
headers: {
'Authorization': 'Bearer API_KEY', // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
'Content-Type': 'application/json'
},
data: {
model: 'doubao/doubao-seedream-5.0-lite',
prompt: '一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云'
}
};
axios.request(config).then((response) => {
console.log(JSON.stringify(response.data));
}).catch((error) => {
console.log(error);
});
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"model\":\"doubao/doubao-seedream-5.0-lite\",\"prompt\":\"一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云\"}");
Request request = new Request.Builder()
.url("https://wcode.net/api/gpt/v1/images/generations")
.post(body)
.addHeader("Authorization", "Bearer API_KEY") // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();
$client = new \GuzzleHttp\Client();
$response = $client->post('https://wcode.net/api/gpt/v1/images/generations', [
'headers' => [
'Authorization' => 'Bearer API_KEY', // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
],
'json' => [
'model' => 'doubao/doubao-seedream-5.0-lite',
'prompt' => '一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云',
],
]);
echo $response->getBody();
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://wcode.net/api/gpt/v1/images/generations",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 5,
CURLOPT_TIMEOUT => 300,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'model' => 'doubao/doubao-seedream-5.0-lite',
'prompt' => '一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云',
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer API_KEY", // TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
"Content-Type: application/json",
],
]);
$response = curl_exec($curl);
$error = curl_error($curl);
curl_close($curl);
if ($error) {
echo "cURL Error #:" . $error;
} else {
echo $response;
}
import requests
import json
url = "https://wcode.net/api/gpt/v1/images/generations"
headers = {
"Authorization": "Bearer API_KEY", # TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
"Content-Type": "application/json",
}
payload = {
"model": "doubao/doubao-seedream-5.0-lite",
"prompt": "一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云"
}
response = requests.post(url, headers=headers, json=payload)
print(json.dumps(response.json(), indent=4, ensure_ascii=False))
from openai import OpenAI
client = OpenAI(
base_url="https://wcode.net/api/gpt/v1",
api_key="API_KEY" # TODO: 这里的 API_KEY 需要替换,获取 API Key 入口:https://platform.wcode.net
)
response = client.images.generate(
model="doubao/doubao-seedream-5.0-lite",
prompt="一只可爱的小猫咪,坐在阳光明媚的窗台上,背景是蓝天白云",
)
print(response.data[0].url)
请求参数:
- model(模型 ID)
- prompt(提示词)
- output_format(输出文件格式)
- tools(工具)
- stream(流式输出)
- image(输入图片)
- sequential_image_generation(组图生成)
- size(图片尺寸)
- sequential_image_generation_options(组图选项)
- watermark(水印)
- optimize_prompt_options(提示词优化)
- response_format(图像的返回格式)
重要提示:由于模型架构不同,部分参数可能仅适用于特定的模型。
model(模型 ID)
-
参数:
model -
必选,string
图像生成模型 ID。调用时使用模型详情页的模型 ID。
prompt(提示词)
-
参数:
prompt -
必选,string
描述所需生成图像内容的文本提示。
output_format(输出文件格式)
-
参数:
output_format -
可选,string
-
取值范围:
png|jpeg -
默认:
jpeg
指定生成图像的文件格式。
tools(工具)
-
参数:
tools -
可选,array
配置模型要调用的工具。
示例(联网搜索)
"tools": [
{ "type": "web_search" }
]
开启后模型可自主判断是否搜索互联网内容,提升图片时效性,但会增加时延。
stream(流式输出)
-
参数:
stream -
可选,boolean
-
取值范围:
true|false -
默认:
false
是否开启流式输出模式,即时返回每张图片结果。
当前接口暂不支持流式响应;请勿设置 stream: true,否则将返回错误。
image(输入图片)
-
参数:
image -
可选,string | array
输入的图片信息,支持 URL 或 Base64 编码;可传单张(string)或多张(array)。
- URL:必须可被公网访问。
- Base64:格式
data:image/<格式>;base64,<编码>,<格式>须小写,如data:image/png;base64,...。 - 单图支持 jpeg、png、webp、bmp、tiff、gif、heic、heif。
sequential_image_generation(组图生成)
-
参数:
sequential_image_generation -
可选,string
-
取值范围:
disabled|auto -
默认:
disabled
控制是否按 prompt 自动生成多张关联图片(组图)。
disabled 仅生成单张;auto 由模型根据 prompt 决定生成张数,可配合 sequential_image_generation_options.max_images 限制上限。
size(图片尺寸)
-
参数:
size -
可选,string
-
取值范围:
2K|3K|4K|宽x高像素值 -
默认:
2048x2048
生成图像的尺寸。
支持两种方式,不可混用:
- 分辨率档位:
2K、3K、4K;可在 prompt 中用自然语言描述宽高比,由模型判断具体尺寸。 - 像素值:格式
宽x高,默认2048x2048;总像素须在 [3686400, 16777216] 内,宽高比须在 [1/16, 16] 内。
sequential_image_generation_options(组图选项)
-
参数:
sequential_image_generation_options -
可选,object
组图生成模式的附加配置。
示例
"sequential_image_generation_options": {
"max_images": 3
}
watermark(水印)
-
参数:
watermark -
可选,boolean
-
取值范围:
true|false -
默认:
true
是否在生成的图片中添加水印。
false 不添加水印;true 在图片右下角添加「AI生成」字样。
optimize_prompt_options(提示词优化)
-
参数:
optimize_prompt_options -
可选,object
提示词优化功能的配置。
示例
"optimize_prompt_options": {
"mode": "standard"
}
response_format(图像的返回格式)
-
参数:
response_format -
可选,string
-
取值范围:
url|b64_json -
默认:
url
指定生成图像的返回格式。
支持以下两种返回方式:
url:返回图片下载链接;链接在图片生成后 2 小时内有效,请及时下载图片。b64_json:以 Base64 编码字符串的 JSON 格式返回图像数据。
以上文档为标准版 API 接口文档,可直接用于项目开发和系统调用。如果标准版 API 接口无法满足您的需求,需要定制开发 API 接口,请联系我们的 IT 技术支持工程师:
(沟通需求✅ → 确认技术方案✅ → 沟通费用与工期✅ → 开发&测试✅ → 验收交付✅ → 维护升级✅)
![]()