Publish Seedance 2.5 draft mode and video updates
- Add the 样片模式 flow: 480p draft generation, a linkable draft task ID, and pre-flight verification before the 1080p final request. - Allow reference images and audio in video edit/extend requests, matching the provider's 2.5 contract. - Move 主模型 and 样片模式 ahead of 生成模式, default 主模型 to seedance 2.5, and migrate saved widget values. - Refresh the video panel, asset API response logs, and LLM node handling; cover the new behavior with offline tests.
This commit is contained in:
@@ -24,6 +24,7 @@ for child in ("nodes", "utils", "clients"):
|
||||
|
||||
from comfyui_o1key.nodes import seedance_element
|
||||
from comfyui_o1key.nodes.seedance_element import SeedanceElementCreate
|
||||
from comfyui_o1key.nodes.seedance_autopass import SeedanceAutoPass
|
||||
from comfyui_o1key.nodes import seedance_video
|
||||
from comfyui_o1key.nodes.seedance_video import (
|
||||
SeedanceMultiModal,
|
||||
@@ -69,6 +70,7 @@ class SeedanceParameterSyncTests(unittest.TestCase):
|
||||
)
|
||||
self.assertIn("30秒", inputs["时长"].options)
|
||||
self.assertEqual(inputs["seed"].max, 0xffffffffffffffff)
|
||||
self.assertEqual(inputs["seed"].default, 0)
|
||||
self.assertEqual(
|
||||
_resolve_model_matrix("seedance 2.5", "海外HC"),
|
||||
"dreamina-seedance-2-5-hc",
|
||||
@@ -87,17 +89,112 @@ class SeedanceParameterSyncTests(unittest.TestCase):
|
||||
self.assertTrue(_is_new_format_model("dreamina-seedance-2-0-hc"))
|
||||
self.assertTrue(_is_new_format_model("dreamina-seedance-2-5-hc"))
|
||||
_check_fast_resolution("dreamina-seedance-2-5-hc", "1080p")
|
||||
_check_fast_resolution("dreamina-seedance-2-5-hc", "4k")
|
||||
with self.assertRaisesRegex(ValueError, "不支持 4k"):
|
||||
_check_fast_resolution("dreamina-seedance-2-5-hc", "4k")
|
||||
with self.assertRaisesRegex(ValueError, "不支持 4k"):
|
||||
_check_fast_resolution("dreamina-seedance-2-0-fast-hc", "4k")
|
||||
for limited_model in (
|
||||
"doubao-seedance-2-0-fast-260128-max",
|
||||
"doubao-seedance-2-0-mini-260615-max",
|
||||
"seedance-2-0-fast-260128-d",
|
||||
"seedance-2-0-mini-260615-d",
|
||||
):
|
||||
with self.subTest(limited_model=limited_model):
|
||||
with self.assertRaisesRegex(ValueError, "不支持 4k"):
|
||||
_check_fast_resolution(limited_model, "4k")
|
||||
_check_fast_resolution("doubao-seedance-2-5-260628-max", "4k")
|
||||
with self.assertRaisesRegex(ValueError, "不支持 4k"):
|
||||
_check_fast_resolution("doubao-seedance-2-5-260628-max", "4k")
|
||||
|
||||
def test_seed_is_never_sent_to_the_provider(self):
|
||||
body = SeedanceAutoPass._build_body(
|
||||
"doubao-seedance-2-5-260628-max",
|
||||
"prompt",
|
||||
"1080p",
|
||||
"智能",
|
||||
"5秒",
|
||||
False,
|
||||
False,
|
||||
["asset://image-1"],
|
||||
[],
|
||||
[],
|
||||
generation_mode="多模态参考生视频",
|
||||
)
|
||||
self.assertNotIn("seed", body)
|
||||
|
||||
def test_generation_modes_cover_document_scenarios(self):
|
||||
schema = SeedanceAutoPass.GET_SCHEMA()
|
||||
inputs = {item.id: item for item in schema.inputs}
|
||||
self.assertEqual(
|
||||
inputs["生成模式"].options,
|
||||
["多模态", "首尾帧", "视频编辑", "视频延长"],
|
||||
)
|
||||
self.assertEqual(inputs["输出格式"].options, ["mp4", "mov"])
|
||||
self.assertEqual(inputs["seed"].default, 0)
|
||||
|
||||
def test_edit_body_carries_task_type_and_output_format(self):
|
||||
body = SeedanceAutoPass._build_body(
|
||||
"doubao-seedance-2-5-260628-max",
|
||||
"去掉背景里的行人",
|
||||
"1080p",
|
||||
"auto",
|
||||
-1,
|
||||
False,
|
||||
False,
|
||||
[],
|
||||
["https://example.invalid/clip.mp4"],
|
||||
[],
|
||||
generation_mode="edit",
|
||||
output_format="mov",
|
||||
)
|
||||
self.assertEqual(body["omni_reference_task_type"], "edit")
|
||||
self.assertEqual(body["output_format"], "mov")
|
||||
self.assertEqual(body["duration"], -1)
|
||||
self.assertEqual(body["ratio"], "adaptive")
|
||||
self.assertEqual(
|
||||
[item["video_url"]["url"] for item in body["content"] if item["type"] == "video_url"],
|
||||
["https://example.invalid/clip.mp4"],
|
||||
)
|
||||
|
||||
def test_edit_body_carries_reference_images_before_the_video(self):
|
||||
body = SeedanceAutoPass._build_body(
|
||||
"doubao-seedance-2-5-260628-max",
|
||||
"把 @video1 中的男子替换为 @image1 中的女子",
|
||||
"480p",
|
||||
"auto",
|
||||
-1,
|
||||
False,
|
||||
False,
|
||||
["asset://image-1"],
|
||||
["asset://video-1"],
|
||||
[],
|
||||
generation_mode="edit",
|
||||
)
|
||||
self.assertEqual(body["omni_reference_task_type"], "edit")
|
||||
self.assertEqual(
|
||||
[item.get("role") for item in body["content"] if item["type"] != "text"],
|
||||
["reference_image", "reference_video"],
|
||||
)
|
||||
self.assertNotIn(
|
||||
"first_frame",
|
||||
[item.get("role") for item in body["content"]],
|
||||
)
|
||||
|
||||
def test_auto_duration_and_adaptive_ratio_reach_the_request_body(self):
|
||||
body = SeedanceAutoPass._build_body(
|
||||
"doubao-seedance-2-5-260628-max",
|
||||
"prompt",
|
||||
"1080p",
|
||||
"智能",
|
||||
"自动",
|
||||
False,
|
||||
False,
|
||||
["asset://image-1"],
|
||||
[],
|
||||
[],
|
||||
generation_mode="多模态参考生视频",
|
||||
)
|
||||
self.assertEqual(body["duration"], -1)
|
||||
self.assertEqual(body["ratio"], "adaptive")
|
||||
|
||||
def test_multimodal_uses_v3_autogrow_media_inputs(self):
|
||||
self.assertTrue(issubclass(SeedanceMultiModal, io.ComfyNode))
|
||||
|
||||
Reference in New Issue
Block a user