Seedance 2.5:影片延伸
透過生成新片段,將既有影片向前或向後延伸,同時保留原本的人物、場景與畫面比例。來源影片長度需為 1.9–30 秒,你可指定新片段的時長(4–30 秒,預設 5 秒),輸出為 MP4 或 MOV。適合延續未完成的鏡頭、製作更長的敘事段落,以及建立更長的剪輯串接流程。
關於
Seedance 2.5: Video Extend 是一個 ComfyUI 工作流程,用於將既有影片向前延伸(在最後一幀之後新增畫面)或向後延伸(在第一幀之前新增前導畫面)。其目標是在生成 4–30 秒(預設 5 秒)新片段的同時,維持原始人物、環境與畫面比例。流程會用 LoadVideo 載入來源片段,用 Video Slice 擷取一段短的上下文範圍,透過 ByteDance2ReferenceNodeV2 對參考感知模型進行條件設定,接著用工作流程的 Seedance 2.5 生成節點(d9aa59a4-3784-4796-9f1b-5b467fb41fa1)合成新影格。最後由 SaveVideo 編碼輸出為 MP4 或 MOV。
技術上,Video Slice 會在來源片段的開頭或結尾(取決於你是向後延伸或向前延伸)挑選最具資訊量的影格。這些影格會送入 ByteDance2ReferenceNodeV2,用來固定外觀、構圖與動作線索,讓生成器能沿時間方向外推,同時維持人物辨識度與場景一致性。接著生成節點(d9aa59a4-3784-4796-9f1b-5b467fb41fa1)會以原始畫面比例產生新片段,SaveVideo 再將輸出片段組裝完成。節點圖內的 MarkdownNote 也記錄了限制與預設值:輸入影片需為 1.9–30 秒;延伸時長可為 4–30 秒(預設 5 秒)。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
Loading the graph
Open full-size workflow preview- 作者
- ComfyUI
需要自訂節點
- 正在讀取工作流程
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
- 您的檔案
- 由程式碼透過其 URL 上傳
需要付費 Cloud 方案與點數。
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"16": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/Seedance2.5_video_extend",
"format": "auto",
"format.codec": "auto",
"video": [
"38",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"35": {
"class_type": "LoadVideo",
"inputs": {
"file": "UPLOADED_video_FILENAME"
},
"_meta": {
"title": "Load Video"
}
},
"36": {
"class_type": "Video Slice",
"inputs": {
"duration": 5,
"start_time": 0,
"strict_duration": False,
"video": [
"35",
0
]
},
"_meta": {
"title": "Trim Video"
}
},
"38": {
"class_type": "ByteDance2ReferenceNodeV2",
"inputs": {
"model": "Seedance 2.5",
"model.auto_downscale": True,
"model.auto_upscale": False,
"model.duration": 5,
"model.generate_audio": True,
"model.output_format": "mp4",
"model.prompt": "Continuing from the previous shot, live-action western rodeo, dusty arena, golden hour. The raging bull calms down and stops, the buzzer rings. The sloth in the cowboy hat hops off the bull's back, lands steadily in the dust, slowly dusts off his hat, then strolls away unhurriedly with a deadpan expression. Slow motion, dust floating in warm sunlight, cheering crowd roars and waves hats in the background. Steadicam follow shot. Western arena music swells. No black frames, no text overlays.",
"model.ratio": "adaptive",
"model.reference_videos.video_1": [
"36",
0
],
"model.resolution": "720p",
"model.task_type": "extend",
"seed": 1672978219,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 Reference to Video"
}
},
"40": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/Seedance2.5_video_extend_merged",
"format": "auto",
"format.codec": "auto",
"video": [
"39:8",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"39:1": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"35",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"39:10": {
"class_type": "EmptyAudio",
"inputs": {
"channels": 2,
"duration": 60,
"sample_rate": 44100
},
"_meta": {
"title": "Empty Audio"
}
},
"39:11": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": False
},
"_meta": {
"title": "Boolean"
}
},
"39:13": {
"class_type": "BatchImagesNode",
"inputs": {
"images.image0": [
"39:1",
0
],
"images.image1": [
"39:27",
0
]
},
"_meta": {
"title": "Batch Images"
}
},
"39:2": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"38",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"39:27": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"39:2",
0
],
"on_true": [
"39:6",
0
],
"switch": [
"39:28",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"39:28": {
"class_type": "PrimitiveBoolean",
"inputs": {
"value": False
},
"_meta": {
"title": "Boolean"
}
},
"39:3": {
"class_type": "ComfySwitchNode",
"inputs": {
"on_false": [
"39:42",
0
],
"on_true": [
"39:10",
0
],
"switch": [
"39:11",
0
]
},
"_meta": {
"title": "If/Else Switch"
}
},
"39:42": {
"class_type": "AudioConcat",
"inputs": {
"audio1": [
"39:2",
1
],
"audio2": [
"39:1",
1
],
"direction": "after"
},
"_meta": {
"title": "Concatenate Audio"
}
},
"39:6": {
"class_type": "ResizeAndPadImage",
"inputs": {
"image": [
"39:2",
0
],
"interpolation": "lanczos",
"padding_color": "white",
"target_height": [
"39:7",
1
],
"target_width": [
"39:7",
0
]
},
"_meta": {
"title": "Resize And Pad Image"
}
},
"39:7": {
"class_type": "GetImageSize",
"inputs": {
"image": [
"39:1",
0
]
},
"_meta": {
"title": "Get Image Size"
}
},
"39:8": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"39:3",
0
],
"bit_depth": 8,
"codec": "none",
"color_space": "sRGB",
"fps": [
"39:1",
2
],
"images": [
"39:13",
0
]
},
"_meta": {
"title": "Create Video"
}
}
})
# Replace each example.com URL with a public URL of your file.
workflow.set_input("35", "file", client.assets.from_url("https://example.com/replace-with-a-url/video"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
在 Video Slice 選取來源片段開頭的上下文(前 1–2 秒),並將其接到 ByteDance2ReferenceNodeV2。接著生成節點就會合成位於你原始第一幀之前的新影格。
輸入影片必須介於 1.9 到 30 秒。可請求的延伸時長為 4 到 30 秒(預設 5 秒)。通常維持在 4–8 秒更容易得到一致的人物與動作。
在 Video Slice 提供乾淨且穩定的上下文(臉部不被遮擋、光線一致),並保留足夠的上下文時長。如有提供,在 ByteDance2ReferenceNodeV2 提高 reference strength。避免在切片點附近出現突兀的鏡頭切換。
不會。它會保留來源畫面比例。SaveVideo 輸出為無聲的 MP4 或 MOV,除非你之後在剪輯軟體中另行合併音訊。