magic_hour 0.21.0__py3-none-any.whl → 0.22.0__py3-none-any.whl
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.
Potentially problematic release.
This version of magic_hour might be problematic. Click here for more details.
- magic_hour/client.py +3 -14
- magic_hour/core/base_client.py +32 -30
- magic_hour/environment.py +13 -1
- magic_hour/resources/v1/ai_clothes_changer/README.md +2 -3
- magic_hour/resources/v1/ai_clothes_changer/client.py +2 -2
- magic_hour/resources/v1/ai_face_editor/README.md +1 -2
- magic_hour/resources/v1/ai_gif_generator/README.md +2 -3
- magic_hour/resources/v1/ai_gif_generator/client.py +2 -2
- magic_hour/resources/v1/ai_headshot_generator/README.md +2 -3
- magic_hour/resources/v1/ai_headshot_generator/client.py +2 -2
- magic_hour/resources/v1/ai_image_generator/README.md +2 -3
- magic_hour/resources/v1/ai_image_generator/client.py +2 -2
- magic_hour/resources/v1/ai_image_upscaler/README.md +2 -3
- magic_hour/resources/v1/ai_image_upscaler/client.py +2 -2
- magic_hour/resources/v1/ai_meme_generator/README.md +2 -3
- magic_hour/resources/v1/ai_meme_generator/client.py +2 -2
- magic_hour/resources/v1/ai_photo_editor/README.md +2 -3
- magic_hour/resources/v1/ai_photo_editor/client.py +2 -2
- magic_hour/resources/v1/ai_qr_code_generator/README.md +2 -3
- magic_hour/resources/v1/ai_qr_code_generator/client.py +2 -2
- magic_hour/resources/v1/ai_talking_photo/README.md +1 -2
- magic_hour/resources/v1/animation/README.md +1 -2
- magic_hour/resources/v1/face_swap/README.md +1 -2
- magic_hour/resources/v1/face_swap_photo/README.md +2 -3
- magic_hour/resources/v1/face_swap_photo/client.py +2 -2
- magic_hour/resources/v1/files/upload_urls/README.md +1 -2
- magic_hour/resources/v1/image_background_remover/README.md +2 -3
- magic_hour/resources/v1/image_background_remover/client.py +2 -2
- magic_hour/resources/v1/image_projects/README.md +2 -4
- magic_hour/resources/v1/image_to_video/README.md +1 -2
- magic_hour/resources/v1/lip_sync/README.md +1 -2
- magic_hour/resources/v1/photo_colorizer/README.md +2 -3
- magic_hour/resources/v1/photo_colorizer/client.py +2 -2
- magic_hour/resources/v1/text_to_video/README.md +1 -2
- magic_hour/resources/v1/video_projects/README.md +2 -4
- magic_hour/resources/v1/video_to_video/README.md +1 -2
- magic_hour/types/models/v1_ai_clothes_changer_create_response.py +9 -1
- magic_hour/types/models/v1_ai_face_editor_create_response.py +9 -1
- magic_hour/types/models/v1_ai_gif_generator_create_response.py +9 -1
- magic_hour/types/models/v1_ai_headshot_generator_create_response.py +9 -1
- magic_hour/types/models/v1_ai_image_generator_create_response.py +9 -1
- magic_hour/types/models/v1_ai_image_upscaler_create_response.py +9 -1
- magic_hour/types/models/v1_ai_meme_generator_create_response.py +9 -1
- magic_hour/types/models/v1_ai_photo_editor_create_response.py +9 -1
- magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +9 -1
- magic_hour/types/models/v1_ai_talking_photo_create_response.py +11 -1
- magic_hour/types/models/v1_animation_create_response.py +11 -1
- magic_hour/types/models/v1_face_swap_create_response.py +12 -2
- magic_hour/types/models/v1_face_swap_photo_create_response.py +9 -1
- magic_hour/types/models/v1_image_background_remover_create_response.py +9 -1
- magic_hour/types/models/v1_image_projects_get_response.py +9 -1
- magic_hour/types/models/v1_image_to_video_create_response.py +11 -1
- magic_hour/types/models/v1_lip_sync_create_response.py +11 -1
- magic_hour/types/models/v1_photo_colorizer_create_response.py +9 -1
- magic_hour/types/models/v1_text_to_video_create_response.py +11 -1
- magic_hour/types/models/v1_video_projects_get_response.py +10 -0
- magic_hour/types/models/v1_video_to_video_create_response.py +11 -1
- magic_hour/types/params/v1_video_to_video_create_body_style.py +2 -0
- {magic_hour-0.21.0.dist-info → magic_hour-0.22.0.dist-info}/METADATA +1 -1
- {magic_hour-0.21.0.dist-info → magic_hour-0.22.0.dist-info}/RECORD +62 -62
- {magic_hour-0.21.0.dist-info → magic_hour-0.22.0.dist-info}/LICENSE +0 -0
- {magic_hour-0.21.0.dist-info → magic_hour-0.22.0.dist-info}/WHEEL +0 -0
magic_hour/client.py
CHANGED
|
@@ -2,7 +2,7 @@ import httpx
|
|
|
2
2
|
import typing
|
|
3
3
|
|
|
4
4
|
from magic_hour.core import AsyncBaseClient, AuthBearer, SyncBaseClient
|
|
5
|
-
from magic_hour.environment import Environment
|
|
5
|
+
from magic_hour.environment import Environment, _get_base_url
|
|
6
6
|
from magic_hour.resources.v1 import AsyncV1Client, V1Client
|
|
7
7
|
|
|
8
8
|
|
|
@@ -10,9 +10,9 @@ class Client:
|
|
|
10
10
|
def __init__(
|
|
11
11
|
self,
|
|
12
12
|
*,
|
|
13
|
-
base_url: typing.Optional[str] = None,
|
|
14
13
|
timeout: typing.Optional[float] = 60,
|
|
15
14
|
httpx_client: typing.Optional[httpx.Client] = None,
|
|
15
|
+
base_url: typing.Optional[str] = None,
|
|
16
16
|
environment: Environment = Environment.ENVIRONMENT,
|
|
17
17
|
token: typing.Optional[str] = None,
|
|
18
18
|
):
|
|
@@ -31,9 +31,9 @@ class AsyncClient:
|
|
|
31
31
|
def __init__(
|
|
32
32
|
self,
|
|
33
33
|
*,
|
|
34
|
-
base_url: typing.Optional[str] = None,
|
|
35
34
|
timeout: typing.Optional[float] = 60,
|
|
36
35
|
httpx_client: typing.Optional[httpx.AsyncClient] = None,
|
|
36
|
+
base_url: typing.Optional[str] = None,
|
|
37
37
|
environment: Environment = Environment.ENVIRONMENT,
|
|
38
38
|
token: typing.Optional[str] = None,
|
|
39
39
|
):
|
|
@@ -46,14 +46,3 @@ class AsyncClient:
|
|
|
46
46
|
)
|
|
47
47
|
self._base_client.register_auth("bearerAuth", AuthBearer(val=token))
|
|
48
48
|
self.v1 = AsyncV1Client(base_client=self._base_client)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def _get_base_url(
|
|
52
|
-
*, base_url: typing.Optional[str] = None, environment: Environment
|
|
53
|
-
) -> str:
|
|
54
|
-
if base_url is not None:
|
|
55
|
-
return base_url
|
|
56
|
-
elif environment is not None:
|
|
57
|
-
return environment.value
|
|
58
|
-
else:
|
|
59
|
-
raise Exception("Must include a base_url or environment arguments")
|
magic_hour/core/base_client.py
CHANGED
|
@@ -25,6 +25,7 @@ T = TypeVar(
|
|
|
25
25
|
"T",
|
|
26
26
|
bound=Union[object, None, str, "BaseModel", List[Any], Dict[str, Any], Any],
|
|
27
27
|
)
|
|
28
|
+
_DEFAULT_SERVICE_NAME = "__default_service__"
|
|
28
29
|
|
|
29
30
|
|
|
30
31
|
class BaseClient:
|
|
@@ -34,21 +35,16 @@ class BaseClient:
|
|
|
34
35
|
Serves as the foundation for both synchronous and asynchronous client implementations.
|
|
35
36
|
|
|
36
37
|
Attributes:
|
|
37
|
-
_base_url: Base URL for the API endpoint
|
|
38
38
|
_auths: Dictionary mapping auth provider IDs to AuthProvider instances
|
|
39
39
|
"""
|
|
40
40
|
|
|
41
|
-
def __init__(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
Args:
|
|
49
|
-
base_url: Base URL for the API endpoint
|
|
50
|
-
"""
|
|
51
|
-
self._base_url = base_url
|
|
41
|
+
def __init__(self, base_url: Union[str, Dict[str, str]]):
|
|
42
|
+
"""Initialize the base client"""
|
|
43
|
+
self._base_url = (
|
|
44
|
+
base_url
|
|
45
|
+
if isinstance(base_url, dict)
|
|
46
|
+
else {_DEFAULT_SERVICE_NAME: base_url}
|
|
47
|
+
)
|
|
52
48
|
self._auths: Dict[str, AuthProvider] = {}
|
|
53
49
|
|
|
54
50
|
def register_auth(self, auth_id: str, provider: AuthProvider):
|
|
@@ -71,15 +67,7 @@ class BaseClient:
|
|
|
71
67
|
}
|
|
72
68
|
return headers
|
|
73
69
|
|
|
74
|
-
def
|
|
75
|
-
"""Get the base URL for the API endpoint.
|
|
76
|
-
|
|
77
|
-
Returns:
|
|
78
|
-
Base URL string
|
|
79
|
-
"""
|
|
80
|
-
return self._base_url
|
|
81
|
-
|
|
82
|
-
def build_url(self, path: str) -> str:
|
|
70
|
+
def build_url(self, path: str, service_name: Optional[str] = None) -> str:
|
|
83
71
|
"""Build a complete URL by combining base URL and path.
|
|
84
72
|
|
|
85
73
|
Args:
|
|
@@ -88,13 +76,13 @@ class BaseClient:
|
|
|
88
76
|
Returns:
|
|
89
77
|
Complete URL string
|
|
90
78
|
"""
|
|
91
|
-
|
|
92
|
-
if
|
|
93
|
-
|
|
79
|
+
base_url = self._base_url.get(service_name or _DEFAULT_SERVICE_NAME, "")
|
|
80
|
+
if base_url.endswith("/"):
|
|
81
|
+
base_url = base_url[:-1]
|
|
94
82
|
if path.startswith("/"):
|
|
95
83
|
path = path[1:]
|
|
96
84
|
|
|
97
|
-
return f"{
|
|
85
|
+
return f"{base_url}/{path}"
|
|
98
86
|
|
|
99
87
|
def _cast_to_raw_response(
|
|
100
88
|
self, res: httpx.Response, cast_to: Union[Type[T], Any]
|
|
@@ -254,6 +242,7 @@ class BaseClient:
|
|
|
254
242
|
*,
|
|
255
243
|
method: str,
|
|
256
244
|
path: str,
|
|
245
|
+
service_name: Optional[str] = None,
|
|
257
246
|
auth_names: Optional[List[str]] = None,
|
|
258
247
|
query_params: Optional[QueryParams] = None,
|
|
259
248
|
headers: Optional[Dict[str, str]] = None,
|
|
@@ -283,7 +272,10 @@ class BaseClient:
|
|
|
283
272
|
Complete request configuration
|
|
284
273
|
"""
|
|
285
274
|
opts = request_options or default_request_options()
|
|
286
|
-
req_cfg: RequestConfig = {
|
|
275
|
+
req_cfg: RequestConfig = {
|
|
276
|
+
"method": method,
|
|
277
|
+
"url": self.build_url(path, service_name=service_name),
|
|
278
|
+
}
|
|
287
279
|
req_cfg = self._apply_auth(cfg=req_cfg, auth_names=auth_names or [])
|
|
288
280
|
req_cfg = self._apply_headers(
|
|
289
281
|
cfg=req_cfg, opts=opts, content_type=content_type, explicit_headers=headers
|
|
@@ -351,13 +343,12 @@ class SyncBaseClient(BaseClient):
|
|
|
351
343
|
def __init__(
|
|
352
344
|
self,
|
|
353
345
|
*,
|
|
354
|
-
base_url: str,
|
|
346
|
+
base_url: Union[str, Dict[str, str]],
|
|
355
347
|
httpx_client: httpx.Client,
|
|
356
348
|
):
|
|
357
349
|
"""Initialize the synchronous client.
|
|
358
350
|
|
|
359
351
|
Args:
|
|
360
|
-
base_url: Base URL for the API endpoint
|
|
361
352
|
httpx_client: Synchronous HTTPX client instance
|
|
362
353
|
"""
|
|
363
354
|
super().__init__(base_url=base_url)
|
|
@@ -369,6 +360,7 @@ class SyncBaseClient(BaseClient):
|
|
|
369
360
|
method: str,
|
|
370
361
|
path: str,
|
|
371
362
|
cast_to: Union[Type[T], Any],
|
|
363
|
+
service_name: Optional[str] = None,
|
|
372
364
|
auth_names: Optional[List[str]] = None,
|
|
373
365
|
query_params: Optional[QueryParams] = None,
|
|
374
366
|
headers: Optional[Dict[str, str]] = None,
|
|
@@ -386,6 +378,7 @@ class SyncBaseClient(BaseClient):
|
|
|
386
378
|
path: API endpoint path
|
|
387
379
|
cast_to: Type to cast the response to
|
|
388
380
|
auth_names: List of auth provider IDs
|
|
381
|
+
service_name: The name of the API service to make the request to
|
|
389
382
|
query_params: Query parameters
|
|
390
383
|
headers: Request headers
|
|
391
384
|
data: Form data
|
|
@@ -404,6 +397,7 @@ class SyncBaseClient(BaseClient):
|
|
|
404
397
|
req_cfg = self.build_request(
|
|
405
398
|
method=method,
|
|
406
399
|
path=path,
|
|
400
|
+
service_name=service_name,
|
|
407
401
|
auth_names=auth_names,
|
|
408
402
|
query_params=query_params,
|
|
409
403
|
headers=headers,
|
|
@@ -430,6 +424,7 @@ class SyncBaseClient(BaseClient):
|
|
|
430
424
|
method: str,
|
|
431
425
|
path: str,
|
|
432
426
|
cast_to: Union[Type[T], Any],
|
|
427
|
+
service_name: Optional[str] = None,
|
|
433
428
|
auth_names: Optional[List[str]] = None,
|
|
434
429
|
query_params: Optional[QueryParams] = None,
|
|
435
430
|
headers: Optional[Dict[str, str]] = None,
|
|
@@ -447,6 +442,7 @@ class SyncBaseClient(BaseClient):
|
|
|
447
442
|
path: API endpoint path
|
|
448
443
|
cast_to: Type to cast the response to
|
|
449
444
|
auth_names: List of auth provider IDs
|
|
445
|
+
service_name: The name of the API service to make the request to
|
|
450
446
|
query_params: Query parameters
|
|
451
447
|
headers: Request headers
|
|
452
448
|
data: Form data
|
|
@@ -465,6 +461,7 @@ class SyncBaseClient(BaseClient):
|
|
|
465
461
|
req_cfg = self.build_request(
|
|
466
462
|
method=method,
|
|
467
463
|
path=path,
|
|
464
|
+
service_name=service_name,
|
|
468
465
|
auth_names=auth_names,
|
|
469
466
|
query_params=query_params,
|
|
470
467
|
headers=headers,
|
|
@@ -489,13 +486,12 @@ class AsyncBaseClient(BaseClient):
|
|
|
489
486
|
def __init__(
|
|
490
487
|
self,
|
|
491
488
|
*,
|
|
492
|
-
base_url: str,
|
|
489
|
+
base_url: Union[str, Dict[str, str]],
|
|
493
490
|
httpx_client: httpx.AsyncClient,
|
|
494
491
|
):
|
|
495
492
|
"""Initialize the asynchronous client.
|
|
496
493
|
|
|
497
494
|
Args:
|
|
498
|
-
base_url: Base URL for the API endpoint
|
|
499
495
|
httpx_client: Asynchronous HTTPX client instance
|
|
500
496
|
"""
|
|
501
497
|
super().__init__(base_url=base_url)
|
|
@@ -507,6 +503,7 @@ class AsyncBaseClient(BaseClient):
|
|
|
507
503
|
method: str,
|
|
508
504
|
path: str,
|
|
509
505
|
cast_to: Union[Type[T], Any],
|
|
506
|
+
service_name: Optional[str] = None,
|
|
510
507
|
auth_names: Optional[List[str]] = None,
|
|
511
508
|
query_params: Optional[QueryParams] = None,
|
|
512
509
|
headers: Optional[Dict[str, str]] = None,
|
|
@@ -524,6 +521,7 @@ class AsyncBaseClient(BaseClient):
|
|
|
524
521
|
path: API endpoint path
|
|
525
522
|
cast_to: Type to cast the response to
|
|
526
523
|
auth_names: List of auth provider IDs
|
|
524
|
+
service_name: The name of the API service to make the request to
|
|
527
525
|
query_params: Query parameters
|
|
528
526
|
headers: Request headers
|
|
529
527
|
data: Form data
|
|
@@ -542,6 +540,7 @@ class AsyncBaseClient(BaseClient):
|
|
|
542
540
|
req_cfg = self.build_request(
|
|
543
541
|
method=method,
|
|
544
542
|
path=path,
|
|
543
|
+
service_name=service_name,
|
|
545
544
|
auth_names=auth_names,
|
|
546
545
|
query_params=query_params,
|
|
547
546
|
headers=headers,
|
|
@@ -568,6 +567,7 @@ class AsyncBaseClient(BaseClient):
|
|
|
568
567
|
method: str,
|
|
569
568
|
path: str,
|
|
570
569
|
cast_to: Union[Type[T], Any],
|
|
570
|
+
service_name: Optional[str] = None,
|
|
571
571
|
auth_names: Optional[List[str]] = None,
|
|
572
572
|
query_params: Optional[QueryParams] = None,
|
|
573
573
|
headers: Optional[Dict[str, str]] = None,
|
|
@@ -585,6 +585,7 @@ class AsyncBaseClient(BaseClient):
|
|
|
585
585
|
path: API endpoint path
|
|
586
586
|
cast_to: Type to cast the response to
|
|
587
587
|
auth_names: List of auth provider IDs
|
|
588
|
+
service_name: The name of the API service to make the request to
|
|
588
589
|
query_params: Query parameters
|
|
589
590
|
headers: Request headers
|
|
590
591
|
data: Form data
|
|
@@ -603,6 +604,7 @@ class AsyncBaseClient(BaseClient):
|
|
|
603
604
|
req_cfg = self.build_request(
|
|
604
605
|
method=method,
|
|
605
606
|
path=path,
|
|
607
|
+
service_name=service_name,
|
|
606
608
|
auth_names=auth_names,
|
|
607
609
|
query_params=query_params,
|
|
608
610
|
headers=headers,
|
magic_hour/environment.py
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import enum
|
|
2
|
+
import typing
|
|
2
3
|
|
|
3
4
|
|
|
4
5
|
class Environment(enum.Enum):
|
|
5
6
|
"""Pre-defined base URLs for the API"""
|
|
6
7
|
|
|
7
8
|
ENVIRONMENT = "https://api.magichour.ai"
|
|
8
|
-
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.
|
|
9
|
+
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.22.0"
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def _get_base_url(
|
|
13
|
+
*, base_url: typing.Optional[str] = None, environment: Environment
|
|
14
|
+
) -> str:
|
|
15
|
+
if base_url is not None:
|
|
16
|
+
return base_url
|
|
17
|
+
elif environment is not None:
|
|
18
|
+
return environment.value
|
|
19
|
+
else:
|
|
20
|
+
raise Exception("Must include a base_url or environment arguments")
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
AI Clothes Changer
|
|
2
|
+
### AI Clothes Changer <a name="create"></a>
|
|
4
3
|
|
|
5
|
-
Change outfits in photos in seconds with just a photo reference. Each photo costs 25
|
|
4
|
+
Change outfits in photos in seconds with just a photo reference. Each photo costs 25 credits.
|
|
6
5
|
|
|
7
6
|
**API Endpoint**: `POST /v1/ai-clothes-changer`
|
|
8
7
|
|
|
@@ -27,7 +27,7 @@ class AiClothesChangerClient:
|
|
|
27
27
|
"""
|
|
28
28
|
AI Clothes Changer
|
|
29
29
|
|
|
30
|
-
Change outfits in photos in seconds with just a photo reference. Each photo costs 25
|
|
30
|
+
Change outfits in photos in seconds with just a photo reference. Each photo costs 25 credits.
|
|
31
31
|
|
|
32
32
|
POST /v1/ai-clothes-changer
|
|
33
33
|
|
|
@@ -85,7 +85,7 @@ class AsyncAiClothesChangerClient:
|
|
|
85
85
|
"""
|
|
86
86
|
AI Clothes Changer
|
|
87
87
|
|
|
88
|
-
Change outfits in photos in seconds with just a photo reference. Each photo costs 25
|
|
88
|
+
Change outfits in photos in seconds with just a photo reference. Each photo costs 25 credits.
|
|
89
89
|
|
|
90
90
|
POST /v1/ai-clothes-changer
|
|
91
91
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
AI Face Editor
|
|
2
|
+
### AI Face Editor <a name="create"></a>
|
|
4
3
|
|
|
5
4
|
Edit facial features of an image using AI. Each edit costs 1 frame. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
6
5
|
|
|
@@ -27,7 +27,7 @@ class AiGifGeneratorClient:
|
|
|
27
27
|
"""
|
|
28
28
|
AI GIFs
|
|
29
29
|
|
|
30
|
-
Create an AI GIF. Each GIF costs 25
|
|
30
|
+
Create an AI GIF. Each GIF costs 25 credits.
|
|
31
31
|
|
|
32
32
|
POST /v1/ai-gif-generator
|
|
33
33
|
|
|
@@ -80,7 +80,7 @@ class AsyncAiGifGeneratorClient:
|
|
|
80
80
|
"""
|
|
81
81
|
AI GIFs
|
|
82
82
|
|
|
83
|
-
Create an AI GIF. Each GIF costs 25
|
|
83
|
+
Create an AI GIF. Each GIF costs 25 credits.
|
|
84
84
|
|
|
85
85
|
POST /v1/ai-gif-generator
|
|
86
86
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
AI Headshots
|
|
2
|
+
### AI Headshots <a name="create"></a>
|
|
4
3
|
|
|
5
|
-
Create an AI headshot. Each headshot costs 50
|
|
4
|
+
Create an AI headshot. Each headshot costs 50 credits.
|
|
6
5
|
|
|
7
6
|
**API Endpoint**: `POST /v1/ai-headshot-generator`
|
|
8
7
|
|
|
@@ -31,7 +31,7 @@ class AiHeadshotGeneratorClient:
|
|
|
31
31
|
"""
|
|
32
32
|
AI Headshots
|
|
33
33
|
|
|
34
|
-
Create an AI headshot. Each headshot costs 50
|
|
34
|
+
Create an AI headshot. Each headshot costs 50 credits.
|
|
35
35
|
|
|
36
36
|
POST /v1/ai-headshot-generator
|
|
37
37
|
|
|
@@ -90,7 +90,7 @@ class AsyncAiHeadshotGeneratorClient:
|
|
|
90
90
|
"""
|
|
91
91
|
AI Headshots
|
|
92
92
|
|
|
93
|
-
Create an AI headshot. Each headshot costs 50
|
|
93
|
+
Create an AI headshot. Each headshot costs 50 credits.
|
|
94
94
|
|
|
95
95
|
POST /v1/ai-headshot-generator
|
|
96
96
|
|
|
@@ -30,7 +30,7 @@ class AiImageGeneratorClient:
|
|
|
30
30
|
"""
|
|
31
31
|
AI Images
|
|
32
32
|
|
|
33
|
-
Create an AI image. Each image costs 5
|
|
33
|
+
Create an AI image. Each image costs 5 credits.
|
|
34
34
|
|
|
35
35
|
POST /v1/ai-image-generator
|
|
36
36
|
|
|
@@ -95,7 +95,7 @@ class AsyncAiImageGeneratorClient:
|
|
|
95
95
|
"""
|
|
96
96
|
AI Images
|
|
97
97
|
|
|
98
|
-
Create an AI image. Each image costs 5
|
|
98
|
+
Create an AI image. Each image costs 5 credits.
|
|
99
99
|
|
|
100
100
|
POST /v1/ai-image-generator
|
|
101
101
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
AI Image Upscaler
|
|
2
|
+
### AI Image Upscaler <a name="create"></a>
|
|
4
3
|
|
|
5
|
-
Upscale your image using AI. Each 2x upscale costs 50
|
|
4
|
+
Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits.
|
|
6
5
|
|
|
7
6
|
**API Endpoint**: `POST /v1/ai-image-upscaler`
|
|
8
7
|
|
|
@@ -29,7 +29,7 @@ class AiImageUpscalerClient:
|
|
|
29
29
|
"""
|
|
30
30
|
AI Image Upscaler
|
|
31
31
|
|
|
32
|
-
Upscale your image using AI. Each 2x upscale costs 50
|
|
32
|
+
Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits.
|
|
33
33
|
|
|
34
34
|
POST /v1/ai-image-upscaler
|
|
35
35
|
|
|
@@ -94,7 +94,7 @@ class AsyncAiImageUpscalerClient:
|
|
|
94
94
|
"""
|
|
95
95
|
AI Image Upscaler
|
|
96
96
|
|
|
97
|
-
Upscale your image using AI. Each 2x upscale costs 50
|
|
97
|
+
Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits.
|
|
98
98
|
|
|
99
99
|
POST /v1/ai-image-upscaler
|
|
100
100
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
AI Meme Generator
|
|
2
|
+
### AI Meme Generator <a name="create"></a>
|
|
4
3
|
|
|
5
|
-
Create an AI generated meme. Each meme costs 10
|
|
4
|
+
Create an AI generated meme. Each meme costs 10 credits.
|
|
6
5
|
|
|
7
6
|
**API Endpoint**: `POST /v1/ai-meme-generator`
|
|
8
7
|
|
|
@@ -27,7 +27,7 @@ class AiMemeGeneratorClient:
|
|
|
27
27
|
"""
|
|
28
28
|
AI Meme Generator
|
|
29
29
|
|
|
30
|
-
Create an AI generated meme. Each meme costs 10
|
|
30
|
+
Create an AI generated meme. Each meme costs 10 credits.
|
|
31
31
|
|
|
32
32
|
POST /v1/ai-meme-generator
|
|
33
33
|
|
|
@@ -85,7 +85,7 @@ class AsyncAiMemeGeneratorClient:
|
|
|
85
85
|
"""
|
|
86
86
|
AI Meme Generator
|
|
87
87
|
|
|
88
|
-
Create an AI generated meme. Each meme costs 10
|
|
88
|
+
Create an AI generated meme. Each meme costs 10 credits.
|
|
89
89
|
|
|
90
90
|
POST /v1/ai-meme-generator
|
|
91
91
|
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
AI Photo Editor
|
|
2
|
+
### AI Photo Editor <a name="create"></a>
|
|
4
3
|
|
|
5
4
|
> **NOTE**: this API is still in early development stages, and should be avoided. Please reach out to us if you're interested in this API.
|
|
6
5
|
|
|
7
|
-
Edit photo using AI. Each photo costs 10
|
|
6
|
+
Edit photo using AI. Each photo costs 10 credits.
|
|
8
7
|
|
|
9
8
|
**API Endpoint**: `POST /v1/ai-photo-editor`
|
|
10
9
|
|
|
@@ -34,7 +34,7 @@ class AiPhotoEditorClient:
|
|
|
34
34
|
|
|
35
35
|
> **NOTE**: this API is still in early development stages, and should be avoided. Please reach out to us if you're interested in this API.
|
|
36
36
|
|
|
37
|
-
Edit photo using AI. Each photo costs 10
|
|
37
|
+
Edit photo using AI. Each photo costs 10 credits.
|
|
38
38
|
|
|
39
39
|
POST /v1/ai-photo-editor
|
|
40
40
|
|
|
@@ -115,7 +115,7 @@ class AsyncAiPhotoEditorClient:
|
|
|
115
115
|
|
|
116
116
|
> **NOTE**: this API is still in early development stages, and should be avoided. Please reach out to us if you're interested in this API.
|
|
117
117
|
|
|
118
|
-
Edit photo using AI. Each photo costs 10
|
|
118
|
+
Edit photo using AI. Each photo costs 10 credits.
|
|
119
119
|
|
|
120
120
|
POST /v1/ai-photo-editor
|
|
121
121
|
|
|
@@ -28,7 +28,7 @@ class AiQrCodeGeneratorClient:
|
|
|
28
28
|
"""
|
|
29
29
|
AI QR Code
|
|
30
30
|
|
|
31
|
-
Create an AI QR code. Each QR code costs 20
|
|
31
|
+
Create an AI QR code. Each QR code costs 20 credits.
|
|
32
32
|
|
|
33
33
|
POST /v1/ai-qr-code-generator
|
|
34
34
|
|
|
@@ -85,7 +85,7 @@ class AsyncAiQrCodeGeneratorClient:
|
|
|
85
85
|
"""
|
|
86
86
|
AI QR Code
|
|
87
87
|
|
|
88
|
-
Create an AI QR code. Each QR code costs 20
|
|
88
|
+
Create an AI QR code. Each QR code costs 20 credits.
|
|
89
89
|
|
|
90
90
|
POST /v1/ai-qr-code-generator
|
|
91
91
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
Face Swap video
|
|
2
|
+
### Face Swap video <a name="create"></a>
|
|
4
3
|
|
|
5
4
|
Create a Face Swap video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
6
5
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
Face Swap Photo
|
|
2
|
+
### Face Swap Photo <a name="create"></a>
|
|
4
3
|
|
|
5
|
-
Create a face swap photo. Each photo costs 5
|
|
4
|
+
Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
6
5
|
|
|
7
6
|
**API Endpoint**: `POST /v1/face-swap-photo`
|
|
8
7
|
|
|
@@ -27,7 +27,7 @@ class FaceSwapPhotoClient:
|
|
|
27
27
|
"""
|
|
28
28
|
Face Swap Photo
|
|
29
29
|
|
|
30
|
-
Create a face swap photo. Each photo costs 5
|
|
30
|
+
Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
31
31
|
|
|
32
32
|
POST /v1/face-swap-photo
|
|
33
33
|
|
|
@@ -84,7 +84,7 @@ class AsyncFaceSwapPhotoClient:
|
|
|
84
84
|
"""
|
|
85
85
|
Face Swap Photo
|
|
86
86
|
|
|
87
|
-
Create a face swap photo. Each photo costs 5
|
|
87
|
+
Create a face swap photo. Each photo costs 5 credits. The height/width of the output image depends on your subscription. Please refer to our [pricing](/pricing) page for more details
|
|
88
88
|
|
|
89
89
|
POST /v1/face-swap-photo
|
|
90
90
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
Generate asset upload urls
|
|
2
|
+
### Generate asset upload urls <a name="create"></a>
|
|
4
3
|
|
|
5
4
|
Create a list of urls used to upload the assets needed to generate a video. Each video type has their own requirements on what assets are required. Please refer to the specific mode API for more details. The response array will be in the same order as the request body.
|
|
6
5
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
Image Background Remover
|
|
2
|
+
### Image Background Remover <a name="create"></a>
|
|
4
3
|
|
|
5
|
-
Remove background from image. Each image costs 5
|
|
4
|
+
Remove background from image. Each image costs 5 credits.
|
|
6
5
|
|
|
7
6
|
**API Endpoint**: `POST /v1/image-background-remover`
|
|
8
7
|
|
|
@@ -27,7 +27,7 @@ class ImageBackgroundRemoverClient:
|
|
|
27
27
|
"""
|
|
28
28
|
Image Background Remover
|
|
29
29
|
|
|
30
|
-
Remove background from image. Each image costs 5
|
|
30
|
+
Remove background from image. Each image costs 5 credits.
|
|
31
31
|
|
|
32
32
|
POST /v1/image-background-remover
|
|
33
33
|
|
|
@@ -81,7 +81,7 @@ class AsyncImageBackgroundRemoverClient:
|
|
|
81
81
|
"""
|
|
82
82
|
Image Background Remover
|
|
83
83
|
|
|
84
|
-
Remove background from image. Each image costs 5
|
|
84
|
+
Remove background from image. Each image costs 5 credits.
|
|
85
85
|
|
|
86
86
|
POST /v1/image-background-remover
|
|
87
87
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
Delete image
|
|
2
|
+
### Delete image <a name="delete"></a>
|
|
4
3
|
|
|
5
4
|
Permanently delete the rendered image. This action is not reversible, please be sure before deleting.
|
|
6
5
|
|
|
@@ -26,8 +25,7 @@ client = AsyncClient(token=getenv("API_TOKEN"))
|
|
|
26
25
|
res = await client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
|
|
27
26
|
```
|
|
28
27
|
|
|
29
|
-
###
|
|
30
|
-
Get image details
|
|
28
|
+
### Get image details <a name="get"></a>
|
|
31
29
|
|
|
32
30
|
Get the details of a image project. The `downloads` field will be empty unless the image was successfully rendered.
|
|
33
31
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
###
|
|
3
|
-
Image-to-Video
|
|
2
|
+
### Image-to-Video <a name="create"></a>
|
|
4
3
|
|
|
5
4
|
Create a Image To Video video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
6
5
|
|