Seedream 图片生成 4.0
curl --request POST \
--url https://api.ppio.com/v3/seedream-4.0 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"images": [
"<string>"
],
"size": "<string>",
"sequential_image_generation": "<string>",
"max_images": 123,
"watermark": true
}
'import requests
url = "https://api.ppio.com/v3/seedream-4.0"
payload = {
"prompt": "<string>",
"images": ["<string>"],
"size": "<string>",
"sequential_image_generation": "<string>",
"max_images": 123,
"watermark": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
prompt: '<string>',
images: ['<string>'],
size: '<string>',
sequential_image_generation: '<string>',
max_images: 123,
watermark: true
})
};
fetch('https://api.ppio.com/v3/seedream-4.0', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/seedream-4.0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'images' => [
'<string>'
],
'size' => '<string>',
'sequential_image_generation' => '<string>',
'max_images' => 123,
'watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/seedream-4.0"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"sequential_image_generation\": \"<string>\",\n \"max_images\": 123,\n \"watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/seedream-4.0")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"sequential_image_generation\": \"<string>\",\n \"max_images\": 123,\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/seedream-4.0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"sequential_image_generation\": \"<string>\",\n \"max_images\": 123,\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"images": [
"<string>"
]
}图像
Seedream 图片生成 4.0
POST
/
v3
/
seedream-4.0
Seedream 图片生成 4.0
curl --request POST \
--url https://api.ppio.com/v3/seedream-4.0 \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"images": [
"<string>"
],
"size": "<string>",
"sequential_image_generation": "<string>",
"max_images": 123,
"watermark": true
}
'import requests
url = "https://api.ppio.com/v3/seedream-4.0"
payload = {
"prompt": "<string>",
"images": ["<string>"],
"size": "<string>",
"sequential_image_generation": "<string>",
"max_images": 123,
"watermark": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
prompt: '<string>',
images: ['<string>'],
size: '<string>',
sequential_image_generation: '<string>',
max_images: 123,
watermark: true
})
};
fetch('https://api.ppio.com/v3/seedream-4.0', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/seedream-4.0",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => '<string>',
'images' => [
'<string>'
],
'size' => '<string>',
'sequential_image_generation' => '<string>',
'max_images' => 123,
'watermark' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/seedream-4.0"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"sequential_image_generation\": \"<string>\",\n \"max_images\": 123,\n \"watermark\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/seedream-4.0")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"sequential_image_generation\": \"<string>\",\n \"max_images\": 123,\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/seedream-4.0")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"prompt\": \"<string>\",\n \"images\": [\n \"<string>\"\n ],\n \"size\": \"<string>\",\n \"sequential_image_generation\": \"<string>\",\n \"max_images\": 123,\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"images": [
"<string>"
]
}Seedream 4.0 是一款先进的图像生成模型,提供灵活的图像创建功能,包括支持4K分辨率,可以从文本和其他图像生成图像。
本接口支持个人认证及企业认证用户调用。请参见 实名认证,完成个人用户认证或企业用户认证,以确保可以正常使用本功能。
请求头
枚举值:
application/jsonBearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
用于生成图像的提示词,支持中英文。建议不超过300个汉字或600个英文单词。字数过多信息容易分散,模型可能因此忽略细节,只关注重点,造成视图片缺失部分元素。
输入要编辑的图像的Base64编码或可访问的URL。支持输入单张或多张图像。
- 图像URL:确保图像URL可访问。
-
Base64编码:格式必须为
data:image/<图像格式>;base64,<Base64编码>。
输入图像必须满足以下要求:- 图像格式:jpeg, png
- 宽高比(宽度/高度):范围为[1/3, 3]
- 宽度和高度(像素):> 14
- 大小:不超过10 MB
- 总像素值:不超过
6000×6000PX - 支持上传最多10张参考图像。
设置生成图像的规格。有两种方法可用,但不能同时使用。
- 方法1,指定分辨率。
- 可选值:
1K,2K,4K
- 可选值:
- 方法2,指定生成图像的宽度和高度(像素)。
- 默认值:
2048x2048 - 总像素值范围:
[1024x1024, 4096x4096] - 宽高比值范围:
[1/16, 16]
- 默认值:
| 宽高比 | 宽度和高度像素值 |
|---|---|
| 1:1 | 2048x2048 |
| 4:3 | 2304x1728 |
| 3:4 | 1728x2304 |
| 16:9 | 2560x1440 |
| 9:16 | 1440x2560 |
| 3:2 | 2496x1664 |
| 2:3 | 1664x2496 |
| 21:9 | 3024x1296 |
控制是否禁用批量生成功能。
auto:在自动模式下,模型会根据用户的提示词自动决定是否返回多张图像以及包含多少张图像。disabled:禁用批量生成功能。模型将只生成一张图像。
指定此请求中要生成的最大图像数量。此参数仅在
sequential_image_generation设置为auto时有效。取值范围:[1, 15]说明实际生成的图像数量受
max_images和输入参考图像数量的影响。输入参考图像数量 + 生成图像数量 ≤ 15。为生成的图像添加水印。
false:不添加水印。true:在图像添加文字的水印,标识由人工智能生成合成。
响应
包含生成图像下载链接的数组。
最后修改于 2026年1月14日
⌘I