Seedance 2.0 - Viral Videos Character Swap
A one click workflow to recreate an input video with your character. All you need to do is upload the video and your character. This workflow uses Google Gemini LLM to analyze the input video and reverse engineer a prompt. You can prompt for specific details to inject into this analysis. The workflow extracts the first frame of the video and swaps your character into it, sends this into Seedance 2.0 Reference-to-Video and generates
简介
A one click workflow to recreate an input video with your character. All you need to do is upload the video and your character. This workflow uses Google Gemini LLM to analyze the input video and reverse engineer a prompt. You can prompt for specific details to inject into this analysis. The workflow extracts the first frame of the video and swaps your character into it, sends this into Seedance 2.0 Reference-to-Video and generates
你需要提供
- 正在读取工作流
在 ComfyUI 中运行。 此工作流无法在本页面运行。你可以在 Comfy Cloud 中打开(已预先加载所需内容),或下载后在自己的 ComfyUI 中使用。
在 Cloud 中试用查看工作流内部
节点图的只读预览。在 Comfy Cloud 中打开或下载后即可编辑节点。
Loading the graph
Open full-size workflow preview- 作者
- Rob
需要自定义节点
- 正在读取工作流
通过代码使用此工作流
尽可能根据工作流图和输入自动生成代码,否则显示已保存的示例。运行代码可能产生费用,请先核对凭据和端点。
What you need
- Runs on
- Comfy Cloud
- 密钥
- COMFY_API_KEY
需要付费的 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({
"18": {
"class_type": "LoadVideo",
"inputs": {
"file": "b887506631eede32ccbf6284c02efad018c25dbce6d59e21240e7dd169d5401a.mp4"
},
"_meta": {
"title": "Load Video"
}
},
"22": {
"class_type": "PreviewAny",
"inputs": {
"source": [
"21:20",
0
]
},
"_meta": {
"title": "Preview Prompt"
}
},
"23": {
"class_type": "Video Slice",
"inputs": {
"duration": 15,
"start_time": 0,
"strict_duration": False,
"video": [
"18",
0
]
},
"_meta": {
"title": "Trim Video"
}
},
"26": {
"class_type": "OpenAIGPTImageNodeV2",
"inputs": {
"model": "gpt-image-2",
"model.background": "auto",
"model.custom_height": 1024,
"model.custom_width": 1024,
"model.images.image_1": [
"27",
0
],
"model.images.image_2": [
"29",
0
],
"model.quality": "medium",
"model.size": "auto",
"n": 1,
"prompt": "Swap the subject from @image_2 into @image_1. Maintain the outfit and pose of the character from @image_2 ",
"seed": 222
},
"_meta": {
"title": "OpenAI GPT Image 2.5"
}
},
"27": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": 0,
"image": [
"28",
0
],
"length": 1
},
"_meta": {
"title": "Get Frame from Video"
}
},
"28": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"23",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"29": {
"class_type": "LoadImage",
"inputs": {
"image": "35a392233a678196ccc08ac991db1788fb985f24e1c86e67db3d5751d3336f30.png"
},
"_meta": {
"title": "Load Character Image"
}
},
"281": {
"class_type": "ByteDance2ReferenceNode",
"inputs": {
"model": "Seedance 2.0",
"model.auto_downscale": False,
"model.auto_upscale": False,
"model.duration": 15,
"model.generate_audio": True,
"model.prompt": [
"297",
0
],
"model.ratio": "16:9",
"model.reference_images.image_1": [
"26",
0
],
"model.reference_images.image_2": [
"29",
0
],
"model.resolution": "720p",
"seed": 333,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 Reference to Video (Legacy)"
}
},
"282": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "video",
"format": "auto",
"format.codec": "auto",
"video": [
"281",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"295": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "gpt-image-2_character_swap",
"images": [
"26",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"297": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": ". ",
"string_a": "Use @image_1 as a start frame. Reference @image_2 for the full body shots of the character.",
"string_b": [
"22",
0
]
},
"_meta": {
"title": "Create Prompt"
}
},
"21:20": {
"class_type": "GeminiNode",
"inputs": {
"images": [
"29",
0
],
"model": "gemini-3-1-pro",
"prompt": "Follow the system instructions: The main subject is a rubberhose animation character from @image_1. Extra emphasis on the rubberhose animated movement of the character while playing soccer. The rest of the scene is grounded in realism.",
"seed": 111,
"system_prompt": "SYSTEM PROMPT: HYPER-GRANULAR VIDEO ANALYSIS\nROLE:\nYou are an expert cinematographer, visual analyst, and motion-mechanics describer. Your job is to break down video clips into insanely detailed, hyper-granular, frame-by-frame text descriptions.\nOBJECTIVE:\nTranslate the provided video/sequence into a vivid, kinetic text breakdown. You must capture the exact physical mechanics, the pacing, the micro-expressions, the physics of momentum, the physical reality of the camera itself, and a complete transcription of all audio and dialogue.\nSTRICT RULES:\nComprehensive Audio & Dialogue Transcription: You MUST transcribe all audio cues. Write out exactly what characters are saying using quotation marks (e.g., \"Watch this!\"). If speech is muffled or overlapping, note that. Alongside dialogue, you must meticulously describe all sound effects (clangs, whooshes, impacts), vocalizations (gasps, laughs, screams), background noise, and music.\nNo Intellectual Property (IP) Names: Do not use character names, actor names, or franchise names. Describe them purely by their physical appearance, clothing, and build (e.g., \"the massively built man,\" \"the woman in the pink kimono\").\nCamera as a Character: You MUST describe the camera work as if the camera is a physical object. Note amateur smartphone micro-shakes, forced perspectives, sudden auto-focus adjustments, lens flares, motion blur, whip-pans, and the physical reactions of the cameraperson (e.g., \"The camera violently jerks downward as the cameraperson flinches\").\nKinetic Physics: Describe the transfer of weight, gravity, tension, and impact. Mention things like fabric whipping around legs, the flexing of muscles, the recoil of a strike, or the shattering of the environment.\nFORMATTING TEMPLATE:\nYou must chunk the video into chronological blocks using bold timestamp headers with a thematic title. Under each header, use bullet points to categorize the elements.\n[TIMESTAMP] - [TIMESTAMP]: [Phase Title]\nVisual Framing: [Describe the shot type, lighting, style (e.g., vertical smartphone, 2D animation, extreme close-up, harsh fluorescent light).]\nThe Subjects: [Describe the characters, their exact positioning, posture, clothing, and micro-expressions.]\nThe Action: [Frame-by-frame breakdown of the physical movements. Micro-movements, momentum, physics.]\nCamera Dynamics: [Describe the exact camera movement, zooms, blurs, shake, and panning.]\nAudio/Pacing: [Transcribe ALL spoken dialogue in quotes. Describe the speed/tension of the moment, and detail all audio cues like gasps, footsteps, environmental impacts, music, or background noise.]\nEXAMPLE OUTPUT\nUSER INPUT: [Video of a man trying to flip a pancake, but he throws it too hard, it hits the ceiling, and falls onto his face, causing the cameraperson to drop the phone.]\nAI RESPONSE:\n0:00 - 0:02: The Setup and The Wind-Up\nVisual Framing: The video is shot vertically on a smartphone. The lighting is a harsh, warm, overhead kitchen light. The camera has a constant, subtle micro-shake indicative of an amateur holding a phone single-handedly.\nThe Subjects: A man in a baggy grey hoodie stands in the center of the frame, holding a black Teflon frying pan. Inside the pan is a perfectly round, golden-brown pancake.\nThe Action: The man is grinning widely, looking directly into the camera lens with absolute, unearned confidence. He begins a rhythmic, circular motion with his wrist, swirling the pancake to ensure it is loose in the pan. He bends his knees slightly, lowering his center of gravity for leverage.\nCamera Dynamics: The cameraperson is standing roughly four feet away, holding a static mid-shot from the man's waist to just above his head.\nAudio/Pacing: The pacing is slow and anticipatory. A rhythmic, scraping shhhhk-shhhhk sound is heard as the pancake slides against the metal. The man speaks clearly and confidently: \"Alright, perfect flip in three... two... one...\"\n0:02 - 0:04: The Catastrophic Launch\nVisual Framing: The camera remains static, but the focus briefly hunts as the subject's arm moves rapidly.\nThe Subjects: The man's confident smile tightens into a grimace of exertion.\nThe Action: He rapidly drops his right shoulder and thrusts his arm violently upward in a massive, over-exaggerated jerk. He applies vastly too much kinetic force. The pancake immediately launches out of the pan, rocketing straight upward at high velocity, completely exiting the top boundary of the frame.\nCamera Dynamics: The camera abruptly tilts upward, attempting to track the airborne batter, but the movement is delayed and jerky.\nAudio/Pacing: The man lets out a short, strained grunt: \"Hup!\" The scraping sound is instantly replaced by a loud, wet THWACK from off-camera above, indicating the pancake has hit the ceiling.\n0:04 - 0:06: The Impact and Camera Chaos\nVisual Framing: The lighting is suddenly obscured by a shadow dropping from above.\nThe Action: A fraction of a second later, the heavy, half-cooked pancake plummets straight down, landing with a wet slap squarely onto the man's face, completely covering his eyes and nose. His body instantly recoils, his shoulders hunching up to his ears as he drops the frying pan.\nCamera Dynamics: The cameraperson's fight-or-flight response kicks in. The camera violently jerks downward and to the left as the cameraperson physically flinches. The image completely dissolves into a chaotic, smeared motion blur of the kitchen floor and cabinetry.\nAudio/Pacing: The heavy metallic CLANG of the dropped frying pan hitting the linoleum floor dominates the audio. The cameraperson gasps loudly and shouts, \"Oh my god, dude!\" followed instantly by the sharp clatter of the phone being dropped. The video ends abruptly on a tilted, blurry frame of the baseboards.",
"video": [
"23",
0
]
},
"_meta": {
"title": "Google Gemini"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)