Seedance 2.0 多幀縫合
此工作流程會消耗大量點數! 此工作流程可使用 seedance 2.0 建立拼接的多幀影片。適合快速迭代與補幀。
關於
Seedance 2.0 Multiframe Stitch 是 ComfyUI 的工作流程,用於在兩張關鍵影格之間生成平滑的中間影格,並組合成影片。核心節點是 ByteDance2FirstLastFrameNode,它使用 Seedance 2.0 模型合成一段從第一張影格過渡到最後一張影格的序列。這很適合快速迭代、動作研究,以及不寫程式、不依賴外部工具的快速插幀。注意:執行 Seedance 2.0 可能會大量消耗點數,請依影格數與解析度規劃成本。
在技術流程上,工作流程先用 LoadImage 載入起始與結束圖片,然後把兩張圖片送入 ByteDance2FirstLastFrameNode 生成多影格插幀批次。ImageBatch 會確保影格分組正確,以便建立影片。若要對齊參考素材,可使用 GetVideoComponents 設定或匹配影片屬性(例如幀率)。最後,CreateVideo 將影格批次組成影片串流,SaveVideo 則把結果寫入磁碟。輸出是一段完全由兩張靜態圖拼接而成、連貫的轉場片段。
其實用性在於可控性與速度的搭配:你選定兩個錨點影格,節點負責插補動作,其餘節點圖則穩定地編譯並儲存輸出。為獲得最佳效果,兩張輸入圖片請保持相同解析度與長寬比;若節點提供影格數、解析度或迭代次數等設定,可透過降低它們來控制成本。
您提供的內容
- 正在讀取工作流程
在 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({
"1": {
"class_type": "ByteDance2FirstLastFrameNode",
"inputs": {
"first_frame": [
"3",
0
],
"first_frame_asset_id": "",
"last_frame": [
"4",
0
],
"last_frame_asset_id": "",
"model": "Seedance 2.0",
"model.duration": 4,
"model.generate_audio": False,
"model.prompt": "extreme shot shifts as two character run and jump and make action poses, anime style, squash and stretch animation, calarts style, cartoon network style",
"model.ratio": "16:9",
"model.resolution": "1080p",
"seed": 223429887,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 First-Last-Frame to Video"
}
},
"2": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/Seedance2.0_flf2v",
"format": "auto",
"format.codec": "auto",
"video": [
"1",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"3": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"4": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_2_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"5": {
"class_type": "ByteDance2FirstLastFrameNode",
"inputs": {
"first_frame": [
"4",
0
],
"first_frame_asset_id": "",
"last_frame": [
"7",
0
],
"last_frame_asset_id": "",
"model": "Seedance 2.0",
"model.duration": 4,
"model.generate_audio": False,
"model.prompt": "extreme shot shifts as two character run and jump and make action poses, anime style, squash and stretch animation, calarts style, cartoon network style",
"model.ratio": "16:9",
"model.resolution": "1080p",
"seed": 1662723398,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 First-Last-Frame to Video"
}
},
"6": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/Seedance2.0_flf2v",
"format": "auto",
"format.codec": "auto",
"video": [
"5",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"7": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_3_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"8": {
"class_type": "ByteDance2FirstLastFrameNode",
"inputs": {
"first_frame": [
"7",
0
],
"first_frame_asset_id": "",
"last_frame": [
"10",
0
],
"last_frame_asset_id": "",
"model": "Seedance 2.0",
"model.duration": 4,
"model.generate_audio": False,
"model.prompt": "extreme shot shifts as two character run and jump and make action poses, anime style, squash and stretch animation, calarts style, cartoon network style",
"model.ratio": "16:9",
"model.resolution": "1080p",
"seed": 1366057492,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 First-Last-Frame to Video"
}
},
"9": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/Seedance2.0_flf2v",
"format": "auto",
"format.codec": "auto",
"video": [
"8",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"10": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_4_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"11": {
"class_type": "ByteDance2FirstLastFrameNode",
"inputs": {
"first_frame": [
"10",
0
],
"first_frame_asset_id": "",
"last_frame": [
"15",
0
],
"last_frame_asset_id": "",
"model": "Seedance 2.0",
"model.duration": 4,
"model.generate_audio": False,
"model.prompt": "extreme shot shifts as two character run and jump and make action poses, anime style, squash and stretch animation, calarts style, cartoon network style",
"model.ratio": "16:9",
"model.resolution": "1080p",
"seed": 651642512,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 First-Last-Frame to Video"
}
},
"12": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/Seedance2.0_flf2v",
"format": "auto",
"format.codec": "auto",
"video": [
"11",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"13": {
"class_type": "ByteDance2FirstLastFrameNode",
"inputs": {
"first_frame": [
"15",
0
],
"first_frame_asset_id": "",
"last_frame": [
"16",
0
],
"last_frame_asset_id": "",
"model": "Seedance 2.0",
"model.duration": 4,
"model.generate_audio": False,
"model.prompt": "extreme shot shifts as two character run and jump and make action poses, anime style, squash and stretch animation, calarts style, cartoon network style",
"model.ratio": "16:9",
"model.resolution": "1080p",
"seed": 167021654,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 First-Last-Frame to Video"
}
},
"14": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/Seedance2.0_flf2v",
"format": "auto",
"format.codec": "auto",
"video": [
"13",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"15": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_5_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"16": {
"class_type": "LoadImage",
"inputs": {
"image": "UPLOADED_image_6_FILENAME"
},
"_meta": {
"title": "Load Image"
}
},
"17": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"27",
0
],
"image2": [
"26",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"18": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"17",
0
],
"image2": [
"25",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"19": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"18",
0
],
"image2": [
"24",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"20": {
"class_type": "ImageBatch",
"inputs": {
"image1": [
"19",
0
],
"image2": [
"23",
0
]
},
"_meta": {
"title": "Batch Images (DEPRECATED)"
}
},
"21": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": 24,
"images": [
"20",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"22": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/ComfyUI",
"format": "auto",
"format.codec": "auto",
"video": [
"21",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"23": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"13",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"24": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"11",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"25": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"8",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"26": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"5",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"27": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"1",
0
]
},
"_meta": {
"title": "Get Video Components"
}
}
})
# Replace each example.com URL with a public URL of your file.
workflow.set_input("3", "image", client.assets.from_url("https://example.com/replace-with-a-url/image"))
workflow.set_input("4", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_2"))
workflow.set_input("7", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_3"))
workflow.set_input("10", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_4"))
workflow.set_input("15", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_5"))
workflow.set_input("16", "image", client.assets.from_url("https://example.com/replace-with-a-url/image_6"))
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
它用 Seedance 2.0 模型,根據首尾圖生成補間幀,輸出平滑過渡的多幀序列。
Seedance 2.0 推論資源需求高。點數消耗與幀數、解析度、品質設定成正比。降低補間幀數、解析度或品質/迭代次數可減少成本。
主要看生成幀數與 CreateVideo 設定的 FPS。幀數或 FPS 越高,影片越長/越平滑。可用 GetVideoComponents 對齊參考 FPS,或在 CreateVideo 手動設定。
請用構圖、光線、主體比例一致的首尾圖。解析度與比例要相同。若節點有種子或強度/平滑度參數,可鎖定種子並調整強度,讓動作更保守。