@@ -1066,7 +1066,7 @@ def raise_if_text_params(prompt: str, text_params: list[str]) -> None:
10661066)
10671067
10681068
1069- def _seedance2_text_inputs ():
1069+ def _seedance2_text_inputs (resolutions : list [ str ] ):
10701070 return [
10711071 IO .String .Input (
10721072 "prompt" ,
@@ -1076,7 +1076,7 @@ def _seedance2_text_inputs():
10761076 ),
10771077 IO .Combo .Input (
10781078 "resolution" ,
1079- options = [ "480p" , "720p" ] ,
1079+ options = resolutions ,
10801080 tooltip = "Resolution of the output video." ,
10811081 ),
10821082 IO .Combo .Input (
@@ -1114,8 +1114,8 @@ def define_schema(cls):
11141114 IO .DynamicCombo .Input (
11151115 "model" ,
11161116 options = [
1117- IO .DynamicCombo .Option ("Seedance 2.0" , _seedance2_text_inputs ()),
1118- IO .DynamicCombo .Option ("Seedance 2.0 Fast" , _seedance2_text_inputs ()),
1117+ IO .DynamicCombo .Option ("Seedance 2.0" , _seedance2_text_inputs ([ "480p" , "720p" , "1080p" ] )),
1118+ IO .DynamicCombo .Option ("Seedance 2.0 Fast" , _seedance2_text_inputs ([ "480p" , "720p" ] )),
11191119 ],
11201120 tooltip = "Seedance 2.0 for maximum quality; Seedance 2.0 Fast for speed optimization." ,
11211121 ),
@@ -1152,11 +1152,14 @@ def define_schema(cls):
11521152 (
11531153 $rate480 := 10044;
11541154 $rate720 := 21600;
1155+ $rate1080 := 48800;
11551156 $m := widgets.model;
11561157 $pricePer1K := $contains($m, "fast") ? 0.008008 : 0.01001;
11571158 $res := $lookup(widgets, "model.resolution");
11581159 $dur := $lookup(widgets, "model.duration");
1159- $rate := $res = "720p" ? $rate720 : $rate480;
1160+ $rate := $res = "1080p" ? $rate1080 :
1161+ $res = "720p" ? $rate720 :
1162+ $rate480;
11601163 $cost := $dur * $rate * $pricePer1K / 1000;
11611164 {"type": "usd", "usd": $cost, "format": {"approximate": true}}
11621165 )
@@ -1195,6 +1198,7 @@ async def execute(
11951198 status_extractor = lambda r : r .status ,
11961199 price_extractor = _seedance2_price_extractor (model_id , has_video_input = False ),
11971200 poll_interval = 9 ,
1201+ max_poll_attempts = 180 ,
11981202 )
11991203 return IO .NodeOutput (await download_url_to_video_output (response .content .video_url ))
12001204
@@ -1212,8 +1216,8 @@ def define_schema(cls):
12121216 IO .DynamicCombo .Input (
12131217 "model" ,
12141218 options = [
1215- IO .DynamicCombo .Option ("Seedance 2.0" , _seedance2_text_inputs ()),
1216- IO .DynamicCombo .Option ("Seedance 2.0 Fast" , _seedance2_text_inputs ()),
1219+ IO .DynamicCombo .Option ("Seedance 2.0" , _seedance2_text_inputs ([ "480p" , "720p" , "1080p" ] )),
1220+ IO .DynamicCombo .Option ("Seedance 2.0 Fast" , _seedance2_text_inputs ([ "480p" , "720p" ] )),
12171221 ],
12181222 tooltip = "Seedance 2.0 for maximum quality; Seedance 2.0 Fast for speed optimization." ,
12191223 ),
@@ -1259,11 +1263,14 @@ def define_schema(cls):
12591263 (
12601264 $rate480 := 10044;
12611265 $rate720 := 21600;
1266+ $rate1080 := 48800;
12621267 $m := widgets.model;
12631268 $pricePer1K := $contains($m, "fast") ? 0.008008 : 0.01001;
12641269 $res := $lookup(widgets, "model.resolution");
12651270 $dur := $lookup(widgets, "model.duration");
1266- $rate := $res = "720p" ? $rate720 : $rate480;
1271+ $rate := $res = "1080p" ? $rate1080 :
1272+ $res = "720p" ? $rate720 :
1273+ $rate480;
12671274 $cost := $dur * $rate * $pricePer1K / 1000;
12681275 {"type": "usd", "usd": $cost, "format": {"approximate": true}}
12691276 )
@@ -1324,13 +1331,14 @@ async def execute(
13241331 status_extractor = lambda r : r .status ,
13251332 price_extractor = _seedance2_price_extractor (model_id , has_video_input = False ),
13261333 poll_interval = 9 ,
1334+ max_poll_attempts = 180 ,
13271335 )
13281336 return IO .NodeOutput (await download_url_to_video_output (response .content .video_url ))
13291337
13301338
1331- def _seedance2_reference_inputs ():
1339+ def _seedance2_reference_inputs (resolutions : list [ str ] ):
13321340 return [
1333- * _seedance2_text_inputs (),
1341+ * _seedance2_text_inputs (resolutions ),
13341342 IO .Autogrow .Input (
13351343 "reference_images" ,
13361344 template = IO .Autogrow .TemplateNames (
@@ -1382,8 +1390,8 @@ def define_schema(cls):
13821390 IO .DynamicCombo .Input (
13831391 "model" ,
13841392 options = [
1385- IO .DynamicCombo .Option ("Seedance 2.0" , _seedance2_reference_inputs ()),
1386- IO .DynamicCombo .Option ("Seedance 2.0 Fast" , _seedance2_reference_inputs ()),
1393+ IO .DynamicCombo .Option ("Seedance 2.0" , _seedance2_reference_inputs ([ "480p" , "720p" , "1080p" ] )),
1394+ IO .DynamicCombo .Option ("Seedance 2.0 Fast" , _seedance2_reference_inputs ([ "480p" , "720p" ] )),
13871395 ],
13881396 tooltip = "Seedance 2.0 for maximum quality; Seedance 2.0 Fast for speed optimization." ,
13891397 ),
@@ -1423,13 +1431,16 @@ def define_schema(cls):
14231431 (
14241432 $rate480 := 10044;
14251433 $rate720 := 21600;
1434+ $rate1080 := 48800;
14261435 $m := widgets.model;
14271436 $hasVideo := $lookup(inputGroups, "model.reference_videos") > 0;
14281437 $noVideoPricePer1K := $contains($m, "fast") ? 0.008008 : 0.01001;
14291438 $videoPricePer1K := $contains($m, "fast") ? 0.004719 : 0.006149;
14301439 $res := $lookup(widgets, "model.resolution");
14311440 $dur := $lookup(widgets, "model.duration");
1432- $rate := $res = "720p" ? $rate720 : $rate480;
1441+ $rate := $res = "1080p" ? $rate1080 :
1442+ $res = "720p" ? $rate720 :
1443+ $rate480;
14331444 $noVideoCost := $dur * $rate * $noVideoPricePer1K / 1000;
14341445 $minVideoFactor := $ceil($dur * 5 / 3);
14351446 $minVideoCost := $minVideoFactor * $rate * $videoPricePer1K / 1000;
@@ -1559,6 +1570,7 @@ async def execute(
15591570 status_extractor = lambda r : r .status ,
15601571 price_extractor = _seedance2_price_extractor (model_id , has_video_input = has_video_input ),
15611572 poll_interval = 9 ,
1573+ max_poll_attempts = 180 ,
15621574 )
15631575 return IO .NodeOutput (await download_url_to_video_output (response .content .video_url ))
15641576
0 commit comments