everypixel-cli 0.5.1__tar.gz → 0.5.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (25) hide show
  1. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/CHANGELOG.md +4 -0
  2. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/PKG-INFO +18 -1
  3. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/README.md +17 -0
  4. everypixel_cli-0.5.2/src/everypixel_cli/__init__.py +1 -0
  5. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/application/services.py +61 -7
  6. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/cli.py +30 -2
  7. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/resources/openapi.json +96 -6
  8. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/schemas.py +34 -2
  9. everypixel_cli-0.5.1/src/everypixel_cli/__init__.py +0 -1
  10. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/.gitignore +0 -0
  11. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/LICENSE +0 -0
  12. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/pyproject.toml +0 -0
  13. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/__main__.py +0 -0
  14. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/application/__init__.py +0 -0
  15. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/application/chat.py +0 -0
  16. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/application/models.py +0 -0
  17. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/application/serialization.py +0 -0
  18. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/client.py +0 -0
  19. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/config.py +0 -0
  20. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/errors.py +0 -0
  21. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/files.py +0 -0
  22. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/mcp_server.py +0 -0
  23. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/openapi.py +0 -0
  24. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/output.py +0 -0
  25. {everypixel_cli-0.5.1 → everypixel_cli-0.5.2}/src/everypixel_cli/resources/__init__.py +0 -0
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.2] - 2026-11-04
4
+
5
+ - Add Seedance seeds and Seedance 2.5 draft previews with final rendering.
6
+
3
7
  ## [0.5.1] - 2026-10-28
4
8
 
5
9
  - Add account balance lookup and request cost estimation with `--estimate-cost`.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: everypixel-cli
3
- Version: 0.5.1
3
+ Version: 0.5.2
4
4
  Summary: Official command line interface for Everypixel API
5
5
  Project-URL: Homepage, https://labs.everypixel.com
6
6
  Project-URL: Repository, https://github.com/everypixel/everypixel-cli
