magic_hour 0.23.0__py3-none-any.whl → 0.25.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.

Files changed (45) hide show
  1. magic_hour/client.py +2 -2
  2. magic_hour/core/__init__.py +6 -10
  3. magic_hour/core/auth.py +136 -96
  4. magic_hour/core/query.py +5 -6
  5. magic_hour/environment.py +1 -1
  6. magic_hour/resources/v1/ai_clothes_changer/README.md +17 -0
  7. magic_hour/resources/v1/ai_face_editor/README.md +18 -0
  8. magic_hour/resources/v1/ai_gif_generator/README.md +17 -0
  9. magic_hour/resources/v1/ai_headshot_generator/README.md +18 -0
  10. magic_hour/resources/v1/ai_image_editor/README.md +52 -0
  11. magic_hour/resources/v1/ai_image_editor/__init__.py +4 -0
  12. magic_hour/resources/v1/ai_image_editor/client.py +125 -0
  13. magic_hour/resources/v1/ai_image_generator/README.md +21 -2
  14. magic_hour/resources/v1/ai_image_generator/client.py +2 -2
  15. magic_hour/resources/v1/ai_image_upscaler/README.md +19 -0
  16. magic_hour/resources/v1/ai_meme_generator/README.md +17 -0
  17. magic_hour/resources/v1/ai_photo_editor/README.md +20 -0
  18. magic_hour/resources/v1/ai_qr_code_generator/README.md +18 -0
  19. magic_hour/resources/v1/ai_talking_photo/README.md +20 -0
  20. magic_hour/resources/v1/animation/README.md +22 -0
  21. magic_hour/resources/v1/client.py +6 -0
  22. magic_hour/resources/v1/face_swap/README.md +21 -0
  23. magic_hour/resources/v1/face_swap_photo/README.md +17 -0
  24. magic_hour/resources/v1/files/upload_urls/README.md +19 -4
  25. magic_hour/resources/v1/files/upload_urls/client.py +6 -8
  26. magic_hour/resources/v1/image_background_remover/README.md +17 -0
  27. magic_hour/resources/v1/image_projects/README.md +24 -0
  28. magic_hour/resources/v1/image_to_video/README.md +21 -0
  29. magic_hour/resources/v1/lip_sync/README.md +22 -0
  30. magic_hour/resources/v1/photo_colorizer/README.md +17 -0
  31. magic_hour/resources/v1/text_to_video/README.md +19 -0
  32. magic_hour/resources/v1/video_projects/README.md +24 -0
  33. magic_hour/resources/v1/video_to_video/README.md +23 -0
  34. magic_hour/types/models/__init__.py +2 -0
  35. magic_hour/types/models/v1_ai_image_editor_create_response.py +33 -0
  36. magic_hour/types/models/v1_image_projects_get_response.py +1 -1
  37. magic_hour/types/params/__init__.py +18 -0
  38. magic_hour/types/params/v1_ai_image_editor_create_body.py +49 -0
  39. magic_hour/types/params/v1_ai_image_editor_create_body_assets.py +28 -0
  40. magic_hour/types/params/v1_ai_image_editor_create_body_style.py +28 -0
  41. magic_hour/types/params/v1_ai_image_generator_create_body_style.py +83 -0
  42. {magic_hour-0.23.0.dist-info → magic_hour-0.25.0.dist-info}/METADATA +5 -1
  43. {magic_hour-0.23.0.dist-info → magic_hour-0.25.0.dist-info}/RECORD +45 -38
  44. {magic_hour-0.23.0.dist-info → magic_hour-0.25.0.dist-info}/LICENSE +0 -0
  45. {magic_hour-0.23.0.dist-info → magic_hour-0.25.0.dist-info}/WHEEL +0 -0
@@ -5,6 +5,12 @@ Permanently delete the rendered image. This action is not reversible, please be
5
5
 
6
6
  **API Endpoint**: `DELETE /v1/image-projects/{id}`
7
7
 
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `id` | ✓ | The id of the image project | `"cm6pvghix03bvyz0zwash6noj"` |
13
+
8
14
  #### Synchronous Client
9
15
 
