magic_hour 0.32.0__py3-none-any.whl → 0.33.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/environment.py CHANGED
@@ -6,7 +6,7 @@ class Environment(enum.Enum):
6
6
  """Pre-defined base URLs for the API"""
7
7
 
8
8
  ENVIRONMENT = "https://api.magichour.ai"
9
- MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.32.0"
9
+ MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.33.0"
10
10
 
11
11
 
12
12
  def _get_base_url(
@@ -9,7 +9,7 @@ Remove background from image. Each image costs 5 credits.
9
9
 
10
10
  | Parameter | Required | Description | Example |
11
11
  |-----------|:--------:|-------------|--------|
12
- | `assets` | ✓ | Provide the assets for background removal | `{"image_file_path": "api-assets/id/1234.png"}` |
12
+ | `assets` | ✓ | Provide the assets for background removal | `{"background_image_file_path": "api-assets/id/1234.png", "image_file_path": "api-assets/id/1234.png"}` |
13
13
  | `name` | ✗ | The name of image | `"Background Remover image"` |
14
14
 
15
15
  #### Synchronous Client
@@ -20,7 +20,10 @@ from os import getenv
20
20
 
21
21
  client = Client(token=getenv("API_TOKEN"))
22
22
  res = client.v1.image_background_remover.create(
23
- assets={"image_file_path": "api-assets/id/1234.png"},
23
+ assets={
24
+ "background_image_file_path": "api-assets/id/1234.png",
25
+ "image_file_path": "api-assets/id/1234.png",
26
+ },
24
27
  name="Background Remover image",
25
28
  )
26
29
 
@@ -34,7 +37,10 @@ from os import getenv
34
37
 
35
38
  client = AsyncClient(token=getenv("API_TOKEN"))
36
39
  res = await client.v1.image_background_remover.create(
37
- assets={"image_file_path": "api-assets/id/1234.png"},
40
+ assets={
41
+ "background_image_file_path": "api-assets/id/1234.png",
42
+ "image_file_path": "api-assets/id/1234.png",
43
+ },
38
44
  name="Background Remover image",
39
45
  )
40
46
 
@@ -46,7 +46,10 @@ class ImageBackgroundRemoverClient:
46
46
  Examples:
47
47
  ```py
48
48
  client.v1.image_background_remover.create(
49
- assets={"image_file_path": "api-assets/id/1234.png"},
49
+ assets={
50
+ "background_image_file_path": "api-assets/id/1234.png",
51
+ "image_file_path": "api-assets/id/1234.png",
52
+ },
50
53
  name="Background Remover image",
51
54
  )
52
55
  ```
@@ -100,7 +103,10 @@ class AsyncImageBackgroundRemoverClient:
100
103
  Examples:
101
104
  ```py
102
105
  await client.v1.image_background_remover.create(
103
- assets={"image_file_path": "api-assets/id/1234.png"},
106
+ assets={
107
+ "background_image_file_path": "api-assets/id/1234.png",
108
+ "image_file_path": "api-assets/id/1234.png",
109
+ },
104
110
  name="Background Remover image",
105
111
  )
106
112
  ```
@@ -1,4 +1,5 @@
1
1
  import pydantic
2
+ import typing
2
3
  import typing_extensions
3
4
 
4
5
 
@@ -7,9 +8,16 @@ class V1ImageBackgroundRemoverCreateBodyAssets(typing_extensions.TypedDict):
7
8
  Provide the assets for background removal
8
9
  """
9
10
 
11
+ background_image_file_path: typing_extensions.NotRequired[str]
12
+ """
13
+ The image used as the new background for the image_file_path. This image will be resized to match the image in image_file_path. Please make sure the resolution between the images are similar.
14
+
15
+ This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
16
+ """
17
+
10
18
  image_file_path: typing_extensions.Required[str]
11
19
  """
12
- The image used to generate the image. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
20
+ The image to remove the background. This value can be either the `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls), or the url of the file.
13
21
  """
14
22
 
15
23
 
@@ -23,6 +31,9 @@ class _SerializerV1ImageBackgroundRemoverCreateBodyAssets(pydantic.BaseModel):
23
31
  populate_by_name=True,
24
32
  )
25
33
 
34
+ background_image_file_path: typing.Optional[str] = pydantic.Field(
35
+ alias="background_image_file_path", default=None
36
+ )
26
37
  image_file_path: str = pydantic.Field(
27
38
  alias="image_file_path",
28
39
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic_hour
3
- Version: 0.32.0
3
+ Version: 0.33.0
4
4
  Summary: Python SDK for Magic Hour API
5
5
  Requires-Python: >=3.8,<4.0
6
6
  Classifier: Programming Language :: Python :: 3
@@ -10,7 +10,7 @@ magic_hour/core/request.py,sha256=_ikn8iZ2fU9Ubqnt7M9hdEnXGV6AAFHJYmDKBtxEY4I,52
10
10
  magic_hour/core/response.py,sha256=Sl7nPL2axmz7em_6d9TkFSnQQKUpalWaVWbPPWoXJgM,10180
11
11
  magic_hour/core/type_utils.py,sha256=4bU9WXnMXJ6YTtuqOMiB8t6Xw0RlfVWJ-IDBONlqEtQ,461
12
12
  magic_hour/core/utils.py,sha256=34SiC1vw2A0TkYHONgMA_d09soIIYiiBWRXCZGdwGIk,1669
13
- magic_hour/environment.py,sha256=RxoF7Qo-jAjff_KHXt_X0yIle-5RhUSpp9Rosq_ZzM0,535
13
+ magic_hour/environment.py,sha256=z-tM1LRdPAR-kU2aYz6vIvcTNY-1SjphMEhuZ9ta1Ac,535
14
14
  magic_hour/resources/v1/__init__.py,sha256=Aj0sjVcoijjQyieNBxv2_uewPYC2vO2UG-ehoBgCz5E,86
15
15
  magic_hour/resources/v1/ai_clothes_changer/README.md,sha256=x9cVTx9nHsyIutYjoUk1DeJg55cti6DAN_C-kBI_47Q,1564
16
16
  magic_hour/resources/v1/ai_clothes_changer/__init__.py,sha256=6W_Y2HxG2sDOBiJyzngK3Q2S3xfQgpK-j8xFRmBAhbQ,142
@@ -66,9 +66,9 @@ magic_hour/resources/v1/files/client.py,sha256=kJ636UbY_XZENwpqIKdz_2bxnr1P7TK9S
66
66
  magic_hour/resources/v1/files/upload_urls/README.md,sha256=iTF6QEbODlTPzszTZeQv681xG4XEJOIGPsgZSUlQLNg,2215
67
67
  magic_hour/resources/v1/files/upload_urls/__init__.py,sha256=hRp0s_emx-wib7z42V4L9VzYR9MQ3hnmS5bNv4QtfFM,118
68
68
  magic_hour/resources/v1/files/upload_urls/client.py,sha256=grAy3meSw8dP506IILG7GElGBKsYYZWhO-oBhoqfpkE,5113
69
- magic_hour/resources/v1/image_background_remover/README.md,sha256=xpAFf0JM6-kprkpZOM1FJdx-Z4k9bRtM-TsX3FC_jF8,1278
69
+ magic_hour/resources/v1/image_background_remover/README.md,sha256=KpVajFQTb-KFct0lX6HUwLoO9WAf9cYxakd5iwhsiWU,1492
70
70
  magic_hour/resources/v1/image_background_remover/__init__.py,sha256=Vb_e8zKEh7bdrq0q1175DqyOd1ptPBUIfSKSLFPBVU4,166
71
- magic_hour/resources/v1/image_background_remover/client.py,sha256=A6T1Kq3Lh4dsCVbBS9X-mmE9e5XK3fDkDAQQ1qjZTkA,3777
71
+ magic_hour/resources/v1/image_background_remover/client.py,sha256=PEYBUFtaHITyTa5d1OsMuvH-2djiDR8kCivxR7QoUDo,3983
72
72
  magic_hour/resources/v1/image_projects/README.md,sha256=iarr0Cu2a_ls4A6_NtjeDxNVhIsP5ZuFHMNidUh2oiE,2524
73
73
  magic_hour/resources/v1/image_projects/__init__.py,sha256=oBlV4e5IVYe8SclhoEy2VOYB53kKP2DORXwcztAwU3E,130
74
74
  magic_hour/resources/v1/image_projects/client.py,sha256=FbqvgvoLFcAjBtqgGtQZMNT8jG5f2bJH7Poxod446sw,5527
@@ -171,7 +171,7 @@ magic_hour/types/params/v1_face_swap_photo_create_body_assets_face_mappings_item
171
171
  magic_hour/types/params/v1_files_upload_urls_create_body.py,sha256=X6-ZcUqVVTM3w_y1HjU1zvicle5h0RvTK59yK3opZ-s,841
172
172
  magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py,sha256=I26O2Jx5_uhsCOrQCL_-wPeenu0rzhNwCDy0AEI6YuQ,962
173
173
  magic_hour/types/params/v1_image_background_remover_create_body.py,sha256=l3sb8UTXjie3gMd4ZJhHik-N1o3zaVzsZ7xDaS_uTG4,1063
174
- magic_hour/types/params/v1_image_background_remover_create_body_assets.py,sha256=aw9P_bdBTi8YMvgJxH8G0adwn1YswQzvtc0LgNAPQ8s,873
174
+ magic_hour/types/params/v1_image_background_remover_create_body_assets.py,sha256=h-ZnAWapH9l-TF5ndoKzY3J-xSVMnYlnhncvYFm2Nak,1497
175
175
  magic_hour/types/params/v1_image_to_video_create_body.py,sha256=HJdgEqafWBWKU0D5rhQudCXveVEEWTgys1BXiYn6rv4,3020
176
176
  magic_hour/types/params/v1_image_to_video_create_body_assets.py,sha256=J39Jv5Bv9bjMaskHzMfbO5VE6QWh-saN3eWOUPRtuRk,830
177
177
  magic_hour/types/params/v1_image_to_video_create_body_style.py,sha256=fBrqT9sLY7ljMpNjUUaD03fRPSt4FzQTvgOp0auL0wI,1669
@@ -184,7 +184,7 @@ magic_hour/types/params/v1_text_to_video_create_body_style.py,sha256=cEZO917hipE
184
184
  magic_hour/types/params/v1_video_to_video_create_body.py,sha256=Pgok6GUVHrpW6H3rwdVFA3O5YJvjgviCZkmmHddOSWo,3802
185
185
  magic_hour/types/params/v1_video_to_video_create_body_assets.py,sha256=_-6iA5d8ndka6iJWyWvlJwzRkQcmurJE6hkg-fDwBmQ,1531
186
186
  magic_hour/types/params/v1_video_to_video_create_body_style.py,sha256=RrDBhN2KQnCf9hGsnl3sAYvuFRsxth2JXfe5la0IYJg,5749
187
- magic_hour-0.32.0.dist-info/LICENSE,sha256=F3fxj7JXPgB2K0uj8YXRsVss4u-Dgt_-U3V4VXsivNI,1070
188
- magic_hour-0.32.0.dist-info/METADATA,sha256=xqVgiOvVFgrMyLfhcObuCqlaES0aKvicrwveCefwAx4,6092
189
- magic_hour-0.32.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
190
- magic_hour-0.32.0.dist-info/RECORD,,
187
+ magic_hour-0.33.0.dist-info/LICENSE,sha256=F3fxj7JXPgB2K0uj8YXRsVss4u-Dgt_-U3V4VXsivNI,1070
188
+ magic_hour-0.33.0.dist-info/METADATA,sha256=Qu3dUrAMK0QHxyTr_L_r31B2Dj6P3Aufnr6eYkdvZ5c,6092
189
+ magic_hour-0.33.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
190
+ magic_hour-0.33.0.dist-info/RECORD,,