magic_hour 0.24.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.
- magic_hour/client.py +2 -2
- magic_hour/core/__init__.py +6 -10
- magic_hour/core/auth.py +136 -96
- magic_hour/environment.py +1 -1
- magic_hour/resources/v1/ai_clothes_changer/README.md +13 -5
- magic_hour/resources/v1/ai_face_editor/README.md +14 -6
- magic_hour/resources/v1/ai_gif_generator/README.md +13 -5
- magic_hour/resources/v1/ai_headshot_generator/README.md +14 -6
- magic_hour/resources/v1/ai_image_editor/README.md +52 -0
- magic_hour/resources/v1/ai_image_editor/__init__.py +4 -0
- magic_hour/resources/v1/ai_image_editor/client.py +125 -0
- magic_hour/resources/v1/ai_image_generator/README.md +15 -7
- magic_hour/resources/v1/ai_image_upscaler/README.md +15 -7
- magic_hour/resources/v1/ai_meme_generator/README.md +13 -5
- magic_hour/resources/v1/ai_photo_editor/README.md +16 -8
- magic_hour/resources/v1/ai_qr_code_generator/README.md +14 -6
- magic_hour/resources/v1/ai_talking_photo/README.md +16 -8
- magic_hour/resources/v1/animation/README.md +18 -10
- magic_hour/resources/v1/client.py +6 -0
- magic_hour/resources/v1/face_swap/README.md +17 -9
- magic_hour/resources/v1/face_swap_photo/README.md +13 -5
- magic_hour/resources/v1/files/upload_urls/README.md +15 -8
- magic_hour/resources/v1/files/upload_urls/client.py +6 -8
- magic_hour/resources/v1/image_background_remover/README.md +13 -5
- magic_hour/resources/v1/image_projects/README.md +18 -10
- magic_hour/resources/v1/image_to_video/README.md +17 -9
- magic_hour/resources/v1/lip_sync/README.md +18 -10
- magic_hour/resources/v1/photo_colorizer/README.md +13 -5
- magic_hour/resources/v1/text_to_video/README.md +15 -7
- magic_hour/resources/v1/video_projects/README.md +18 -10
- magic_hour/resources/v1/video_to_video/README.md +19 -11
- magic_hour/types/models/__init__.py +2 -0
- magic_hour/types/models/v1_ai_image_editor_create_response.py +33 -0
- magic_hour/types/models/v1_image_projects_get_response.py +1 -1
- magic_hour/types/params/__init__.py +18 -0
- magic_hour/types/params/v1_ai_image_editor_create_body.py +49 -0
- magic_hour/types/params/v1_ai_image_editor_create_body_assets.py +28 -0
- magic_hour/types/params/v1_ai_image_editor_create_body_style.py +28 -0
- {magic_hour-0.24.0.dist-info → magic_hour-0.25.0.dist-info}/METADATA +5 -1
- {magic_hour-0.24.0.dist-info → magic_hour-0.25.0.dist-info}/RECORD +42 -35
- {magic_hour-0.24.0.dist-info → magic_hour-0.25.0.dist-info}/LICENSE +0 -0
- {magic_hour-0.24.0.dist-info → magic_hour-0.25.0.dist-info}/WHEEL +0 -0
|
@@ -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
|
|
@@ -44,13 +55,10 @@ res = await client.v1.image_to_video.create(
|
|
|
44
55
|
|
|
45
56
|
```
|
|
46
57
|
|
|
47
|
-
####
|
|
58
|
+
#### Response
|
|
48
59
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
| `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` |
|
|
55
|
-
| `name` | ✗ | The name of video | `"Image To Video video"` |
|
|
56
|
-
| `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` |
|
|
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
|
|
@@ -54,14 +66,10 @@ res = await client.v1.lip_sync.create(
|
|
|
54
66
|
|
|
55
67
|
```
|
|
56
68
|
|
|
57
|
-
####
|
|
69
|
+
#### Response
|
|
58
70
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
| `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` |
|
|
65
|
-
| `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` |
|
|
66
|
-
| `name` | ✗ | The name of video | `"Lip Sync video"` |
|
|
67
|
-
| `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` |
|
|
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
|
|
@@ -31,9 +38,10 @@ res = await client.v1.photo_colorizer.create(
|
|
|
31
38
|
|
|
32
39
|
```
|
|
33
40
|
|
|
34
|
-
####
|
|
41
|
+
#### Response
|
|
35
42
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
|
@@ -40,11 +49,10 @@ res = await client.v1.text_to_video.create(
|
|
|
40
49
|
|
|
41
50
|
```
|
|
42
51
|
|
|
43
|
-
####
|
|
52
|
+
#### Response
|
|
44
53
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
| `name` | ✗ | The name of video | `"Text To Video video"` |
|
|
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
|
|
@@ -27,12 +33,6 @@ res = await client.v1.video_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
|
|
|
27
33
|
|
|
28
34
|
```
|
|
29
35
|
|
|
30
|
-
#### Parameters
|
|
31
|
-
|
|
32
|
-
| Parameter | Required | Description | Example |
|
|
33
|
-
|-----------|:--------:|-------------|--------|
|
|
34
|
-
| `id` | ✓ | The id of the video project | `"cm6pvghix03bvyz0zwash6noj"` |
|
|
35
|
-
|
|
36
36
|
### Get video details <a name="get"></a>
|
|
37
37
|
|
|
38
38
|
Get the details of a video project. The `downloads` field will be empty unless the video was successfully rendered.
|
|
@@ -48,6 +48,12 @@ The video can be one of the following status
|
|
|
48
48
|
|
|
49
49
|
**API Endpoint**: `GET /v1/video-projects/{id}`
|
|
50
50
|
|
|
51
|
+
#### Parameters
|
|
52
|
+
|
|
53
|
+
| Parameter | Required | Description | Example |
|
|
54
|
+
|-----------|:--------:|-------------|--------|
|
|
55
|
+
| `id` | ✓ | The id of the video | `"cm6pvghix03bvyz0zwash6noj"` |
|
|
56
|
+
|
|
51
57
|
#### Synchronous Client
|
|
52
58
|
|
|
53
59
|
```python
|
|
@@ -70,8 +76,10 @@ res = await client.v1.video_projects.get(id="cm6pvghix03bvyz0zwash6noj")
|
|
|
70
76
|
|
|
71
77
|
```
|
|
72
78
|
|
|
73
|
-
####
|
|
79
|
+
#### Response
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
|
@@ -60,15 +73,10 @@ res = await client.v1.video_to_video.create(
|
|
|
60
73
|
|
|
61
74
|
```
|
|
62
75
|
|
|
63
|
-
####
|
|
76
|
+
#### Response
|
|
64
77
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
| `style` | ✓ | | `{"art_style": "3D Render", "model": "Absolute Reality", "prompt": "string", "prompt_type": "append_default", "version": "default"}` |
|
|
71
|
-
| `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"` |
|
|
72
|
-
| `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` |
|
|
73
|
-
| `name` | ✗ | The name of video | `"Video To Video video"` |
|
|
74
|
-
| `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` |
|
|
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,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: magic_hour
|
|
3
|
-
Version: 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
|