curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_frame_url": "<string>",
"last_frame_url": "<string>",
"model": "wan2.2-kf2v-flash",
"negative_prompt": "<string>",
"prompt": "<string>",
"prompt_extend": true,
"seed": 1073741823,
"template": "<string>",
"watermark": true
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video"
payload = {
"first_frame_url": "<string>",
"last_frame_url": "<string>",
"model": "wan2.2-kf2v-flash",
"negative_prompt": "<string>",
"prompt": "<string>",
"prompt_extend": True,
"seed": 1073741823,
"template": "<string>",
"watermark": True
}
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({
first_frame_url: '<string>',
last_frame_url: '<string>',
model: 'wan2.2-kf2v-flash',
negative_prompt: '<string>',
prompt: '<string>',
prompt_extend: true,
seed: 1073741823,
template: '<string>',
watermark: true
})
};
fetch('https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video', 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.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video",
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([
'first_frame_url' => '<string>',
'last_frame_url' => '<string>',
'model' => 'wan2.2-kf2v-flash',
'negative_prompt' => '<string>',
'prompt' => '<string>',
'prompt_extend' => true,
'seed' => 1073741823,
'template' => '<string>',
'watermark' => true
]),
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.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video"
payload := strings.NewReader("{\n \"first_frame_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"model\": \"wan2.2-kf2v-flash\",\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"template\": \"<string>\",\n \"watermark\": true\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.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_frame_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"model\": \"wan2.2-kf2v-flash\",\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"template\": \"<string>\",\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video")
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 \"first_frame_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"model\": \"wan2.2-kf2v-flash\",\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"template\": \"<string>\",\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}Wan2 キーフレームから動画
通義萬相 Wan2.2 先頭・末尾フレームから動画生成モデル(wan2.2-kf2v-flash)を使用します。先頭フレームと末尾フレームの画像を提供し、プロンプトと組み合わせることで滑らかで流動的な動画を生成します。エフェクトテンプレートをサポート
curl --request POST \
--url https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"first_frame_url": "<string>",
"last_frame_url": "<string>",
"model": "wan2.2-kf2v-flash",
"negative_prompt": "<string>",
"prompt": "<string>",
"prompt_extend": true,
"seed": 1073741823,
"template": "<string>",
"watermark": true
}
'import requests
url = "https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video"
payload = {
"first_frame_url": "<string>",
"last_frame_url": "<string>",
"model": "wan2.2-kf2v-flash",
"negative_prompt": "<string>",
"prompt": "<string>",
"prompt_extend": True,
"seed": 1073741823,
"template": "<string>",
"watermark": True
}
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({
first_frame_url: '<string>',
last_frame_url: '<string>',
model: 'wan2.2-kf2v-flash',
negative_prompt: '<string>',
prompt: '<string>',
prompt_extend: true,
seed: 1073741823,
template: '<string>',
watermark: true
})
};
fetch('https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video', 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.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video",
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([
'first_frame_url' => '<string>',
'last_frame_url' => '<string>',
'model' => 'wan2.2-kf2v-flash',
'negative_prompt' => '<string>',
'prompt' => '<string>',
'prompt_extend' => true,
'seed' => 1073741823,
'template' => '<string>',
'watermark' => true
]),
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.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video"
payload := strings.NewReader("{\n \"first_frame_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"model\": \"wan2.2-kf2v-flash\",\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"template\": \"<string>\",\n \"watermark\": true\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.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"first_frame_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"model\": \"wan2.2-kf2v-flash\",\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"template\": \"<string>\",\n \"watermark\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sinancode.com/v1/generate/bailian/wan2-keyframe-to-video")
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 \"first_frame_url\": \"<string>\",\n \"last_frame_url\": \"<string>\",\n \"model\": \"wan2.2-kf2v-flash\",\n \"negative_prompt\": \"<string>\",\n \"prompt\": \"<string>\",\n \"prompt_extend\": true,\n \"seed\": 1073741823,\n \"template\": \"<string>\",\n \"watermark\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "01234567-89ab-cdef-0123-456789abcdef"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}{
"error_code": "<string>",
"message": "<string>"
}- キーフレーム制御 - 動画の開始と終了フレームを正確に制御
- スムーズな遷移 - 滑らかな中間フレームアニメーションを自動生成
- マルチ解像度 - 480P、720P、1080P出力をサポート
- スマートリライト - より良い結果のためのプロンプト自動改善をサポート
- エフェクトテンプレート - プリセット動画エフェクトテンプレートをサポート
承認
API Tokenを使用して認証を行ってください
ボディ
タスクパラメータ
先頭フレーム画像 URL(必須) 公衆インターネット URL(HTTP/HTTPS)または Base64 エンコードをサポート 画像形式:JPEG、JPG、PNG(透明チャンネルなし)、BMP、WEBP 画像解像度:幅と高さの範囲は [360, 2000] ピクセル ファイルサイズ:10MB以下 出力ビデオのアスペクト比はこの画像を基準とします
末尾フレーム画像のURL(オプション) 要件は先頭フレーム画像と同じ、解像度は先頭フレームと異なっても可 エフェクトテンプレート(template)を使用する場合は入力不要
モデル名(オプション、空欄推奨) 空欄の場合は最新バージョンのモデルを使用し、以降のモデルアップグレードは自動適用 現在のデフォルト:wan2.2-kf2v-flash
wan2.2-kf2v-flash ネガティブプロンプト(オプション、最大500文字) 動画内に表示したくない内容を記述
500テキストプロンプト(オプション、最大800文字) 生成動画に含めたい要素や視覚的特徴を記述 先頭/末尾フレームの主題/シーンが大きく変化する場合、変化の過程(カメラワーク、主題の動きなど)の記述を推奨
800プロンプトのインテリジェントリライトを有効化するか(オプション、デフォルトtrue) 有効時は大規模言語モデルを使用して入力プロンプトをインテリジェントにリライト
解像度設定(オプション、デフォルト720P) wan2.2-kf2v-flash:選択可能値 480P、720P、1080P
480P, 720P, 1080P ランダムシード(オプション、範囲 0-2147483647)
0 <= x <= 2147483647動画エフェクトテンプレート名(オプション) このパラメータ使用時は、first_frame_urlのみ入力 異なるモデルは異なるエフェクトテンプレートをサポート
透かしを追加するか(オプション、デフォルトfalse) 透かしは動画右下に表示、固定文言は「AI生成」
レスポンス
OK
タスクID
"01234567-89ab-cdef-0123-456789abcdef"