everypixel-cli 0.5.0__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.0 → everypixel_cli-0.5.2}/CHANGELOG.md +9 -0
  2. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/PKG-INFO +41 -2
  3. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/README.md +40 -1
  4. everypixel_cli-0.5.2/src/everypixel_cli/__init__.py +1 -0
  5. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/application/models.py +2 -0
  6. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/application/services.py +139 -8
  7. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/cli.py +91 -3
  8. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/resources/openapi.json +623 -30
  9. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/schemas.py +87 -5
  10. everypixel_cli-0.5.0/src/everypixel_cli/__init__.py +0 -1
  11. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/.gitignore +0 -0
  12. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/LICENSE +0 -0
  13. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/pyproject.toml +0 -0
  14. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/__main__.py +0 -0
  15. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/application/__init__.py +0 -0
  16. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/application/chat.py +0 -0
  17. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/application/serialization.py +0 -0
  18. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/client.py +0 -0
  19. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/config.py +0 -0
  20. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/errors.py +0 -0
  21. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/files.py +0 -0
  22. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/mcp_server.py +0 -0
  23. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/openapi.py +0 -0
  24. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/output.py +0 -0
  25. {everypixel_cli-0.5.0 → everypixel_cli-0.5.2}/src/everypixel_cli/resources/__init__.py +0 -0
@@ -1,5 +1,14 @@
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
+
7
+ ## [0.5.1] - 2026-10-28
8
+
9
+ - Add account balance lookup and request cost estimation with `--estimate-cost`.
10
+ - Support Seedance generation with first/last frames or reference images.
11
+
3
12
  ## [0.5.0] - 2026-10-12
4
13
 
5
14
  - Add FLUX.3 images, Nano Banana 2.1, Nano Banana 2 Lite, and Seedream 5 Flash.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: everypixel-cli
3
- Version: 0.5.0
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
@@ -137,6 +137,26 @@ CLI falls back to its user configuration file when a keyring is unavailable;
137
137
 
138
138
  ## Commands
139
139
 
140
+ ### Balance and cost estimates
141
+
142
+ `everypixel balance` shows the account balance in USD and the owner's email.
143
+ The balance is settled; recent usage may not yet be reflected.
144
+
145
+ Add `--estimate-cost` to image, video, lipsync, transcription, or speech generation
146
+ commands to estimate the request's USD cost without creating a task or consuming
147
+ quota. Estimates include available free quota and personal rates; they do not
148
+ reserve funds. Task polling and downloads are skipped for estimate responses.
149
+
150
+ ```bash
151
+ everypixel balance --output-json
152
+ everypixel image generate "a lake" --estimate-cost
153
+ everypixel run image_generate --input prompt="a lake" --estimate-cost --output-json
154
+ ```
155
+
156
+ `run --estimate-cost` supports the same API operations, including background
157
+ removal, video matting, and video soundtrack generation. Chat, classic analysis,
158
+ and saved voice management endpoints do not support cost estimation.
159
+
140
160
  ### Images
141
161
 
142
162
  | Command | Description |
@@ -234,13 +254,32 @@ Input options depend on the model:
234
254
  - `first-last` accepts `--image` and `--last-image` for models that support frame pairs.
235
255
  - MiniMax and WAN 3.0 accept repeatable reference options, separately from frame inputs.
236
256
  Use `--reference-image`, `--reference-video`, and, for MiniMax, `--reference-audio`.
237
- - Gemini Omni generation accepts frame images or `--reference-image`, separately.
257
+ - Gemini Omni and Seedance generation accept frame images or `--reference-image`, separately.
258
+ Use `--model seedance2`, `seedance2-mini`, or `seedance2.5` with `from-image` or
259
+ `first-last`. Seedance 2.5 derives the aspect ratio from the first frame.
238
260
  - Grok Imagine 1.5 (`grok-imagine-1.5`) requires `--image` and supports 1080p.
239
261
  - Aleph 2 accepts repeatable `--keyframe` JSON; inspect `video edit --help` for its fields.
240
262
 