@@ -263,6 +263,23 @@ Input options depend on the model:
263
263
  See the [API documentation](https://labs.everypixel.com/docs) for each model's
264
264
  accepted inputs, resolutions, and durations.
265
265
 
266
+ Seedance accepts `--seed` for generation and editing. For Seedance 2.5 previews,
267
+ use `--draft`; resolution defaults to 480p. Once the draft succeeds, render its
268
+ 1080p final with `--draft-from-task-id` using the same command (`generate` or `edit`):
269
+
270
+ ```bash
271
+ everypixel video generate "a cat walking through a garden" \
272
+ --model seedance2.5 --draft --seed 73 --output-json
273
+
274
+ everypixel video generate --model seedance2.5 \
275
+ --draft-from-task-id DRAFT_TASK_UUID --download ./outputs
276
+ ```
277
+
278
+ Finalization accepts only the model, draft task ID, resolution (1080p), and
279
+ optional callback URL. It inherits the prompt, media, duration, aspect ratio,
280
+ seed, and audio settings from the draft. Both stages are billed as separate
281
+ tasks. `status` exposes the resolved seed, draft state, and draft expiry.
282
+
266
283
  For upscaling, use `seedvr2` (the default) or a Topaz model such as `topaz-prob-4`:
267
284
 
268
285
  ```bash
@@ -229,6 +229,23 @@ Input options depend on the model:
229
229
  See the [API documentation](https://labs.everypixel.com/docs) for each model's
230
230
  accepted inputs, resolutions, and durations.
231
231
 
232
+ Seedance accepts `--seed` for generation and editing. For Seedance 2.5 previews,
233
+ use `--draft`; resolution defaults to 480p. Once the draft succeeds, render its
234
+ 1080p final with `--draft-from-task-id` using the same command (`generate` or `edit`):
235
+
236
+ ```bash
237
+ everypixel video generate "a cat walking through a garden" \
238
+ --model seedance2.5 --draft --seed 73 --output-json
239
+
240
+ everypixel video generate --model seedance2.5 \
241
+ --draft-from-task-id DRAFT_TASK_UUID --download ./outputs
242
+ ```
243
+
244
+ Finalization accepts only the model, draft task ID, resolution (1080p), and
245
+ optional callback URL. It inherits the prompt, media, duration, aspect ratio,
246
+ seed, and audio settings from the draft. Both stages are billed as separate
247
+ tasks. `status` exposes the resolved seed, draft state, and draft expiry.
248
+
232
249
  For upscaling, use `seedvr2` (the default) or a Topaz model such as `topaz-prob-4`:
233
250
 
234
251
  ```bash
@@ -0,0 +1 @@
1
+ __version__ = "0.5.2"
@@ -34,6 +34,7 @@ from ..openapi import (
34
34
  )
35
35
  from ..schemas import (
36
36
  ChatRequest,
37
+ Seedance2BaseVideoRequest,
37
38
  TTS_CREATE_PAYLOADS,
38
39
  TTS_DESIGN_PAYLOADS,
39
40
  TTSClonePayload,
@@ -410,13 +411,30 @@ class _VideoEditInputs:
410
411
  callback_url: str | None
411
412
  keyframes: list[str]
412
413
  public_figure_threshold: str | None
414
+ draft: bool | None
415
+ draft_from_task_id: str | None
416
+
417
+
418
+ def _serialize_video_payload(validated: BaseModel) -> dict[str, Any]:
419
+ """Finalization must not send inherited generation defaults back to the API."""
420
+
421
+ if (
422
+ isinstance(validated, Seedance2BaseVideoRequest)
423
+ and validated.draft_from_task_id
424
+ ):
425
+ return validated.model_dump(
426
+ mode="json",
427
+ exclude_none=True,
428
+ include={"model", "draft_from_task_id", "resolution", "callback_url"},
429
+ )
430
+ return validated.model_dump(mode="json", exclude_none=True)
413
431
 
414
432
 
415
433
  def _validated_video_edit_payload(values: Mapping[str, Any]) -> dict[str, Any]:
416
434
  validated = _VIDEO_EDIT_ADAPTER.validate_python(
417
435
  {key: value for key, value in values.items() if value is not None}
418
436
  )
419
- return validated.model_dump(mode="json", exclude_none=True)
437
+ return _serialize_video_payload(validated)
420
438
 
421
439
 
422
440
  def _reject_video_edit_options(model: str, options: Mapping[str, Any]) -> None:
@@ -431,7 +449,11 @@ def _reject_video_edit_options(model: str, options: Mapping[str, Any]) -> None:
431
449
 
432
450
 
433
451
  def _build_content_video_edit_payload(
434
- inputs: _VideoEditInputs, *, include_roles: bool
452
+ inputs: _VideoEditInputs,
453
+ *,
454
+ include_roles: bool,
455
+ provider_options: Mapping[str, Any] | None = None,
456
+ include_content: bool = True,
435
457
  ) -> dict[str, Any]:
436
458
  content: list[dict[str, Any]] = [{"type": "text", "text": inputs.prompt}]
437
459
  for value in inputs.images:
@@ -468,7 +490,8 @@ def _build_content_video_edit_payload(
468
490
  "aspect_ratio": inputs.aspect_ratio,
469
491
  "generate_audio": inputs.generate_audio,
470
492
  "callback_url": inputs.callback_url,
471
- "content": content,
493
+ **({"content": content} if include_content else {}),
494
+ **(provider_options or {}),
472
495
  }
473
496
  )
474
497
 
@@ -479,12 +502,25 @@ def _build_seedance_video_edit_payload(
479
502
  _reject_video_edit_options(
480
503
  inputs.model,
481
504
  {
482
- "seed": inputs.seed,
483
505
  "keyframe": inputs.keyframes,
484
506
  "public_figure_threshold": inputs.public_figure_threshold,
485
507
  },
486
508
  )
487
- return _build_content_video_edit_payload(inputs, include_roles=True)
509
+ if inputs.draft_from_task_id is not None:
510
+ _reject_video_edit_options(
511
+ inputs.model,
512
+ {"image": inputs.images, "video": inputs.video, "audio": inputs.audio},
513
+ )
514
+ return _build_content_video_edit_payload(
515
+ inputs,
516
+ include_roles=True,
517
+ provider_options={
518
+ "seed": inputs.seed,
519
+ "draft": inputs.draft,
520
+ "draft_from_task_id": inputs.draft_from_task_id,
521
+ },
522
+ include_content=inputs.draft_from_task_id is None,
523
+ )
488
524
 
489
525
 
490
526
  def _build_kling_video_edit_payload(inputs: _VideoEditInputs) -> dict[str, Any]:
@@ -643,6 +679,8 @@ def build_video_edit_payload(
643
679
  task_id: str | None = None,
644
680
  model: str = "seedance2",
645
681
  seed: int | None = None,
682
+ draft: bool | None = None,
683
+ draft_from_task_id: str | None = None,
646
684
  keyframes: list[str] | None = None,
647
685
  public_figure_threshold: str | None = None,
648
686
  ) -> dict[str, Any]:
@@ -663,7 +701,13 @@ def build_video_edit_payload(
663
701
  callback_url=callback_url,
664
702
  keyframes=keyframes or [],
665
703
  public_figure_threshold=public_figure_threshold,
704
+ draft=draft,
705
+ draft_from_task_id=draft_from_task_id,
666
706
  )
707
+ if model not in {"seedance2", "seedance2-mini", "seedance2.5"}:
708
+ _reject_video_edit_options(
709
+ model, {"draft": draft, "draft_from_task_id": draft_from_task_id}
710
+ )
667
711
  builder = _VIDEO_EDIT_BUILDERS.get(model)
668
712
  if builder is None:
669
713
  raise ValidationCLIError(
@@ -741,6 +785,8 @@ def _build_seedance_video_generate_payload(payload: dict[str, Any]) -> dict[str,
741
785
  content.append(
742
786
  {"type": "image_url", "role": "reference_image", "image_url": {"url": url}}
743
787
  )
788
+ if payload.get("draft_from_task_id") is not None and not content:
789
+ return payload
744
790
  return {**payload, "content": content}
745
791
 
746
792
 
@@ -796,7 +842,7 @@ def build_video_generate_payload(**values: Any) -> dict[str, Any]:
796
842
  validated = _VIDEO_GENERATE_ADAPTER.validate_python(
797
843
  {key: value for key, value in payload.items() if value is not None}
798
844
  )
799
- return validated.model_dump(mode="json", exclude_none=True)
845
+ return _serialize_video_payload(validated)
800
846
 
801
847
 
802
848
  def build_video_upscale_payload(**values: Any) -> dict[str, Any]:
@@ -1115,7 +1161,7 @@ class ApplicationServices:
1115
1161
  def execute_video_generate(
1116
1162
  self,
1117
1163
  *,
1118
- prompt: str,
1164
+ prompt: str | None,
1119
1165
  model: str,
1120
1166
  duration: int | None,
1121
1167
  resolution: str | None,
@@ -1128,9 +1174,13 @@ class ApplicationServices:
1128
1174
  seed: int | None = None,
1129
1175
  generate_audio: bool | None = None,
1130
1176
  callback_url: str | None = None,
1177
+ draft: bool | None = None,
1178
+ draft_from_task_id: str | None = None,
1131
1179
  execution: ExecutionOptions,
1132
1180
  ) -> OperationResult:
1133
1181
  payload = build_video_generate_payload(
1182
+ draft=draft,
1183
+ draft_from_task_id=draft_from_task_id,
1134
1184
  prompt=prompt,
1135
1185
  model=model,
1136
1186
  duration=duration,
@@ -1168,10 +1218,14 @@ class ApplicationServices:
1168
1218
  callback_url: str | None,
1169
1219
  keyframes: list[str],
1170
1220
  public_figure_threshold: str | None,
1221
+ draft: bool | None = None,
1222
+ draft_from_task_id: str | None = None,
1171
1223
  execution: ExecutionOptions,
1172
1224
  task_id: str | None = None,
1173
1225
  ) -> OperationResult:
1174
1226
  payload = build_video_edit_payload(
1227
+ draft=draft,
1228
+ draft_from_task_id=draft_from_task_id,
1175
1229
  prompt=prompt,
1176
1230
  model=model,
1177
1231
  images=images,
@@ -166,6 +166,14 @@ EstimateCostOption = Annotated[
166
166
  bool,
167
167
  typer.Option("--estimate-cost", help="Estimate USD cost without creating a task."),
168
168
  ]
169
+ DraftOption = Annotated[
170
+ Optional[bool],
171
+ typer.Option("--draft/--no-draft", help="Seedance 2.5 preview at 480p."),
172
+ ]
173
+ DraftFromTaskOption = Annotated[
174
+ Optional[str],
175
+ typer.Option("--draft-from-task-id", help="Render a Seedance 2.5 draft at 1080p."),
176
+ ]
169
177
  DownloadOption = Annotated[
170
178
  Optional[Path],
171
179
  typer.Option("--download", "-d", help="Download result URLs into a directory."),
@@ -914,7 +922,10 @@ def image_colors(
914
922
  @video_app.command("generate")
915
923
  def video_generate(
916
924
  ctx: typer.Context,
917
- prompt: str,
925
+ prompt: Annotated[
926
+ Optional[str],
927
+ typer.Argument(help="Generation prompt; omit for draft finalization."),
928
+ ] = None,
918
929
  model: str = "ltx23",
919
930
  duration: Optional[int] = None,
920
931
  resolution: Optional[str] = None,
@@ -948,6 +959,8 @@ def video_generate(
948
959
  Optional[bool], typer.Option("--generate-audio/--no-generate-audio")
949
960
  ] = None,
950
961
  callback_url: Annotated[Optional[str], typer.Option("--callback-url")] = None,
962
+ draft: DraftOption = None,
963
+ draft_from_task_id: DraftFromTaskOption = None,
951
964
  estimate_cost: EstimateCostOption = False,
952
965
  wait_option: WaitOption = None,
953
966
  download: DownloadOption = None,
@@ -967,6 +980,8 @@ def video_generate(
967
980
  run_action(
968
981
  ctx,
969
982
  lambda: runtime.services().execute_video_generate(
983
+ draft=draft,
984
+ draft_from_task_id=draft_from_task_id,
970
985
  prompt=prompt,
971
986
  model=model,
972
987
  duration=duration,
@@ -987,7 +1002,8 @@ def video_generate(
987
1002
  def video_edit(
988
1003
  ctx: typer.Context,
989
1004
  prompt: Annotated[
990
- Optional[str], typer.Argument(help="Edit prompt; optional for Aleph 2.")
1005
+ Optional[str],
1006
+ typer.Argument(help="Edit prompt; optional for Aleph 2 or draft finalization."),
991
1007
  ] = None,
992
1008
  model: Annotated[str, typer.Option("--model")] = "seedance2",
993
1009
  image: Annotated[
@@ -1028,6 +1044,8 @@ def video_edit(
1028
1044
  Optional[bool], typer.Option("--generate-audio/--no-generate-audio")
1029
1045
  ] = None,
1030
1046
  callback_url: Annotated[Optional[str], typer.Option("--callback-url")] = None,
1047
+ draft: DraftOption = None,
1048
+ draft_from_task_id: DraftFromTaskOption = None,
1031
1049
  estimate_cost: EstimateCostOption = False,
1032
1050
  wait_option: WaitOption = None,
1033
1051
  download: DownloadOption = None,
@@ -1047,6 +1065,8 @@ def video_edit(
1047
1065
  run_action(
1048
1066
  ctx,
1049
1067
  lambda: runtime.services().execute_video_edit(
1068
+ draft=draft,
1069
+ draft_from_task_id=draft_from_task_id,
1050
1070
  prompt=prompt,
1051
1071
  model=model,
1052
1072
  images=image,
@@ -1080,6 +1100,8 @@ def video_from_image(
1080
1100
  Optional[bool], typer.Option("--generate-audio/--no-generate-audio")
1081
1101
  ] = None,
1082
1102
  callback_url: Annotated[Optional[str], typer.Option("--callback-url")] = None,
1103
+ draft: DraftOption = None,
1104
+ draft_from_task_id: DraftFromTaskOption = None,
1083
1105
  estimate_cost: EstimateCostOption = False,
1084
1106
  wait_option: WaitOption = None,
1085
1107
  download: DownloadOption = None,
@@ -1099,6 +1121,8 @@ def video_from_image(
1099
1121
  run_action(
1100
1122
  ctx,
1101
1123
  lambda: runtime.services().execute_video_generate(
1124
+ draft=draft,
1125
+ draft_from_task_id=draft_from_task_id,
1102
1126
  prompt=prompt,
1103
1127
  model=model,
1104
1128
  duration=duration,
@@ -1128,6 +1152,8 @@ def video_first_last(
1128
1152
  Optional[bool], typer.Option("--generate-audio/--no-generate-audio")
1129
1153
  ] = None,
1130
1154
  callback_url: Annotated[Optional[str], typer.Option("--callback-url")] = None,
1155
+ draft: DraftOption = None,
1156
+ draft_from_task_id: DraftFromTaskOption = None,
1131
1157
  estimate_cost: EstimateCostOption = False,
1132
1158
  wait_option: WaitOption = None,
1133
1159
  download: DownloadOption = None,
@@ -1147,6 +1173,8 @@ def video_first_last(
1147
1173
  run_action(
1148
1174
  ctx,
1149
1175
  lambda: runtime.services().execute_video_generate(
1176
+ draft=draft,
1177
+ draft_from_task_id=draft_from_task_id,
1150
1178
  prompt=prompt,
1151
1179
  model=model,
1152
1180
  duration=duration,
@@ -1854,6 +1854,41 @@
1854
1854
  "description": "Final accrued request cost in USD; settled later",
1855
1855
  "title": "Billed Cost"
1856
1856
  },
1857
+ "draft": {
1858
+ "anyOf": [
1859
+ {
1860
+ "type": "boolean"
1861
+ },
1862
+ {
1863
+ "type": "null"
1864
+ }
1865
+ ],
1866
+ "title": "Draft"
1867
+ },
1868
+ "draft_expires_at": {
1869
+ "anyOf": [
1870
+ {
1871
+ "format": "date-time",
1872
+ "type": "string"
1873
+ },
1874
+ {
1875
+ "type": "null"
1876
+ }
1877
+ ],
1878
+ "title": "Draft Expires At"
1879
+ },
1880
+ "draft_from_task_id": {
1881
+ "anyOf": [
1882
+ {
1883
+ "format": "uuid",
1884
+ "type": "string"
1885
+ },
1886
+ {
1887
+ "type": "null"
1888
+ }
1889
+ ],
1890
+ "title": "Draft From Task Id"
1891
+ },
1857
1892
  "error": {
1858
1893
  "anyOf": [
1859
1894
  {
@@ -1903,6 +1938,17 @@
1903
1938
  ],
1904
1939
  "title": "Result"
1905
1940
  },
1941
+ "seed": {
1942
+ "anyOf": [
1943
+ {
1944
+ "type": "integer"
1945
+ },
1946
+ {
1947
+ "type": "null"
1948
+ }
1949
+ ],
1950
+ "title": "Seed"
1951
+ },
1906
1952
  "status": {
1907
1953
  "title": "Status",
1908
1954
  "type": "string"
@@ -3267,6 +3313,23 @@
3267
3313
  "title": "Content",
3268
3314
  "type": "array"
3269
3315
  },
3316
+ "draft": {
3317
+ "default": false,
3318
+ "title": "Draft",
3319
+ "type": "boolean"
3320
+ },
3321
+ "draft_from_task_id": {
3322
+ "anyOf": [
3323
+ {
3324
+ "format": "uuid",
3325
+ "type": "string"
3326
+ },
3327
+ {
3328
+ "type": "null"
3329
+ }
3330
+ ],
3331
+ "title": "Draft From Task Id"
3332
+ },
3270
3333
  "duration": {
3271
3334
  "default": 5,
3272
3335
  "description": "Video duration in seconds (4-30)",
@@ -3291,6 +3354,7 @@
3291
3354
  "type": "string"
3292
3355
  },
3293
3356
  "prompt": {
3357
+ "default": "",
3294
3358
  "title": "Prompt",
3295
3359
  "type": "string"
3296
3360
  },
@@ -3298,6 +3362,13 @@
3298
3362
  "$ref": "#/components/schemas/Seedance2VideoResolutionEnum",
3299
3363
  "default": "720p"
3300
3364
  },
3365
+ "seed": {
3366
+ "default": -1,
3367
+ "maximum": 4294967295.0,
3368
+ "minimum": -1.0,
3369
+ "title": "Seed",
3370
+ "type": "integer"
3371
+ },
3301
3372
  "video_from_task_id": {
3302
3373
  "anyOf": [
3303
3374
  {
@@ -3322,9 +3393,6 @@
3322
3393
  "title": "Video Url"
3323
3394
  }
3324
3395
  },
3325
- "required": [
3326
- "prompt"
3327
- ],
3328
3396
  "title": "Seedance2VideoEditRequest",
3329
3397
  "type": "object"
3330
3398
  },
@@ -3357,6 +3425,23 @@
3357
3425
  "title": "Content",
3358
3426
  "type": "array"
3359
3427
  },
3428
+ "draft": {
3429
+ "default": false,
3430
+ "title": "Draft",
3431
+ "type": "boolean"
3432
+ },
3433
+ "draft_from_task_id": {
3434
+ "anyOf": [
3435
+ {
3436
+ "format": "uuid",
3437
+ "type": "string"
3438
+ },
3439
+ {
3440
+ "type": "null"
3441
+ }
3442
+ ],
3443
+ "title": "Draft From Task Id"
3444
+ },
3360
3445
  "duration": {
3361
3446
  "default": 5,
3362
3447
  "description": "Video duration in seconds (4-30)",
@@ -3381,17 +3466,22 @@
3381
3466
  "type": "string"
3382
3467
  },
3383
3468
  "prompt": {
3469
+ "default": "",
3384
3470
  "title": "Prompt",
3385
3471
  "type": "string"
3386
3472
  },
3387
3473
  "resolution": {
3388
3474
  "$ref": "#/components/schemas/Seedance2VideoResolutionEnum",
3389
3475
  "default": "720p"
3476
+ },
3477
+ "seed": {
3478
+ "default": -1,
3479
+ "maximum": 4294967295.0,
3480
+ "minimum": -1.0,
3481
+ "title": "Seed",
3482
+ "type": "integer"
3390
3483
  }
3391
3484
  },
3392
- "required": [
3393
- "prompt"
3394
- ],
3395
3485
  "title": "Seedance2VideoGenRequest",
3396
3486
  "type": "object"
3397
3487
  },
@@ -689,16 +689,46 @@ class OmniVideoGenRequest(_StrictVideoPayload):
689
689
 
690
690
 
691
691
  class Seedance2BaseVideoRequest(_StrictVideoPayload):
692
- prompt: str
692
+ prompt: str = ""
693
693
  model: Literal["seedance2", "seedance2-mini", "seedance2.5"] = "seedance2"
694
694
  duration: int = Field(default=5, ge=4, le=30)
695
695
  resolution: Seedance2VideoResolution = "720p"
696
696
  aspect_ratio: Seedance2VideoAspectRatio = "16:9"
697
697
  generate_audio: bool = True
698
- callback_url: str | None = None
698
+ seed: int = Field(default=-1, ge=-1, le=4_294_967_295)
699
+ draft: bool = False
700
+ draft_from_task_id: UUID | None = None
701
+ callback_url: HttpUrl | None = None
702
+
703
+ @model_validator(mode="before")
704
+ @classmethod
705
+ def validate_draft_request(cls, values: Any) -> Any:
706
+ if not isinstance(values, dict):
707
+ return values
708
+ values = dict(values)
709
+ if values.get("draft_from_task_id"):
710
+ allowed = {"model", "draft_from_task_id", "resolution", "callback_url"}
711
+ if values.keys() - allowed:
712
+ raise ValueError(
713
+ "Draft finalization accepts only model, draft_from_task_id, "
714
+ "resolution and callback_url"
715
+ )
716
+ if values.get("model") != "seedance2.5":
717
+ raise ValueError("Draft finalization requires seedance2.5")
718
+ values.setdefault("resolution", "1080p")
719
+ if values["resolution"] != "1080p":
720
+ raise ValueError("Draft finalization supports only 1080p")
721
+ else:
722
+ if "prompt" not in values:
723
+ raise ValueError("prompt is required")
724
+ if values.get("draft"):
725
+ values.setdefault("resolution", "480p")
726
+ return values
699
727
 
700
728
  @model_validator(mode="after")
701
729
  def validate_model_resolution(self) -> "Seedance2BaseVideoRequest":
730
+ if self.draft and (self.model != "seedance2.5" or self.resolution != "480p"):
731
+ raise ValueError("Draft mode requires seedance2.5 and 480p")
702
732
  if self.model != "seedance2.5" and self.duration > 15:
703
733
  raise ValueError(f"{self.model} supports duration from 4 to 15 seconds")
704
734
  if self.model == "seedance2.5" and self.resolution == "4k":
@@ -1002,6 +1032,8 @@ class VideoEditPayload(VideoEditSourcePayload, Seedance2BaseVideoRequest):
1002
1032
  def validate_content(self) -> "VideoEditPayload":
1003
1033
  """Mirror the documented structural validation before making a request."""
1004
1034
 
1035
+ if self.draft_from_task_id:
1036
+ return self
1005
1037
  video_count = 0
1006
1038
  has_visual = bool(self.video_url or self.video_from_task_id)
1007
1039
  has_audio = False
@@ -1 +0,0 @@
1
- __version__ = "0.5.1"
File without changes