Wan 2.1 图生视频
curl --request POST \
--url https://api.ppio.com/v3/async/wan-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"image_url": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": true,
"fast_mode": true,
"watermark": true
}
'import requests
url = "https://api.ppio.com/v3/async/wan-i2v"
payload = {
"prompt": "<string>",
"image_url": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": True,
"fast_mode": True,
"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>',
image_url: '<string>',
negative_prompt: '<string>',
width: 123,
height: 123,
loras: [{path: '<string>', scale: 123}],
seed: 123,
steps: 123,
guidance_scale: 123,
flow_shift: 123,
enable_safety_checker: true,
fast_mode: true,
watermark: true
})
};
fetch('https://api.ppio.com/v3/async/wan-i2v', 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/async/wan-i2v",
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>',
'image_url' => '<string>',
'negative_prompt' => '<string>',
'width' => 123,
'height' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'seed' => 123,
'steps' => 123,
'guidance_scale' => 123,
'flow_shift' => 123,
'enable_safety_checker' => true,
'fast_mode' => true,
'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/async/wan-i2v"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true,\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/async/wan-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true,\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/async/wan-i2v")
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 \"image_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true,\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}视频
Wan 2.1 图生视频
POST
/
v3
/
async
/
wan-i2v
Wan 2.1 图生视频
curl --request POST \
--url https://api.ppio.com/v3/async/wan-i2v \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "<string>",
"image_url": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": true,
"fast_mode": true,
"watermark": true
}
'import requests
url = "https://api.ppio.com/v3/async/wan-i2v"
payload = {
"prompt": "<string>",
"image_url": "<string>",
"negative_prompt": "<string>",
"width": 123,
"height": 123,
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"seed": 123,
"steps": 123,
"guidance_scale": 123,
"flow_shift": 123,
"enable_safety_checker": True,
"fast_mode": True,
"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>',
image_url: '<string>',
negative_prompt: '<string>',
width: 123,
height: 123,
loras: [{path: '<string>', scale: 123}],
seed: 123,
steps: 123,
guidance_scale: 123,
flow_shift: 123,
enable_safety_checker: true,
fast_mode: true,
watermark: true
})
};
fetch('https://api.ppio.com/v3/async/wan-i2v', 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/async/wan-i2v",
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>',
'image_url' => '<string>',
'negative_prompt' => '<string>',
'width' => 123,
'height' => 123,
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'seed' => 123,
'steps' => 123,
'guidance_scale' => 123,
'flow_shift' => 123,
'enable_safety_checker' => true,
'fast_mode' => true,
'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/async/wan-i2v"
payload := strings.NewReader("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true,\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/async/wan-i2v")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"prompt\": \"<string>\",\n \"image_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true,\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/async/wan-i2v")
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 \"image_url\": \"<string>\",\n \"negative_prompt\": \"<string>\",\n \"width\": 123,\n \"height\": 123,\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"seed\": 123,\n \"steps\": 123,\n \"guidance_scale\": 123,\n \"flow_shift\": 123,\n \"enable_safety_checker\": true,\n \"fast_mode\": true,\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Wan 2.1 14B 图生视频模型的加速推理,这是一套全面且开放的视频基础模型套件,推动了视频生成的边界。默认情况下,API 将生成 5 秒的视频。
本模型服务仅针对已完成 PPIO派欧云 平台企业认证的用户开放。具体请参见实名认证。
这是一个异步API,只会返回异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 来检索视频生成结果。
请求头
枚举值:
application/jsonBearer 身份验证格式,例如:Bearer {{API 密钥}}。
请求体
指导生成所需的提示文本。取值范围:
[1, 2000]。用于视频生成的图像 URL。
负面提示指示模型避免生成哪些元素。取值范围:
[0, 2000]。输出视频的宽度。枚举值:
480、720、832、1280。默认:832。如果未指定宽度或高度,宽度和高度将被强制设置为 832 和 480。输出视频的高度。支持:
- (480p) 宽度为
480时高度设置为832 - (480p) 宽度为
832时高度设置为480 - (720p) 宽度为
720时高度设置为1280 - (720p) 宽度为
1280时高度设置为720
480。如果未指定宽度或高度,宽度和高度将被强制设置为 832 和 480。输出视频将保持输入图像的宽高比,
宽度 x 高度 设置仅决定输出视频的清晰度。例如,720p 视频将比 480p 视频更清晰。应用于视频生成的 LoRA 模型。支持最多指定 3 个 LoRA 模型。
显示 properties
显示 properties
LoRA 模型的路径。您可以指定来自 Hugging Face 的 LoRA 模型名称,例如:
Remade-AI/Painting;或来自 Civitai 的模型下载 URL,例如:https://civitai.com/api/download/models/1513385?type=Model&format=SafeTensor。LoRA 模型必须与 Wan2.1 14B I2V 兼容,否则将无法工作。使用前请检查兼容性。
LoRA 的缩放值。值越大,LoRA 效果更明显。number(float32) 类型,取值范围:
[0, 4.0]。随机数种子,稳定扩散产生噪声的数字,取值范围:
[-1, 9999999999]。默认值为 -1。迭代步数,图片创建过程的迭代数,取值范围:
[1, 40]。默认:30。引导缩放参数控制生成内容对提示的跟随程度。取值范围:
[0, 10]。默认:5.0。flow_shift 参数主要影响视频中物体运动的速度和幅度。更高的值产生更明显和更快的运动,而较低的值使运动更慢更细微。取值范围:
[1, 10]。默认:5.0。enable_safety_checker 参数控制是否对生成的内容应用安全过滤器。启用时,它有助于从视频输出中过滤掉潜在的有害或不当内容。默认:
true。是否启用快速模式,将更快地生成视频但可能降低质量和价格。默认:
false。为生成的视频添加水印。
false:不添加水印。true:在视频添加文字的水印,标识由人工智能生成合成。
响应
异步任务的 task_id。您应该使用该 task_id 请求 查询任务结果 API 以获取生成结果
示例
以下是如何使用 Wan 2.1 图生视频 API 的示例。- 通过向 Wan 2.1 图生视频 API 发送 POST 请求生成 task_id。
请求:
curl --location 'https://api.ppio.com/v3/async/wan-i2v' \
--header 'Authorization: Bearer {{API Key}}' \
--header 'Content-Type: application/json' \
--data '{
"image_url": "https://pub-f964a1c641c04024bce400ad128c8cd6.r2.dev/wan-i2v-input-image.jpg",
"height": 1280,
"width": 720,
"steps": 25,
"seed": -1,
"prompt": "A cute panda is walking in the grassland slowly."
}'
响应:
{
"task_id": "{返回的任务 ID}"
}
- 使用
task_id获取输出视频。
videos 中获取视频 URL。
请求:
curl --location --request GET 'https://api.ppio.com/v3/async/task-result?task_id={返回的任务 ID}' \
--header 'Authorization: Bearer {{API Key}}'
响应:
{
"task": {
"task_id": "{返回的任务 ID}",
"task_type": "WAN_IMG_TO_VIDEO",
"status": "TASK_STATUS_SUCCEED",
"reason": "",
"eta": 0,
"progress_percent": 100
},
"images": [],
"videos": [
{
"video_url": "{生成视频的 URL}",
"video_url_ttl": "3600",
"video_type": "mp4"
}
]
}
视频文件:
最后修改于 2026年1月14日
⌘I