241
263
  See the [API documentation](https://labs.everypixel.com/docs) for each model's
242
264
  accepted inputs, resolutions, and durations.
243
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
+
244
283
  For upscaling, use `seedvr2` (the default) or a Topaz model such as `topaz-prob-4`:
245
284
 
246
285
  ```bash
@@ -103,6 +103,26 @@ CLI falls back to its user configuration file when a keyring is unavailable;
103
103
 
104
104
  ## Commands
105
105
 
106
+ ### Balance and cost estimates
107
+
108
+ `everypixel balance` shows the account balance in USD and the owner's email.
109
+ The balance is settled; recent usage may not yet be reflected.
110
+
111
+ Add `--estimate-cost` to image, video, lipsync, transcription, or speech generation
112
+ commands to estimate the request's USD cost without creating a task or consuming
113
+ quota. Estimates include available free quota and personal rates; they do not
114
+ reserve funds. Task polling and downloads are skipped for estimate responses.
115
+
116
+ ```bash
117
+ everypixel balance --output-json
118
+ everypixel image generate "a lake" --estimate-cost
119
+ everypixel run image_generate --input prompt="a lake" --estimate-cost --output-json
120
+ ```
121
+
122
+ `run --estimate-cost` supports the same API operations, including background
123
+ removal, video matting, and video soundtrack generation. Chat, classic analysis,
124
+ and saved voice management endpoints do not support cost estimation.
125
+
106
126
  ### Images
107
127
 
108
128
  | Command | Description |
@@ -200,13 +220,32 @@ Input options depend on the model:
200
220
  - `first-last` accepts `--image` and `--last-image` for models that support frame pairs.
201
221
  - MiniMax and WAN 3.0 accept repeatable reference options, separately from frame inputs.
202
222
  Use `--reference-image`, `--reference-video`, and, for MiniMax, `--reference-audio`.
203
- - Gemini Omni generation accepts frame images or `--reference-image`, separately.
223
+ - Gemini Omni and Seedance generation accept frame images or `--reference-image`, separately.
224
+ Use `--model seedance2`, `seedance2-mini`, or `seedance2.5` with `from-image` or
225
+ `first-last`. Seedance 2.5 derives the aspect ratio from the first frame.
204
226
  - Grok Imagine 1.5 (`grok-imagine-1.5`) requires `--image` and supports 1080p.
205
227
  - Aleph 2 accepts repeatable `--keyframe` JSON; inspect `video edit --help` for its fields.
206
228
 
207
229
  See the [API documentation](https://labs.everypixel.com/docs) for each model's
208
230
  accepted inputs, resolutions, and durations.
209
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
+
210
249
  For upscaling, use `seedvr2` (the default) or a Topaz model such as `topaz-prob-4`:
211
250
 
212
251
  ```bash
@@ -0,0 +1 @@
1
+ __version__ = "0.5.2"
@@ -26,6 +26,8 @@ class ExecutionOptions:
26
26
  compare=False,
27
27
  )
28
28
 
29
+ estimate_cost: bool = False
30
+
29
31
  @property
30
32
  def wait_for_result(self) -> bool:
31
33
  """Downloads always require a completed task."""
@@ -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,
@@ -66,6 +67,43 @@ from .models import (
66
67
  )
67
68
 
68
69
 
70
+ COST_ESTIMATE_ENDPOINTS = frozenset(
71
+ f"/v1/{name}"
72
+ for name in (
73
+ "image_vectorize",
74
+ "image_generate",
75
+ "image_upscale",
76
+ "image_remove_background",
77
+ "image_edit",
78
+ "image_edit_angles",
79
+ "image_edit_colors",
80
+ "video_lipsync",
81
+ "image_lipsync",
82
+ "video_generate",
83
+ "video_edit",
84
+ "video_upscale",
85
+ "video_matting",
86
+ "video_soundtrack",
87
+ "tts_design",
88
+ "tts_clone",
89
+ "tts_create",
90
+ "transcribe",
91
+ )
92
+ )
93
+
94
+
95
+ def estimate_cost_params(
96
+ endpoint: str, method: str, execution: ExecutionOptions
97
+ ) -> dict[str, Any]:
98
+ """Keep the quote flag in the query and reject unsupported operations."""
99
+
100
+ if not execution.estimate_cost:
101
+ return {}
102
+ if method.upper() != "POST" or endpoint not in COST_ESTIMATE_ENDPOINTS:
103
+ raise ValidationCLIError("estimate_cost is not supported for this endpoint")
104
+ return {"estimate_cost": 1}
105
+
106
+
69
107
  _VIDEO_GENERATE_ADAPTER: TypeAdapter[VideoGenerateRequest] = TypeAdapter(
70
108
  VideoGenerateRequest
71
109
  )
@@ -256,11 +294,14 @@ class OperationService:
256
294
  use_query = method == "GET" or (
257
295
  method == "DELETE" and request.endpoint == "/v1/tts_voice"
258
296
  )
