文生图
curl --request POST \
--url https://www.anyfast.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-5-0-lite-260128",
"prompt": "生成四张连贯的电影分镜,展示宇航员维修飞船的过程。",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 4
},
"output_format": "png",
"response_format": "url",
"watermark": false
}
'import requests
url = "https://www.anyfast.ai/v1/images/generations"
payload = {
"model": "seedream-5-0-lite-260128",
"prompt": "生成四张连贯的电影分镜,展示宇航员维修飞船的过程。",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 4 },
"output_format": "png",
"response_format": "url",
"watermark": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'seedream-5-0-lite-260128',
prompt: '生成四张连贯的电影分镜,展示宇航员维修飞船的过程。',
size: '2K',
sequential_image_generation: 'auto',
sequential_image_generation_options: {max_images: 4},
output_format: 'png',
response_format: 'url',
watermark: false
})
};
fetch('https://www.anyfast.ai/v1/images/generations', 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://www.anyfast.ai/v1/images/generations",
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([
'model' => 'seedream-5-0-lite-260128',
'prompt' => '生成四张连贯的电影分镜,展示宇航员维修飞船的过程。',
'size' => '2K',
'sequential_image_generation' => 'auto',
'sequential_image_generation_options' => [
'max_images' => 4
],
'output_format' => 'png',
'response_format' => 'url',
'watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://www.anyfast.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"seedream-5-0-lite-260128\",\n \"prompt\": \"生成四张连贯的电影分镜,展示宇航员维修飞船的过程。\",\n \"size\": \"2K\",\n \"sequential_image_generation\": \"auto\",\n \"sequential_image_generation_options\": {\n \"max_images\": 4\n },\n \"output_format\": \"png\",\n \"response_format\": \"url\",\n \"watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedream-5-0-lite-260128\",\n \"prompt\": \"生成四张连贯的电影分镜,展示宇航员维修飞船的过程。\",\n \"size\": \"2K\",\n \"sequential_image_generation\": \"auto\",\n \"sequential_image_generation_options\": {\n \"max_images\": 4\n },\n \"output_format\": \"png\",\n \"response_format\": \"url\",\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"seedream-5-0-lite-260128\",\n \"prompt\": \"生成四张连贯的电影分镜,展示宇航员维修飞船的过程。\",\n \"size\": \"2K\",\n \"sequential_image_generation\": \"auto\",\n \"sequential_image_generation_options\": {\n \"max_images\": 4\n },\n \"output_format\": \"png\",\n \"response_format\": \"url\",\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"model": "seedream-5-0-260128",
"created": 1784880000,
"data": [
{
"url": "https://example.com/generated-image.png",
"b64_json": "<string>",
"size": "2048x2048"
}
],
"usage": {
"generated_images": 4,
"output_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}ByteDance
seedream-5.0-lite-文生图
使用 seedream-5-0-lite-260128 根据文本生成图片。支持单图和连贯组图生成。 对于特定内容请求,请选择 Special-Ns 资源分组。
POST
/
v1
/
images
/
generations
文生图
curl --request POST \
--url https://www.anyfast.ai/v1/images/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "seedream-5-0-lite-260128",
"prompt": "生成四张连贯的电影分镜,展示宇航员维修飞船的过程。",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": {
"max_images": 4
},
"output_format": "png",
"response_format": "url",
"watermark": false
}
'import requests
url = "https://www.anyfast.ai/v1/images/generations"
payload = {
"model": "seedream-5-0-lite-260128",
"prompt": "生成四张连贯的电影分镜,展示宇航员维修飞船的过程。",
"size": "2K",
"sequential_image_generation": "auto",
"sequential_image_generation_options": { "max_images": 4 },
"output_format": "png",
"response_format": "url",
"watermark": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
model: 'seedream-5-0-lite-260128',
prompt: '生成四张连贯的电影分镜,展示宇航员维修飞船的过程。',
size: '2K',
sequential_image_generation: 'auto',
sequential_image_generation_options: {max_images: 4},
output_format: 'png',
response_format: 'url',
watermark: false
})
};
fetch('https://www.anyfast.ai/v1/images/generations', 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://www.anyfast.ai/v1/images/generations",
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([
'model' => 'seedream-5-0-lite-260128',
'prompt' => '生成四张连贯的电影分镜,展示宇航员维修飞船的过程。',
'size' => '2K',
'sequential_image_generation' => 'auto',
'sequential_image_generation_options' => [
'max_images' => 4
],
'output_format' => 'png',
'response_format' => 'url',
'watermark' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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://www.anyfast.ai/v1/images/generations"
payload := strings.NewReader("{\n \"model\": \"seedream-5-0-lite-260128\",\n \"prompt\": \"生成四张连贯的电影分镜,展示宇航员维修飞船的过程。\",\n \"size\": \"2K\",\n \"sequential_image_generation\": \"auto\",\n \"sequential_image_generation_options\": {\n \"max_images\": 4\n },\n \"output_format\": \"png\",\n \"response_format\": \"url\",\n \"watermark\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.anyfast.ai/v1/images/generations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"seedream-5-0-lite-260128\",\n \"prompt\": \"生成四张连贯的电影分镜,展示宇航员维修飞船的过程。\",\n \"size\": \"2K\",\n \"sequential_image_generation\": \"auto\",\n \"sequential_image_generation_options\": {\n \"max_images\": 4\n },\n \"output_format\": \"png\",\n \"response_format\": \"url\",\n \"watermark\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.anyfast.ai/v1/images/generations")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"model\": \"seedream-5-0-lite-260128\",\n \"prompt\": \"生成四张连贯的电影分镜,展示宇航员维修飞船的过程。\",\n \"size\": \"2K\",\n \"sequential_image_generation\": \"auto\",\n \"sequential_image_generation_options\": {\n \"max_images\": 4\n },\n \"output_format\": \"png\",\n \"response_format\": \"url\",\n \"watermark\": false\n}"
response = http.request(request)
puts response.read_body{
"model": "seedream-5-0-260128",
"created": 1784880000,
"data": [
{
"url": "https://example.com/generated-image.png",
"b64_json": "<string>",
"size": "2048x2048"
}
],
"usage": {
"generated_images": 4,
"output_tokens": 123,
"total_tokens": 123
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"type": "<string>"
}
}对于特定内容请求,请选择 Special-Ns 资源分组。
授权
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
请求体
application/json
模型 ID。
可用选项:
seedream-5-0-lite-260128 示例:
"seedream-5-0-lite-260128"
图片生成或编辑提示词。
示例:
"生成四张连贯的电影分镜,展示宇航员维修飞船的过程。"
分辨率档位 2K、3K、4K,或受支持的明确像素尺寸。
示例:
"2K"
随机种子,用于提高重复请求结果的一致性。
auto 开启连贯组图输出;disabled 只生成一张图片。
可用选项:
auto, disabled 组图生成配置,仅在 sequential_image_generation 为 auto 时生效。
Show child attributes
Show child attributes
以临时 URL 或 Base64 数据返回图片。URL 将在 24 小时后失效。
可用选项:
url, b64_json 生成图片的文件格式。
可用选项:
png, jpeg 是否添加“AI 生成”水印。
提示词优化配置。
Show child attributes
Show child attributes
此页面对您有帮助吗?
⌘I