10
16
  ```python
@@ -13,6 +19,7 @@ from os import getenv
13
19
 
14
20
  client = Client(token=getenv("API_TOKEN"))
15
21
  res = client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
22
+
16
23
  ```
17
24
 
18
25
  #### Asynchronous Client
@@ -23,6 +30,7 @@ from os import getenv
23
30
 
24
31
  client = AsyncClient(token=getenv("API_TOKEN"))
25
32
  res = await client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
33
+
26
34
  ```
27
35
 
28
36
  ### Get image details <a name="get"></a>
@@ -40,6 +48,12 @@ The image can be one of the following status
40
48
 
41
49
  **API Endpoint**: `GET /v1/image-projects/{id}`
42
50
 
51
+ #### Parameters
52
+
53
+ | Parameter | Required | Description | Example |
54
+ |-----------|:--------:|-------------|--------|
55
+ | `id` | ✓ | The id of the image project | `"cm6pvghix03bvyz0zwash6noj"` |
56
+
43
57
  #### Synchronous Client
44
58
 
45
59
  ```python
@@ -48,6 +62,7 @@ from os import getenv
48
62
 
49
63
  client = Client(token=getenv("API_TOKEN"))
50
64
  res = client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
65
+
51
66
  ```
52
67
 
53
68
  #### Asynchronous Client
@@ -58,4 +73,13 @@ from os import getenv
58
73
 
59
74
  client = AsyncClient(token=getenv("API_TOKEN"))
60
75
  res = await client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
76
+
61
77
  ```
