提交 Flux Schnell 文生图任务
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "blackforestlabs/flux/schnell",
"input": {
"prompt": "An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "blackforestlabs/flux/schnell",
"input": {
"prompt": "An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
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: 'blackforestlabs/flux/schnell',
input: {
prompt: 'An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.',
size: '4:3',
n: 1,
output_format: 'png'
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', 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.vidgo.ai/api/generate/submit",
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' => 'blackforestlabs/flux/schnell',
'input' => [
'prompt' => 'An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.',
'size' => '4:3',
'n' => 1,
'output_format' => 'png'
]
]),
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://api.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"blackforestlabs/flux/schnell\",\n \"input\": {\n \"prompt\": \"An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\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://api.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"blackforestlabs/flux/schnell\",\n \"input\": {\n \"prompt\": \"An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
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\": \"blackforestlabs/flux/schnell\",\n \"input\": {\n \"prompt\": \"An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "RGOGR6Z9UO0KX623",
"status": "running",
"created_time": "2026-09-25T11:31:42"
}
}Flux
Flux Schnell 文生图
Flux Schnell 文生图 API 根据提示词快速生成 PNG 或 JPEG 图像,支持预设宽高比、1:1 HD 或自定义 WIDTHxHEIGHT 尺寸,并可一次生成多张。
POST
/
api
/
generate
/
submit
提交 Flux Schnell 文生图任务
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "blackforestlabs/flux/schnell",
"input": {
"prompt": "An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
'import requests
url = "https://api.vidgo.ai/api/generate/submit"
payload = {
"model": "blackforestlabs/flux/schnell",
"input": {
"prompt": "An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
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: 'blackforestlabs/flux/schnell',
input: {
prompt: 'An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.',
size: '4:3',
n: 1,
output_format: 'png'
}
})
};
fetch('https://api.vidgo.ai/api/generate/submit', 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.vidgo.ai/api/generate/submit",
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' => 'blackforestlabs/flux/schnell',
'input' => [
'prompt' => 'An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.',
'size' => '4:3',
'n' => 1,
'output_format' => 'png'
]
]),
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://api.vidgo.ai/api/generate/submit"
payload := strings.NewReader("{\n \"model\": \"blackforestlabs/flux/schnell\",\n \"input\": {\n \"prompt\": \"An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\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://api.vidgo.ai/api/generate/submit")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"model\": \"blackforestlabs/flux/schnell\",\n \"input\": {\n \"prompt\": \"An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.vidgo.ai/api/generate/submit")
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\": \"blackforestlabs/flux/schnell\",\n \"input\": {\n \"prompt\": \"An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.\",\n \"size\": \"4:3\",\n \"n\": 1,\n \"output_format\": \"png\"\n }\n}"
response = http.request(request)
puts response.read_body{
"code": 200,
"data": {
"task_id": "RGOGR6Z9UO0KX623",
"status": "running",
"created_time": "2026-09-25T11:31:42"
}
}- 提交后会返回
task_id。如果提供了callback_url,当任务状态变为finished或failed时,系统会向callback_url发送 POST 请求。 - 无论是否提供
callback_url,都可以通过统一的查询任务状态接口获取结果。
提交任务
向POST /api/generate/submit 发送 model: "blackforestlabs/flux/schnell" 和一个 input 对象。使用 Authorization: Bearer VIDGO_API_KEY 认证。
prompt:必填字符串。描述图像,去除首尾空白后至少一个字符。size:输出画布,默认1:1。可选1:1、1:1 HD、4:3、3:4、16:9、9:16,或自定义WIDTHxHEIGHT(如1024x1536)。自定义宽和高为正整数。n:正整数,指定输出图像数量,默认1。output_format:png或jpeg,默认png。
获取图像
提交响应会返回data.task_id。使用查询任务状态跟踪任务经过 not_started、running、finished 或 failed 等状态。
状态为 finished 时,从 data.files[].file_url 读取图像 URL。状态为 failed 时,读取 data.error_message。
可以在顶层提供 callback_url,通过 Webhook 接收最终结果。
已验证示例
崖边泳池的第一缕晨光。此文生图示例只使用提示词。{
"model": "blackforestlabs/flux/schnell",
"input": {
"prompt": "An architectural photograph of an empty public seawater swimming pool built into a coastal cliff at sunrise. From a low viewpoint beside the pool, pale turquoise water fills the foreground, broad curved stone steps descend naturally into the shallow end on the right, and a simple white limewashed wall catches moving water reflections. Warm low morning sunlight reveals the rough limestone coping and delicate ripples. Beyond the far pool edge, the calm open sea and a clean level horizon remain clearly visible. Restrained Mediterranean colors, believable pool geometry, natural light, crisp tactile surfaces, peaceful everyday public architecture. One coherent full-frame photograph, no people, hotel styling, advertising, signs, lettering, logos or watermark.",
"size": "4:3",
"n": 1,
"output_format": "png"
}
}
