使用 RunComfy 的 API 執行 wan-ai/wan-2-6/video-to-video。 可接受的輸入與輸出請參閱模型的 資料結構說明。
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/wan-ai/wan-2-6/video-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "Overall Description: This video depicts a nostalgic, cinematic journey through a sun-drenched vintage street during the golden hour. The atmosphere is warm, peaceful, and reminiscent of an old film, focusing on the interplay of light, shadow, and historical architecture. \n Shot 1 [0-4 seconds]: A slow, sweeping tracking shot moves through the vintage street, capturing the golden-hour glow. character1 is walking leisurely along the sidewalk, bathed in warm sunlight. The lens flares dance as the light filters through the gaps between historic buildings, casting long, dramatic shadows around character1. \nShot 2 [4-7 seconds]: The camera continues to track as a classic car glides smoothly across the frame near character1. The car's polished surface reflects the warm hues of the setting sun, creating a contrast with the textured old buildings. \nShot 3 [7-10 seconds]: The focus shifts to the atmospheric details. Dust particles shimmer in the light around character1. The scene evokes a deep sense of nostalgia as character1 moves in the background, completing the cinematic vintage atmosphere.",
"reference_video_url_1": "https://playgrounds-storage-public.runcomfy.net/tools/7278/media-files/reference_video_1.mp4"
}'將 YOUR_API_TOKEN 環境變數設為您的 API 金鑰(在 個人資料中管理金鑰),並在每個請求的 Authorization 標頭中以 Bearer 權杖形式攜帶: Authorization: Bearer $YOUR_API_TOKEN。
提交非同步生成工作後,將立即取得 request_id 以及用於查詢狀態、取得結果與取消的 URL。
curl --request POST \
--url https://model-api.runcomfy.net/v1/models/wan-ai/wan-2-6/video-to-video \
--header "Content-Type: application/json" \
--header "Authorization: Bearer <token>" \
--data '{
"prompt": "Overall Description: This video depicts a nostalgic, cinematic journey through a sun-drenched vintage street during the golden hour. The atmosphere is warm, peaceful, and reminiscent of an old film, focusing on the interplay of light, shadow, and historical architecture. \n Shot 1 [0-4 seconds]: A slow, sweeping tracking shot moves through the vintage street, capturing the golden-hour glow. character1 is walking leisurely along the sidewalk, bathed in warm sunlight. The lens flares dance as the light filters through the gaps between historic buildings, casting long, dramatic shadows around character1. \nShot 2 [4-7 seconds]: The camera continues to track as a classic car glides smoothly across the frame near character1. The car's polished surface reflects the warm hues of the setting sun, creating a contrast with the textured old buildings. \nShot 3 [7-10 seconds]: The focus shifts to the atmospheric details. Dust particles shimmer in the light around character1. The scene evokes a deep sense of nostalgia as character1 moves in the background, completing the cinematic vintage atmosphere.",
"reference_video_url_1": "https://playgrounds-storage-public.runcomfy.net/tools/7278/media-files/reference_video_1.mp4"
}'依 request_id 取得目前狀態(「in_queue」、「in_progress」、「completed」或「cancelled」)。
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/status \
--header "Authorization: Bearer <token>"取得指定 request_id 的最終輸出與中繼資料;若工作尚未完成,回應會回傳目前狀態,方便繼續輪詢。
curl --request GET \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/result \
--header "Authorization: Bearer <token>"透過 request_id 取消排隊中的工作;進行中的工作無法取消。
curl --request POST \
--url https://model-api.runcomfy.net/v1/requests/{request_id}/cancel \
--header "Authorization: Bearer <token>"請提供可公開存取的 HTTPS 位址。確保目標主機允許伺服器端抓取(無需登入或 Cookie)、未被限流或阻擋機器人。建議:圖片 ≤ 50 MB(約 4K),影片 ≤ 100 MB(約 720p 下 2–5 分鐘)。私人資產請使用穩定或預先簽署 URL。
{
"type": "object",
"title": "輸入結構",
"required": [
"prompt",
"img_url",
"reference_video_url_1"
],
"properties": {
"prompt": {
"title": "提示詞",
"description": "少於 1,500 個字元。依參考影片的輸入順序,用 `character1`、`character2`、`character3` 指代對應影片;即使只有 1 段,也要寫 `character1`。",
"type": "string",
"default": "Overall Description: This video depicts a nostalgic, cinematic journey through a sun-drenched vintage street during the golden hour. The atmosphere is warm, peaceful, and reminiscent of an old film, focusing on the interplay of light, shadow, and historical architecture. \n Shot 1 [0-4 seconds]: A slow, sweeping tracking shot moves through the vintage street, capturing the golden-hour glow. character1 is walking leisurely along the sidewalk, bathed in warm sunlight. The lens flares dance as the light filters through the gaps between historic buildings, casting long, dramatic shadows around character1. \nShot 2 [4-7 seconds]: The camera continues to track as a classic car glides smoothly across the frame near character1. The car's polished surface reflects the warm hues of the setting sun, creating a contrast with the textured old buildings. \nShot 3 [7-10 seconds]: The focus shifts to the atmospheric details. Dust particles shimmer in the light around character1. The scene evokes a deep sense of nostalgia as character1 moves in the background, completing the cinematic vintage atmosphere."
},
"reference_video_url_1": {
"title": "參考影片 1",
"description": "支援 MP4、MOV;時長 2~30 秒;小於 100 MB。僅使用此輸入時,可用參考片段最長為 5 秒。",
"type": "string",
"default": "https://playgrounds-storage-public.runcomfy.net/tools/7278/media-files/reference_video_1.mp4"
},
"reference_video_url_2": {
"title": "參考影片 2",
"description": "支援 MP4、MOV;時長 2~30 秒;小於 100 MB。與參考影片 1 一起使用時,每段可用參考片段最長為 2.5 秒。",
"type": "string"
},
"reference_video_url_3": {
"title": "參考影片 3",
"description": "支援 MP4、MOV;時長 2~30 秒;小於 100 MB。三段參考影片一起使用時,每段可用參考片段最長為 1.66 秒。",
"type": "string"
},
"duration": {
"title": "時長",
"description": "",
"type": "integer",
"enum": [
5,
10
],
"default": 5
},
"size": {
"title": "解析度",
"description": "",
"type": "string",
"enum": [
"1280*720",
"720*1280",
"960*960",
"1088*832",
"832*1088",
"1920*1080",
"1080*1920",
"1440*1440",
"1632*1248",
"1248*1632"
],
"default": "1280*720"
},
"shot_type": {
"title": "鏡頭類型",
"description": "鏡頭類型。",
"type": "string",
"enum": [
"multi",
"single"
],
"default": "multi"
},
"negative_prompt": {
"title": "反向提示詞",
"description": "",
"type": "string"
},
"seed": {
"title": "隨機種子",
"description": "",
"type": "integer",
"maximum": 2147483647,
"minimum": 0
},
"audio": {
"title": "生成音訊",
"description": "",
"type": "boolean",
"default": true
}
}
}{
"output": {
"type": "object",
"properties": {
"image": {
"type": "string",
"format": "uri",
"description": "單張圖片 URL"
},
"video": {
"type": "string",
"format": "uri",
"description": "單一影片 URL"
},
"images": {
"type": "array",
"description": "多張圖片 URL",
"items": {
"type": "string",
"format": "uri"
}
},
"videos": {
"type": "array",
"description": "多個影片 URL",
"items": {
"type": "string",
"format": "uri"
}
}
}
}
}RunComfy 是首選的 ComfyUI 平台,提供 ComfyUI 在線 環境和服務,以及 ComfyUI 工作流程 具有驚豔的視覺效果。 RunComfy還提供 AI Models, 幫助藝術家利用最新的AI工具創作出令人驚艷的藝術作品。