78
+
79
+ #### Response
80
+
81
+ ##### Type
82
+ [V1ImageProjectsGetResponse](/magic_hour/types/models/v1_image_projects_get_response.py)
83
+
84
+ ##### Example
85
+ `{"created_at": "1970-01-01T00:00:00", "credits_charged": 5, "downloads": [{"expires_at": "2024-10-19T05:16:19.027Z", "url": "https://videos.magichour.ai/id/output.png"}], "enabled": True, "error": {"code": "no_source_face", "message": "Please use an image with a detectable face"}, "id": "clx7uu86w0a5qp55yxz315r6r", "image_count": 1, "name": "Example Name", "status": "complete", "total_frame_cost": 5, "type_": "AI_IMAGE"}`
@@ -8,6 +8,17 @@ Get more information about this mode at our [product page](/products/image-to-vi
8
8
 
9
9
  **API Endpoint**: `POST /v1/image-to-video`
10
10
 
11
+ #### Parameters
12
+
13
+ | Parameter | Required | Description | Example |
14
+ |-----------|:--------:|-------------|--------|
15
+ | `assets` | ✓ | Provide the assets for image-to-video. | `{"image_file_path": "api-assets/id/1234.png"}` |
16
+ | `end_seconds` | ✓ | The total duration of the output video in seconds. | `5.0` |
17
+ | `style` | ✓ | Attributed used to dictate the style of the output | `{"prompt": "a dog running"}` |
18
+ | `height` | ✗ | This field does not affect the output video's resolution. The video's orientation will match that of the input image. It is retained solely for backward compatibility and will be deprecated in the future. | `960` |
19
+ | `name` | ✗ | The name of video | `"Image To Video video"` |
20
+ | `width` | ✗ | This field does not affect the output video's resolution. The video's orientation will match that of the input image. It is retained solely for backward compatibility and will be deprecated in the future. | `512` |
21
+
11
22
  #### Synchronous Client
12
23
 
13
24
  ```python
@@ -23,6 +34,7 @@ res = client.v1.image_to_video.create(
23
34
  name="Image To Video video",
24
35
  width=512,
25
36
  )
37
+
26
38
  ```
27
39
 
28
40
  #### Asynchronous Client
@@ -40,4 +52,13 @@ res = await client.v1.image_to_video.create(
40
52
  name="Image To Video video",
41
53
  width=512,
42
54
  )
55
+
43
56
  ```
57
+
58
+ #### Response
59
+
60
+ ##### Type
61
+ [V1ImageToVideoCreateResponse](/magic_hour/types/models/v1_image_to_video_create_response.py)
62
+
63
+ ##### Example
64
+ `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -8,6 +8,18 @@ Get more information about this mode at our [product page](/products/lip-sync).
8
8
 
9
9
  **API Endpoint**: `POST /v1/lip-sync`
10
10
 
11
+ #### Parameters
12
+
13
+ | Parameter | Required | Description | Example |
14
+ |-----------|:--------:|-------------|--------|
15
+ | `assets` | ✓ | Provide the assets for lip-sync. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used | `{"audio_file_path": "api-assets/id/1234.mp3", "video_file_path": "api-assets/id/1234.mp4", "video_source": "file"}` |
16
+ | `end_seconds` | ✓ | The end time of the input video in seconds | `15.0` |
17
+ | `start_seconds` | ✓ | The start time of the input video in seconds | `0.0` |
18
+ | `height` | ✗ | Used to determine the dimensions of the output video. * If height is provided, width will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio. * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio. Note: if the video's original resolution is less than the maximum, the video will not be resized. See our [pricing page](https://magichour.ai/pricing) for more details. | `960` |
19
+ | `max_fps_limit` | ✗ | Defines the maximum FPS (frames per second) for the output video. If the input video's FPS is lower than this limit, the output video will retain the input FPS. This is useful for reducing unnecessary frame usage in scenarios where high FPS is not required. | `12.0` |
20
+ | `name` | ✗ | The name of video | `"Lip Sync video"` |
21
+ | `width` | ✗ | Used to determine the dimensions of the output video. * If width is provided, height will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio. * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio. Note: if the video's original resolution is less than the maximum, the video will not be resized. See our [pricing page](https://magichour.ai/pricing) for more details. | `512` |
22
+
11
23
  #### Synchronous Client
12
24
 
13
25
  ```python
@@ -28,6 +40,7 @@ res = client.v1.lip_sync.create(
28
40
  name="Lip Sync video",
29
41
  width=512,
30
42
  )
43
+
31
44
  ```
32
45
 
33
46
  #### Asynchronous Client
@@ -50,4 +63,13 @@ res = await client.v1.lip_sync.create(
50
63
  name="Lip Sync video",
51
64
  width=512,
52
65
  )
66
+
53
67
  ```
68
+
69
+ #### Response
70
+
71
+ ##### Type
72
+ [V1LipSyncCreateResponse](/magic_hour/types/models/v1_lip_sync_create_response.py)
73
+
74
+ ##### Example
75
+ `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -5,6 +5,13 @@ Colorize image. Each image costs 5 credits.
5
5
 
6
6
  **API Endpoint**: `POST /v1/photo-colorizer`
7
7
 
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `assets` | ✓ | Provide the assets for photo colorization | `{"image_file_path": "api-assets/id/1234.png"}` |
13
+ | `name` | ✗ | The name of image | `"Photo Colorizer image"` |
14
+
8
15
  #### Synchronous Client
9
16
 
10
17
  ```python
@@ -15,6 +22,7 @@ client = Client(token=getenv("API_TOKEN"))
15
22
  res = client.v1.photo_colorizer.create(
16
23
  assets={"image_file_path": "api-assets/id/1234.png"}, name="Photo Colorizer image"
17
24
  )
25
+
18
26
  ```
19
27
 
20
28
  #### Asynchronous Client
@@ -27,4 +35,13 @@ client = AsyncClient(token=getenv("API_TOKEN"))
27
35
  res = await client.v1.photo_colorizer.create(
28
36
  assets={"image_file_path": "api-assets/id/1234.png"}, name="Photo Colorizer image"
29
37
  )
38
+
30
39
  ```
40
+
41
+ #### Response
42
+
43
+ ##### Type
44
+ [V1PhotoColorizerCreateResponse](/magic_hour/types/models/v1_photo_colorizer_create_response.py)
45
+
46
+ ##### Example
47
+ `{"credits_charged": 5, "frame_cost": 5, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -8,6 +8,15 @@ Get more information about this mode at our [product page](/products/text-to-vid
8
8
 
9
9
  **API Endpoint**: `POST /v1/text-to-video`
10
10
 
11
+ #### Parameters
12
+
13
+ | Parameter | Required | Description | Example |
14
+ |-----------|:--------:|-------------|--------|
15
+ | `end_seconds` | ✓ | The total duration of the output video in seconds. | `5.0` |
16
+ | `orientation` | ✓ | Determines the orientation of the output video | `"landscape"` |
17
+ | `style` | ✓ | | `{"prompt": "a dog running"}` |
18
+ | `name` | ✗ | The name of video | `"Text To Video video"` |
19
+
11
20
  #### Synchronous Client
12
21
 
13
22
  ```python
@@ -21,6 +30,7 @@ res = client.v1.text_to_video.create(
21
30
  style={"prompt": "a dog running"},
22
31
  name="Text To Video video",
23
32
  )
33
+
24
34
  ```
25
35
 
26
36
  #### Asynchronous Client
@@ -36,4 +46,13 @@ res = await client.v1.text_to_video.create(
36
46
  style={"prompt": "a dog running"},
37
47
  name="Text To Video video",
38
48
  )
49
+
39
50
  ```
51
+
52
+ #### Response
53
+
54
+ ##### Type
55
+ [V1TextToVideoCreateResponse](/magic_hour/types/models/v1_text_to_video_create_response.py)
56
+
57
+ ##### Example
58
+ `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -5,6 +5,12 @@ Permanently delete the rendered video. This action is not reversible, please be
5
5
 
6
6
  **API Endpoint**: `DELETE /v1/video-projects/{id}`
7
7
 
8
+ #### Parameters
9
+
10
+ | Parameter | Required | Description | Example |
11
+ |-----------|:--------:|-------------|--------|
12
+ | `id` | ✓ | The id of the video project | `"cm6pvghix03bvyz0zwash6noj"` |
13
+
8
14
  #### Synchronous Client
9
15
 
10
16
  ```python
@@ -13,6 +19,7 @@ from os import getenv
13
19
 
14
20
  client = Client(token=getenv("API_TOKEN"))
15
21
  res = client.v1.video_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
22
+
16
23
  ```
17
24
 
18
25
  #### Asynchronous Client
@@ -23,6 +30,7 @@ from os import getenv
23
30
 
24
31
  client = AsyncClient(token=getenv("API_TOKEN"))
25
32
  res = await client.v1.video_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
33
+
26
34
  ```
27
35
 
28
36
  ### Get video details <a name="get"></a>
@@ -40,6 +48,12 @@ The video can be one of the following status
40
48
 
41
49
  **API Endpoint**: `GET /v1/video-projects/{id}`
42
50
 
51
+ #### Parameters
52
+
53
+ | Parameter | Required | Description | Example |
54
+ |-----------|:--------:|-------------|--------|
55
+ | `id` | ✓ | The id of the video | `"cm6pvghix03bvyz0zwash6noj"` |
56
+
43
57
  #### Synchronous Client
44
58
 
45
59
  ```python
@@ -48,6 +62,7 @@ from os import getenv
48
62
 
49
63
  client = Client(token=getenv("API_TOKEN"))
50
64
  res = client.v1.video_projects.get(id="cm6pvghix03bvyz0zwash6noj")
65
+
51
66
  ```
52
67
 
53
68
  #### Asynchronous Client
@@ -58,4 +73,13 @@ from os import getenv
58
73
 
59
74
  client = AsyncClient(token=getenv("API_TOKEN"))
60
75
  res = await client.v1.video_projects.get(id="cm6pvghix03bvyz0zwash6noj")
76
+
61
77
  ```
78
+
79
+ #### Response
80
+
81
+ ##### Type
82
+ [V1VideoProjectsGetResponse](/magic_hour/types/models/v1_video_projects_get_response.py)
83
+
84
+ ##### Example
85
+ `{"created_at": "1970-01-01T00:00:00", "credits_charged": 450, "download": {"expires_at": "2024-10-19T05:16:19.027Z", "url": "https://videos.magichour.ai/id/output.mp4"}, "downloads": [{"expires_at": "2024-10-19T05:16:19.027Z", "url": "https://videos.magichour.ai/id/output.mp4"}], "enabled": True, "end_seconds": 15.0, "error": {"code": "no_source_face", "message": "Please use an image with a detectable face"}, "fps": 30.0, "height": 960, "id": "clx7uu86w0a5qp55yxz315r6r", "name": "Example Name", "start_seconds": 0.0, "status": "complete", "total_frame_cost": 450, "type_": "FACE_SWAP", "width": 512}`
@@ -8,6 +8,19 @@ Get more information about this mode at our [product page](/products/video-to-vi
8
8
 
9
9
  **API Endpoint**: `POST /v1/video-to-video`
10
10
 
11
+ #### Parameters
12
+
13
+ | Parameter | Required | Description | Example |
14
+ |-----------|:--------:|-------------|--------|
15
+ | `assets` | ✓ | Provide the assets for video-to-video. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used | `{"video_file_path": "api-assets/id/1234.mp4", "video_source": "file"}` |
16
+ | `end_seconds` | ✓ | The end time of the input video in seconds | `15.0` |
17
+ | `start_seconds` | ✓ | The start time of the input video in seconds | `0.0` |
18
+ | `style` | ✓ | | `{"art_style": "3D Render", "model": "Absolute Reality", "prompt": "string", "prompt_type": "append_default", "version": "default"}` |
19
+ | `fps_resolution` | ✗ | Determines whether the resulting video will have the same frame per second as the original video, or half. * `FULL` - the result video will have the same FPS as the input video * `HALF` - the result video will have half the FPS as the input video | `"HALF"` |
20
+ | `height` | ✗ | Used to determine the dimensions of the output video. * If height is provided, width will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio. * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio. Note: if the video's original resolution is less than the maximum, the video will not be resized. See our [pricing page](https://magichour.ai/pricing) for more details. | `960` |
21
+ | `name` | ✗ | The name of video | `"Video To Video video"` |
22
+ | `width` | ✗ | Used to determine the dimensions of the output video. * If width is provided, height will also be required. The larger value between width and height will be used to determine the maximum output resolution while maintaining the original aspect ratio. * If both height and width are omitted, the video will be resized according to your subscription's maximum resolution, while preserving aspect ratio. Note: if the video's original resolution is less than the maximum, the video will not be resized. See our [pricing page](https://magichour.ai/pricing) for more details. | `512` |
23
+
11
24
  #### Synchronous Client
12
25
 
13
26
  ```python
@@ -31,6 +44,7 @@ res = client.v1.video_to_video.create(
31
44
  name="Video To Video video",
32
45
  width=512,
33
46
  )
47
+
34
48
  ```
35
49
 
36
50
  #### Asynchronous Client
@@ -56,4 +70,13 @@ res = await client.v1.video_to_video.create(
56
70
  name="Video To Video video",
57
71
  width=512,
58
72
  )
73
+
59
74
  ```
75
+
76
+ #### Response
77
+
78
+ ##### Type
79
+ [V1VideoToVideoCreateResponse](/magic_hour/types/models/v1_video_to_video_create_response.py)
80
+
81
+ ##### Example
82
+ `{"credits_charged": 450, "estimated_frame_cost": 450, "id": "clx7uu86w0a5qp55yxz315r6r"}`
@@ -4,6 +4,7 @@ from .v1_ai_gif_generator_create_response import V1AiGifGeneratorCreateResponse
4
4
  from .v1_ai_headshot_generator_create_response import (
5
5
  V1AiHeadshotGeneratorCreateResponse,
6
6
  )
7
+ from .v1_ai_image_editor_create_response import V1AiImageEditorCreateResponse
7
8
  from .v1_ai_image_generator_create_response import V1AiImageGeneratorCreateResponse
8
9
  from .v1_ai_image_upscaler_create_response import V1AiImageUpscalerCreateResponse
9
10
  from .v1_ai_meme_generator_create_response import V1AiMemeGeneratorCreateResponse
@@ -43,6 +44,7 @@ __all__ = [
43
44
  "V1AiFaceEditorCreateResponse",
44
45
  "V1AiGifGeneratorCreateResponse",
45
46
  "V1AiHeadshotGeneratorCreateResponse",
47
+ "V1AiImageEditorCreateResponse",
46
48
  "V1AiImageGeneratorCreateResponse",
47
49
  "V1AiImageUpscalerCreateResponse",
48
50
  "V1AiMemeGeneratorCreateResponse",
@@ -0,0 +1,33 @@
1
+ import pydantic
2
+
3
+
4
+ class V1AiImageEditorCreateResponse(pydantic.BaseModel):
5
+ """
6
+ Success
7
+ """
8
+
9
+ model_config = pydantic.ConfigDict(
10
+ arbitrary_types_allowed=True,
11
+ populate_by_name=True,
12
+ )
13
+
14
+ credits_charged: int = pydantic.Field(
15
+ alias="credits_charged",
16
+ )
17
+ """
18
+ The amount of credits deducted from your account to generate the image. We charge credits right when the request is made.
19
+
20
+ If an error occurred while generating the image(s), credits will be refunded and this field will be updated to include the refund.
21
+ """
22
+ frame_cost: int = pydantic.Field(
23
+ alias="frame_cost",
24
+ )
25
+ """
26
+ Deprecated: Previously represented the number of frames (original name of our credit system) used for image generation. Use 'credits_charged' instead.
27
+ """
28
+ id: str = pydantic.Field(
29
+ alias="id",
30
+ )
31
+ """
32
+ Unique ID of the image. This value can be used in the [get image project API](https://docs.magichour.ai/api-reference/image-projects/get-image-details) to fetch additional details such as status
33
+ """
@@ -80,5 +80,5 @@ class V1ImageProjectsGetResponse(pydantic.BaseModel):
80
80
  alias="type",
81
81
  )
82
82
  """
83
- The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER, AI_GIF
83
+ The type of the image project. Possible values are AI_HEADSHOT, AI_IMAGE, IMAGE_UPSCALER, FACE_SWAP, PHOTO_EDITOR, QR_CODE, BACKGROUND_REMOVER, CLOTHES_CHANGER, AI_MEME, FACE_EDITOR, PHOTO_COLORIZER, AI_GIF, AI_SELFIE, AI_IMAGE_EDITOR
84
84
  """
@@ -38,6 +38,18 @@ from .v1_ai_headshot_generator_create_body_style import (
38
38
  V1AiHeadshotGeneratorCreateBodyStyle,
39
39
  _SerializerV1AiHeadshotGeneratorCreateBodyStyle,
40
40
  )
41
+ from .v1_ai_image_editor_create_body import (
42
+ V1AiImageEditorCreateBody,
43
+ _SerializerV1AiImageEditorCreateBody,
44
+ )
45
+ from .v1_ai_image_editor_create_body_assets import (
46
+ V1AiImageEditorCreateBodyAssets,
47
+ _SerializerV1AiImageEditorCreateBodyAssets,
48
+ )
49
+ from .v1_ai_image_editor_create_body_style import (
50
+ V1AiImageEditorCreateBodyStyle,
51
+ _SerializerV1AiImageEditorCreateBodyStyle,
52
+ )
41
53
  from .v1_ai_image_generator_create_body import (
42
54
  V1AiImageGeneratorCreateBody,
43
55
  _SerializerV1AiImageGeneratorCreateBody,
@@ -200,6 +212,9 @@ __all__ = [
200
212
  "V1AiHeadshotGeneratorCreateBody",
201
213
  "V1AiHeadshotGeneratorCreateBodyAssets",
202
214
  "V1AiHeadshotGeneratorCreateBodyStyle",
215
+ "V1AiImageEditorCreateBody",
216
+ "V1AiImageEditorCreateBodyAssets",
217
+ "V1AiImageEditorCreateBodyStyle",
203
218
  "V1AiImageGeneratorCreateBody",
204
219
  "V1AiImageGeneratorCreateBodyStyle",
205
220
  "V1AiImageUpscalerCreateBody",
@@ -248,6 +263,9 @@ __all__ = [
248
263
  "_SerializerV1AiHeadshotGeneratorCreateBody",
249
264
  "_SerializerV1AiHeadshotGeneratorCreateBodyAssets",
250
265
  "_SerializerV1AiHeadshotGeneratorCreateBodyStyle",
266
+ "_SerializerV1AiImageEditorCreateBody",
267
+ "_SerializerV1AiImageEditorCreateBodyAssets",
268
+ "_SerializerV1AiImageEditorCreateBodyStyle",
251
269
  "_SerializerV1AiImageGeneratorCreateBody",
252
270
  "_SerializerV1AiImageGeneratorCreateBodyStyle",
253
271
  "_SerializerV1AiImageUpscalerCreateBody",
@@ -0,0 +1,49 @@
1
+ import pydantic
2
+ import typing
3
+ import typing_extensions
4
+
5
+ from .v1_ai_image_editor_create_body_assets import (
6
+ V1AiImageEditorCreateBodyAssets,
7
+ _SerializerV1AiImageEditorCreateBodyAssets,
8
+ )
9
+ from .v1_ai_image_editor_create_body_style import (
10
+ V1AiImageEditorCreateBodyStyle,
11
+ _SerializerV1AiImageEditorCreateBodyStyle,
12
+ )
13
+
14
+
15
+ class V1AiImageEditorCreateBody(typing_extensions.TypedDict):
16
+ """
17
+ V1AiImageEditorCreateBody
18
+ """
19
+
20
+ assets: typing_extensions.Required[V1AiImageEditorCreateBodyAssets]
21
+ """
22
+ Provide the assets for image edit
23
+ """
24
+
25
+ name: typing_extensions.NotRequired[str]
26
+ """
27
+ The name of image
28
+ """
29
+
30
+ style: typing_extensions.Required[V1AiImageEditorCreateBodyStyle]
31
+
32
+
33
+ class _SerializerV1AiImageEditorCreateBody(pydantic.BaseModel):
34
+ """
35
+ Serializer for V1AiImageEditorCreateBody handling case conversions
36
+ and file omissions as dictated by the API
37
+ """
38
+
39
+ model_config = pydantic.ConfigDict(
40
+ populate_by_name=True,
41
+ )
42
+
43
+ assets: _SerializerV1AiImageEditorCreateBodyAssets = pydantic.Field(
44
+ alias="assets",
45
+ )
46
+ name: typing.Optional[str] = pydantic.Field(alias="name", default=None)
47
+ style: _SerializerV1AiImageEditorCreateBodyStyle = pydantic.Field(
48
+ alias="style",
49
+ )
@@ -0,0 +1,28 @@
1
+ import pydantic
2
+ import typing_extensions
3
+
4
+
5
+ class V1AiImageEditorCreateBodyAssets(typing_extensions.TypedDict):
6
+ """
7
+ Provide the assets for image edit
8
+ """
9
+
10
+ image_file_path: typing_extensions.Required[str]
11
+ """
12
+ The image used in the edit. 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
+ """
14
+
15
+
16
+ class _SerializerV1AiImageEditorCreateBodyAssets(pydantic.BaseModel):
17
+ """
18
+ Serializer for V1AiImageEditorCreateBodyAssets handling case conversions
19
+ and file omissions as dictated by the API
20
+ """
21
+
22
+ model_config = pydantic.ConfigDict(
23
+ populate_by_name=True,
24
+ )
25
+
26
+ image_file_path: str = pydantic.Field(
27
+ alias="image_file_path",
28
+ )
@@ -0,0 +1,28 @@
1
+ import pydantic
2
+ import typing_extensions
3
+
4
+
5
+ class V1AiImageEditorCreateBodyStyle(typing_extensions.TypedDict):
6
+ """
7
+ V1AiImageEditorCreateBodyStyle
8
+ """
9
+
10
+ prompt: typing_extensions.Required[str]
11
+ """
12
+ The prompt used to edit the image.
13
+ """
14
+
15
+
16
+ class _SerializerV1AiImageEditorCreateBodyStyle(pydantic.BaseModel):
17
+ """
18
+ Serializer for V1AiImageEditorCreateBodyStyle handling case conversions
19
+ and file omissions as dictated by the API
20
+ """
21
+
22
+ model_config = pydantic.ConfigDict(
23
+ populate_by_name=True,
24
+ )
25
+
26
+ prompt: str = pydantic.Field(
27
+ alias="prompt",
28
+ )
@@ -1,4 +1,5 @@
1
1
  import pydantic
2
+ import typing
2
3
  import typing_extensions
3
4
 
4
5
 
@@ -12,6 +13,49 @@ class V1AiImageGeneratorCreateBodyStyle(typing_extensions.TypedDict):
12
13
  The prompt used for the image.
13
14
  """
14
15
 
16
+ tool: typing_extensions.NotRequired[
17
+ typing_extensions.Literal[
18
+ "ai-anime-generator",
19
+ "ai-art-generator",
20
+ "ai-background-generator",
21
+ "ai-character-generator",
22
+ "ai-face-generator",
23
+ "ai-fashion-generator",
24
+ "ai-icon-generator",
25
+ "ai-illustration-generator",
26
+ "ai-interior-design-generator",
27
+ "ai-landscape-generator",
28
+ "ai-logo-generator",
29
+ "ai-manga-generator",
30
+ "ai-outfit-generator",
31
+ "ai-pattern-generator",
32
+ "ai-photo-generator",
33
+ "ai-sketch-generator",
34
+ "ai-tattoo-generator",
35
+ "album-cover-generator",
36
+ "animated-characters-generator",
37
+ "architecture-generator",
38
+ "book-cover-generator",
39
+ "comic-book-generator",
40
+ "dark-fantasy-ai",
41
+ "disney-ai-generator",
42
+ "dnd-ai-art-generator",
43
+ "emoji-generator",
44
+ "fantasy-map-generator",
45
+ "general",
46
+ "graffiti-generator",
47
+ "movie-poster-generator",
48
+ "optical-illusion-generator",
49
+ "pokemon-generator",
50
+ "south-park-character-generator",
51
+ "superhero-generator",
52
+ "thumbnail-maker",
53
+ ]
54
+ ]
55
+ """
56
+ The art style to use for image generation. Defaults to 'general' if not provided.
57
+ """
58
+
15
59
 
16
60
  class _SerializerV1AiImageGeneratorCreateBodyStyle(pydantic.BaseModel):
17
61
  """
@@ -26,3 +70,42 @@ class _SerializerV1AiImageGeneratorCreateBodyStyle(pydantic.BaseModel):
26
70
  prompt: str = pydantic.Field(
27
71
  alias="prompt",
28
72
  )
73
+ tool: typing.Optional[
74
+ typing_extensions.Literal[
75
+ "ai-anime-generator",
76
+ "ai-art-generator",
77
+ "ai-background-generator",
78
+ "ai-character-generator",
79
+ "ai-face-generator",
80
+ "ai-fashion-generator",
81
+ "ai-icon-generator",
82
+ "ai-illustration-generator",
83
+ "ai-interior-design-generator",
84
+ "ai-landscape-generator",
85
+ "ai-logo-generator",
86
+ "ai-manga-generator",
87
+ "ai-outfit-generator",
88
+ "ai-pattern-generator",
89
+ "ai-photo-generator",
90
+ "ai-sketch-generator",
91
+ "ai-tattoo-generator",
92
+ "album-cover-generator",
93
+ "animated-characters-generator",
94
+ "architecture-generator",
95
+ "book-cover-generator",
96
+ "comic-book-generator",
97
+ "dark-fantasy-ai",
98
+ "disney-ai-generator",
99
+ "dnd-ai-art-generator",
100
+ "emoji-generator",
101
+ "fantasy-map-generator",
102
+ "general",
103
+ "graffiti-generator",
104
+ "movie-poster-generator",
105
+ "optical-illusion-generator",
106
+ "pokemon-generator",
107
+ "south-park-character-generator",
108
+ "superhero-generator",
109
+ "thumbnail-maker",
110
+ ]
111
+ ] = pydantic.Field(alias="tool", default=None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: magic_hour
3
- Version: 0.23.0
3
+ Version: 0.25.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
@@ -75,6 +75,10 @@ client = AsyncClient(token="my api key")
75
75
 
76
76
  * [create](magic_hour/resources/v1/ai_headshot_generator/README.md#create) - AI Headshots
77
77
 
78
+ ### [v1.ai_image_editor](magic_hour/resources/v1/ai_image_editor/README.md)
79
+
80
+ * [create](magic_hour/resources/v1/ai_image_editor/README.md#create) - AI Image Editor
81
+
78
82
  ### [v1.ai_image_generator](magic_hour/resources/v1/ai_image_generator/README.md)
79
83
 
80
84
  * [create](magic_hour/resources/v1/ai_image_generator/README.md#create) - AI Images