نقل الأسلوب فيديو إلى فيديو Vid2Vid - GPT Image 2 + Seedance 2.0
أنشئ حتى 4 عمليات توليد نقل أسلوب فيديو إلى فيديو باستخدام أحدث النماذج. ينشئ هذا سير العمل خريطة عمق من فيديو الإدخال لتوجيه توليد Seedance 2.0. يتم استخراج الإطار الأول من الفيديو واستخدامه كمرجع مع مطالبات الأسلوب باستخدام GPT-Image-2.
حول
يطبّق هذا سير العمل من فيديو إلى فيديو، المعتمد على العمق والموجّه بالمرجع، نقل أسلوب متسق على لقطاتك مع الحفاظ على الحركة وهندسة المشهد. يبدأ بإدخال المقطع عبر LoadVideo، ثم يحسب خريطة عمق لكل إطار لتثبيت البنية وحركة الكاميرا (تتعامل معها عقدة المعالجة المخصصة c3b10638-32f0-4101-9b21-21fcda8712d8). يتم استخراج الإطار الأول وحفظه (عبر SaveImage وأدوات مساعدة مثل 8dbec705-cae4-4197-9594-85b48cc18483)، ثم يُمرَّر إلى OpenAIGPTImageNodeV2 مع مطالبتك النصية من PrimitiveStringMultiline. ينشئ GPT-Image-2 صورة مرجعية مطابقة للأسلوب من ذلك الإطار الأول، ويستخدمها سير العمل لتوجيه المظهر العام.
يقود الأسلوب الأساسي Seedance 2.0 عبر ByteDance2ReferenceNode، الذي يدمج ثلاث إشارات: خريطة العمق (البنية)، ومرجع أسلوب الإطار الأول (المظهر)، ومطالبتك (التوجيه الدلالي). يمكنك وضع ما يصل إلى أربعة تنويعات أسلوبية في تشغيل واحد باستخدام عُقَد تفريع/تجميع الدفعات (a3edb32a-4533-45e3-8eb2-84399225da2e)، ثم إعادة تجميع الإطارات المُنشأة إلى فيديوهات نهائية عبر CreateVideo وSaveVideo. النتيجة مجموعة مقاطع مستقرة ومتسقة مع الأسلوب تحافظ على التوقيت والحركة الأصليين مع انعكاس الجمالية التي تختارها.
ما تقدّمه
- جارٍ قراءة سير العمل
يعمل في 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({
"5001": {
"class_type": "LoadVideo",
"inputs": {
"file": "4d3c0f63a57ce34ca0b50ac4800b8000c60773c7c135779fb153ff7b3e54980d.mp4"
},
"_meta": {
"title": "Load Video"
}
},
"5312": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": 24,
"images": [
"5337:5326",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"5313": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "2x2_stack_final",
"format": "auto",
"format.codec": "auto",
"video": [
"5312",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"5340": {
"class_type": "ByteDance2ReferenceNode",
"inputs": {
"model": "Seedance 2.0",
"model.auto_downscale": False,
"model.auto_upscale": False,
"model.duration": 6,
"model.generate_audio": True,
"model.prompt": [
"5391:5394",
0
],
"model.ratio": "adaptive",
"model.reference_images.image_1": [
"5346",
0
],
"model.reference_videos.video_1": [
"5405:5359",
0
],
"model.resolution": "480p",
"seed": 111,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 Reference to Video (Legacy)"
}
},
"5341": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "2x2_stack_1_video",
"format": "auto",
"format.codec": "auto",
"video": [
"5340",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"5346": {
"class_type": "OpenAIGPTImageNodeV2",
"inputs": {
"model": "gpt-image-2",
"model.background": "auto",
"model.custom_height": 1024,
"model.custom_width": 1024,
"model.images.image_1": [
"5405:5406",
0
],
"model.quality": "medium",
"model.size": "auto",
"n": 1,
"prompt": [
"5391:5384",
0
],
"seed": 111
},
"_meta": {
"title": "OpenAI GPT Image 2.5"
}
},
"5347": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "2x2_stack_2_image",
"images": [
"5362",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"5349": {
"class_type": "ByteDance2ReferenceNode",
"inputs": {
"model": "Seedance 2.0",
"model.auto_downscale": False,
"model.auto_upscale": False,
"model.duration": 6,
"model.generate_audio": True,
"model.prompt": [
"5391:5395",
0
],
"model.ratio": "adaptive",
"model.reference_images.image_1": [
"5362",
0
],
"model.reference_videos.video_1": [
"5405:5359",
0
],
"model.resolution": "480p",
"seed": 22,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 Reference to Video (Legacy)"
}
},
"5350": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "2x2_stack_2_video",
"format": "auto",
"format.codec": "auto",
"video": [
"5349",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"5351": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "2x2_stack_3_image",
"images": [
"5363",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"5353": {
"class_type": "ByteDance2ReferenceNode",
"inputs": {
"model": "Seedance 2.0",
"model.auto_downscale": False,
"model.auto_upscale": False,
"model.duration": 6,
"model.generate_audio": True,
"model.prompt": [
"5391:5396",
0
],
"model.ratio": "adaptive",
"model.reference_images.image_1": [
"5363",
0
],
"model.reference_videos.video_1": [
"5405:5359",
0
],
"model.resolution": "480p",
"seed": 333,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 Reference to Video (Legacy)"
}
},
"5354": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "2x2_stack_3_video",
"format": "auto",
"format.codec": "auto",
"video": [
"5353",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"5355": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "2x2_stack_4_image",
"images": [
"5364",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"5357": {
"class_type": "ByteDance2ReferenceNode",
"inputs": {
"model": "Seedance 2.0",
"model.auto_downscale": False,
"model.auto_upscale": False,
"model.duration": 6,
"model.generate_audio": True,
"model.prompt": [
"5391:5397",
0
],
"model.ratio": "adaptive",
"model.reference_images.image_1": [
"5364",
0
],
"model.reference_videos.video_1": [
"5405:5359",
0
],
"model.resolution": "480p",
"seed": 4,
"watermark": False
},
"_meta": {
"title": "ByteDance Seedance 2.5 Reference to Video (Legacy)"
}
},
"5358": {
"class_type": "SaveVideo",
"inputs": {
"codec": "auto",
"filename_prefix": "2x2_stack_4_video",
"format": "auto",
"format.codec": "auto",
"video": [
"5357",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"5360": {
"class_type": "SaveImage",
"inputs": {
"filename_prefix": "2x2_stack_1_image",
"images": [
"5346",
0
]
},
"_meta": {
"title": "Save Image"
}
},
"5362": {
"class_type": "OpenAIGPTImageNodeV2",
"inputs": {
"model": "gpt-image-2",
"model.background": "auto",
"model.custom_height": 1024,
"model.custom_width": 1024,
"model.images.image_1": [
"5405:5406",
0
],
"model.quality": "medium",
"model.size": "auto",
"n": 1,
"prompt": [
"5391:5386",
0
],
"seed": 222
},
"_meta": {
"title": "OpenAI GPT Image 2.5"
}
},
"5363": {
"class_type": "OpenAIGPTImageNodeV2",
"inputs": {
"model": "gpt-image-2",
"model.background": "auto",
"model.custom_height": 1024,
"model.custom_width": 1024,
"model.images.image_1": [
"5405:5406",
0
],
"model.quality": "medium",
"model.size": "auto",
"n": 1,
"prompt": [
"5391:5388",
0
],
"seed": 333
},
"_meta": {
"title": "OpenAI GPT Image 2.5"
}
},
"5364": {
"class_type": "OpenAIGPTImageNodeV2",
"inputs": {
"model": "gpt-image-2",
"model.background": "auto",
"model.custom_height": 1024,
"model.custom_width": 1024,
"model.images.image_1": [
"5405:5406",
0
],
"model.quality": "medium",
"model.size": "auto",
"n": 1,
"prompt": [
"5391:5390",
0
],
"seed": 444
},
"_meta": {
"title": "OpenAI GPT Image 2.5"
}
},
"5401": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "apply a post-apocalyptic orange and teal desert grade"
},
"_meta": {
"title": "Prompt - Style 1"
}
},
"5402": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "apply a surreal dreamlike bloom grade with glowing highlights, soft halation around light sources, lifted blacks, and a hazy ethereal pastel wash across the midtones"
},
"_meta": {
"title": "Prompt - Style 2"
}
},
"5403": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "apply a olive and amber grade with deep shadows"
},
"_meta": {
"title": "Prompt - Style 3"
}
},
"5404": {
"class_type": "PrimitiveStringMultiline",
"inputs": {
"value": "apply a symmetrical pastel grade with mustard yellows and dusty pinks"
},
"_meta": {
"title": "Prompt - Style 4"
}
},
"5337:5326": {
"class_type": "ImageStitch",
"inputs": {
"direction": "down",
"image1": [
"5337:5327",
0
],
"image2": [
"5337:5334",
0
],
"match_image_size": True,
"spacing_color": "white",
"spacing_width": 0
},
"_meta": {
"title": "Stitch Images"
}
},
"5337:5327": {
"class_type": "ImageStitch",
"inputs": {
"direction": "right",
"image1": [
"5337:5330",
0
],
"image2": [
"5337:5328",
0
],
"match_image_size": True,
"spacing_color": "white",
"spacing_width": 0
},
"_meta": {
"title": "Stitch Images"
}
},
"5337:5328": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"5349",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"5337:5330": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"5340",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"5337:5332": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"5353",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"5337:5334": {
"class_type": "ImageStitch",
"inputs": {
"direction": "right",
"image1": [
"5337:5332",
0
],
"image2": [
"5337:5335",
0
],
"match_image_size": True,
"spacing_color": "white",
"spacing_width": 0
},
"_meta": {
"title": "Stitch Images"
}
},
"5337:5335": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"5357",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"5391:5384": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Change the style of @image_1 to",
"string_b": [
"5401",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5391:5386": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Change the style of @image_1 to",
"string_b": [
"5402",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5391:5388": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Change the style of @image_1 to",
"string_b": [
"5403",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5391:5390": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Change the style of @image_1 to",
"string_b": [
"5404",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5391:5394": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Use @image_1 from the reference images as a start frame and visual style. Use the motion from the depth map from @video_1. Ensure that the style of the video is",
"string_b": [
"5401",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5391:5395": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Use @image_1 from the reference images as a start frame and visual style. Use the motion from the depth map from @video_1. Ensure that the style of the video is",
"string_b": [
"5402",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5391:5396": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Use @image_1 from the reference images as a start frame and visual style. Use the motion from the depth map from @video_1. Ensure that the style of the video is",
"string_b": [
"5403",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5391:5397": {
"class_type": "StringConcatenate",
"inputs": {
"delimiter": " ",
"string_a": "Use @image_1 from the reference images as a start frame and visual style. Use the motion from the depth map from @video_1. Ensure that the style of the video is",
"string_b": [
"5404",
0
]
},
"_meta": {
"title": "Concatenate Text"
}
},
"5405:5342": {
"class_type": "DepthAnything_V3",
"inputs": {
"da3_model": [
"5405:5343",
0
],
"images": [
"5405:5344",
0
],
"invert_depth": False,
"keep_model_size": False,
"normalization_mode": "V2-Style",
"resize_method": "resize"
},
"_meta": {
"title": "Depth Anything V3"
}
},
"5405:5343": {
"class_type": "DownloadAndLoadDepthAnythingV3Model",
"inputs": {
"attention": "auto",
"model": "da3_large.safetensors",
"precision": "auto"
},
"_meta": {
"title": "Load Depth Anything V3 Model"
}
},
"5405:5344": {
"class_type": "GetVideoComponents",
"inputs": {
"video": [
"5001",
0
]
},
"_meta": {
"title": "Get Video Components"
}
},
"5405:5359": {
"class_type": "CreateVideo",
"inputs": {
"audio": [
"5405:5344",
1
],
"bit_depth": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": [
"5405:5344",
2
],
"images": [
"5405:5342",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"5405:5406": {
"class_type": "ImageFromBatch",
"inputs": {
"batch_index": 0,
"image": [
"5405:5344",
0
],
"length": 1
},
"_meta": {
"title": "Get Image from Batch"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)الأسئلة والأجوبة
يقوم بحساب خريطة عمق لكل إطار من فيديو الإدخال للحفاظ على بنية المشهد، ثم يستخدم ByteDance2ReferenceNode (Seedance 2.0) لدمج تلك البنية مع مرجع أسلوب مُنشأ من الإطار الأول بواسطة GPT-Image-2. عادةً ما يقلل رفع إعدادات تأثير العمق/الاتساق (إن كانت متاحة) من الوميض والتشوه.
نعم. تستدعي OpenAIGPTImageNodeV2 نموذج GPT-Image-2 لإنشاء مرجع مطابق للأسلوب من الإطار الأول. أضف مفتاح API في إعدادات تلك العقدة واضبط أي معلمات متاحة للتحكم في إخراج المرجع.
نعم. أدخل ما يصل إلى أربعة مطالبات (واحدة لكل سطر) في PrimitiveStringMultiline. تقوم عُقَد الدفعة (a3edb32a-4533-45e3-8eb2-84399225da2e) بتفريع المدخلات بحيث ينتج خط الأنابيب ما يصل إلى أربعة فيديوهات في تشغيل واحد.
جرّب زيادة تأثير العمق أو الاتساق الزمني في ByteDance2ReferenceNode، وخفض قوة الأسلوب، واستخدام seed ثابت. تأكد أيضًا من أن fps والدقة مناسبين لوحدة معالجة الرسومات (GPU) لديك؛ فالإعدادات المرتفعة جدًا قد تسبب عدم استقرار.
لا. تقوم SaveVideo بكتابة ملفات فيديو صامتة. إذا كنت تحتاج الصوت، صدّره من المقطع الأصلي ثم أعد دمجه مع الإخراج المُنسّق في محرر الفيديو.