297
+ params = estimate_cost_params(request.endpoint, method, request.execution)
298
+ if use_query:
299
+ params.update(payload)
259
300
  response = self.client.request(
260
301
  method,
261
302
  request.endpoint,
262
303
  json=None if use_query else payload,
263
- params=payload if use_query else None,
304
+ params=params or None,
264
305
  )
265
306
  if not isinstance(response, Mapping) or "task_id" not in response:
266
307
  return OperationResult(value=response)
@@ -370,13 +411,30 @@ class _VideoEditInputs:
370
411
  callback_url: str | None
371
412
  keyframes: list[str]
372
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)
373
431
 
374
432
 
375
433
  def _validated_video_edit_payload(values: Mapping[str, Any]) -> dict[str, Any]:
376
434
  validated = _VIDEO_EDIT_ADAPTER.validate_python(
377
435
  {key: value for key, value in values.items() if value is not None}
378
436
  )
379
- return validated.model_dump(mode="json", exclude_none=True)
437
+ return _serialize_video_payload(validated)
380
438
 
381
439
 
382
440
  def _reject_video_edit_options(model: str, options: Mapping[str, Any]) -> None:
@@ -391,7 +449,11 @@ def _reject_video_edit_options(model: str, options: Mapping[str, Any]) -> None:
391
449
 
392
450
 
393
451
  def _build_content_video_edit_payload(
394
- 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,
395
457
  ) -> dict[str, Any]:
396
458
  content: list[dict[str, Any]] = [{"type": "text", "text": inputs.prompt}]
397
459
  for value in inputs.images:
@@ -428,7 +490,8 @@ def _build_content_video_edit_payload(
428
490
  "aspect_ratio": inputs.aspect_ratio,
429
491
  "generate_audio": inputs.generate_audio,
430
492
  "callback_url": inputs.callback_url,
431
- "content": content,
493
+ **({"content": content} if include_content else {}),
494
+ **(provider_options or {}),
432
495
  }
433
496
  )
434
497
 
@@ -439,12 +502,25 @@ def _build_seedance_video_edit_payload(
439
502
  _reject_video_edit_options(
440
503
  inputs.model,
441
504
  {
442
- "seed": inputs.seed,
443
505
  "keyframe": inputs.keyframes,
444
506
  "public_figure_threshold": inputs.public_figure_threshold,
445
507
  },
446
508
  )
447
- 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
+ )
448
524
 
449
525
 
450
526
  def _build_kling_video_edit_payload(inputs: _VideoEditInputs) -> dict[str, Any]:
@@ -603,6 +679,8 @@ def build_video_edit_payload(
603
679
  task_id: str | None = None,
604
680
  model: str = "seedance2",
605
681
  seed: int | None = None,
682
+ draft: bool | None = None,
683
+ draft_from_task_id: str | None = None,
606
684
  keyframes: list[str] | None = None,
607
685
  public_figure_threshold: str | None = None,
608
686
  ) -> dict[str, Any]:
@@ -623,7 +701,13 @@ def build_video_edit_payload(
623
701
  callback_url=callback_url,
624
702
  keyframes=keyframes or [],
625
703
  public_figure_threshold=public_figure_threshold,
704
+ draft=draft,
705
+ draft_from_task_id=draft_from_task_id,
626
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
+ )
627
711
  builder = _VIDEO_EDIT_BUILDERS.get(model)
628
712
  if builder is None:
629
713
  raise ValidationCLIError(
@@ -687,6 +771,32 @@ def build_image_upscale_payload(**values: Any) -> dict[str, Any]:
687
771
  ).model_dump(exclude_none=True)
688
772
 
689
773
 
774
+ def _build_seedance_video_generate_payload(payload: dict[str, Any]) -> dict[str, Any]:
775
+ """Translate CLI frame and reference options into Seedance image content."""
776
+
777
+ content = []
778
+ for key, role in (("image_url", "first_frame"), ("image_last_url", "last_frame")):
779
+ url = payload.pop(key, None)
780
+ if url is not None:
781
+ content.append(
782
+ {"type": "image_url", "role": role, "image_url": {"url": url}}
783
+ )
784
+ for url in payload.pop("reference_image_urls", []):
785
+ content.append(
786
+ {"type": "image_url", "role": "reference_image", "image_url": {"url": url}}
787
+ )
788
+ if payload.get("draft_from_task_id") is not None and not content:
789
+ return payload
790
+ return {**payload, "content": content}
791
+
792
+
793
+ _VIDEO_GENERATE_BUILDERS = {
794
+ "seedance2": _build_seedance_video_generate_payload,
795
+ "seedance2-mini": _build_seedance_video_generate_payload,
796
+ "seedance2.5": _build_seedance_video_generate_payload,
797
+ }
798
+
799
+
690
800
  def build_video_generate_payload(**values: Any) -> dict[str, Any]:
691
801
  """Build text/image video generation payloads with typed model validation."""
692
802
 
@@ -725,10 +835,14 @@ def build_video_generate_payload(**values: Any) -> dict[str, Any]:
725
835
  payload["reference_audio_urls"] = [
726
836
  media_value(value) for value in reference_audios
727
837
  ]
838
+ model = payload.get("model")
839
+ builder = _VIDEO_GENERATE_BUILDERS.get(model) if isinstance(model, str) else None
840
+ if builder is not None:
841
+ payload = builder(payload)
728
842
  validated = _VIDEO_GENERATE_ADAPTER.validate_python(
729
843
  {key: value for key, value in payload.items() if value is not None}
730
844
  )
731
- return validated.model_dump(mode="json", exclude_none=True)
845
+ return _serialize_video_payload(validated)
732
846
 
733
847
 
734
848
  def build_video_upscale_payload(**values: Any) -> dict[str, Any]:
@@ -1047,7 +1161,7 @@ class ApplicationServices:
1047
1161
  def execute_video_generate(
1048
1162
  self,
1049
1163
  *,
1050
- prompt: str,
1164
+ prompt: str | None,
1051
1165
  model: str,
1052
1166
  duration: int | None,
1053
1167
  resolution: str | None,
@@ -1060,9 +1174,13 @@ class ApplicationServices:
1060
1174
  seed: int | None = None,
1061
1175
  generate_audio: bool | None = None,
1062
1176
  callback_url: str | None = None,
1177
+ draft: bool | None = None,
1178
+ draft_from_task_id: str | None = None,
1063
1179
  execution: ExecutionOptions,
1064
1180
  ) -> OperationResult:
1065
1181
  payload = build_video_generate_payload(
1182
+ draft=draft,
1183
+ draft_from_task_id=draft_from_task_id,
1066
1184
  prompt=prompt,
1067
1185
  model=model,
1068
1186
  duration=duration,
@@ -1100,10 +1218,14 @@ class ApplicationServices:
1100
1218
  callback_url: str | None,
1101
1219
  keyframes: list[str],
1102
1220
  public_figure_threshold: str | None,
1221
+ draft: bool | None = None,
1222
+ draft_from_task_id: str | None = None,
1103
1223
  execution: ExecutionOptions,
1104
1224
  task_id: str | None = None,
1105
1225
  ) -> OperationResult:
1106
1226
  payload = build_video_edit_payload(
1227
+ draft=draft,
1228
+ draft_from_task_id=draft_from_task_id,
1107
1229
  prompt=prompt,
1108
1230
  model=model,
1109
1231
  images=images,
@@ -1498,12 +1620,14 @@ class ApplicationServices:
1498
1620
  if path == "/v1/tts_voices" and resolved_method == "GET":
1499
1621
  TTSVoicesPayload.model_validate(payload)
1500
1622
  validate_payload_against_operation(operation, payload)
1623
+ params = estimate_cost_params(path, resolved_method, execution)
1501
1624
  if dry_run:
1502
1625
  return OperationResult(
1503
1626
  value={
1504
1627
  "method": resolved_method,
1505
1628
  "path": path,
1506
1629
  "body": payload,
1630
+ **({"params": params} if params else {}),
1507
1631
  "headers": {
1508
1632
  "Authorization": "Basic ***" if client_id_present else None
1509
1633
  },
@@ -1586,6 +1710,13 @@ class ApplicationServices:
1586
1710
  def execute_video_keywords(self, *, video: str) -> OperationResult:
1587
1711
  return self._execute_classic(path="/v1/video_keywords", media=video)
1588
1712
 
1713
+ def get_balance(self) -> OperationResult:
1714
+ """Return the authenticated owner's settled USD balance."""
1715
+
1716
+ return self._operations.execute(
1717
+ OperationRequest(endpoint="/v1/account/balance", method="GET", payload={})
1718
+ )
1719
+
1589
1720
  def check_auth(self) -> OperationResult:
1590
1721
  """Run an authentication check without a CLI dependency."""
1591
1722