magic_hour 0.40.0__py3-none-any.whl → 0.44.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.
- magic_hour/README.md +2 -3
- magic_hour/environment.py +1 -1
- magic_hour/helpers/download.py +2 -0
- magic_hour/resources/v1/README.md +2 -3
- magic_hour/resources/v1/ai_clothes_changer/README.md +13 -14
- magic_hour/resources/v1/ai_face_editor/README.md +26 -27
- magic_hour/resources/v1/ai_gif_generator/README.md +12 -13
- magic_hour/resources/v1/ai_gif_generator/client.py +2 -2
- magic_hour/resources/v1/ai_headshot_generator/README.md +13 -14
- magic_hour/resources/v1/ai_headshot_generator/client.py +2 -2
- magic_hour/resources/v1/ai_image_editor/README.md +24 -17
- magic_hour/resources/v1/ai_image_editor/client.py +40 -10
- magic_hour/resources/v1/ai_image_generator/README.md +26 -18
- magic_hour/resources/v1/ai_image_generator/client.py +14 -6
- magic_hour/resources/v1/ai_image_upscaler/README.md +14 -15
- magic_hour/resources/v1/ai_meme_generator/README.md +12 -13
- magic_hour/resources/v1/ai_photo_editor/README.md +22 -23
- magic_hour/resources/v1/ai_qr_code_generator/README.md +13 -14
- magic_hour/resources/v1/ai_qr_code_generator/client.py +4 -4
- magic_hour/resources/v1/ai_talking_photo/README.md +16 -17
- magic_hour/resources/v1/ai_voice_cloner/README.md +62 -0
- magic_hour/resources/v1/ai_voice_cloner/__init__.py +4 -0
- magic_hour/resources/v1/ai_voice_cloner/client.py +272 -0
- magic_hour/resources/v1/ai_voice_generator/README.md +66 -10
- magic_hour/resources/v1/ai_voice_generator/client.py +122 -0
- magic_hour/resources/v1/animation/README.md +24 -25
- magic_hour/resources/v1/audio_projects/README.md +58 -13
- magic_hour/resources/v1/audio_projects/__init__.py +10 -2
- magic_hour/resources/v1/audio_projects/client.py +137 -0
- magic_hour/resources/v1/audio_projects/client_test.py +520 -0
- magic_hour/resources/v1/auto_subtitle_generator/README.md +15 -16
- magic_hour/resources/v1/client.py +6 -0
- magic_hour/resources/v1/face_detection/README.md +21 -20
- magic_hour/resources/v1/face_swap/README.md +23 -25
- magic_hour/resources/v1/face_swap/client.py +2 -2
- magic_hour/resources/v1/face_swap_photo/README.md +13 -14
- magic_hour/resources/v1/files/README.md +1 -5
- magic_hour/resources/v1/files/upload_urls/README.md +11 -10
- magic_hour/resources/v1/files/upload_urls/client.py +6 -4
- magic_hour/resources/v1/image_background_remover/README.md +11 -12
- magic_hour/resources/v1/image_projects/README.md +12 -16
- magic_hour/resources/v1/image_to_video/README.md +19 -21
- magic_hour/resources/v1/lip_sync/README.md +27 -21
- magic_hour/resources/v1/lip_sync/client.py +15 -0
- magic_hour/resources/v1/photo_colorizer/README.md +10 -11
- magic_hour/resources/v1/text_to_video/README.md +15 -17
- magic_hour/resources/v1/video_projects/README.md +12 -16
- magic_hour/resources/v1/video_to_video/README.md +24 -26
- magic_hour/types/models/__init__.py +2 -0
- magic_hour/types/models/v1_ai_voice_cloner_create_response.py +27 -0
- magic_hour/types/models/v1_audio_projects_get_response.py +1 -1
- magic_hour/types/models/v1_video_projects_get_response.py +1 -1
- magic_hour/types/params/__init__.py +26 -0
- magic_hour/types/params/v1_ai_image_editor_create_body_assets.py +18 -4
- magic_hour/types/params/v1_ai_image_editor_create_body_style.py +13 -0
- magic_hour/types/params/v1_ai_image_editor_generate_body_assets.py +12 -1
- magic_hour/types/params/v1_ai_image_generator_create_body_style.py +16 -0
- magic_hour/types/params/v1_ai_talking_photo_create_body_style.py +6 -4
- magic_hour/types/params/v1_ai_voice_cloner_create_body.py +49 -0
- magic_hour/types/params/v1_ai_voice_cloner_create_body_assets.py +33 -0
- magic_hour/types/params/v1_ai_voice_cloner_create_body_style.py +28 -0
- magic_hour/types/params/v1_ai_voice_cloner_generate_body_assets.py +28 -0
- magic_hour/types/params/v1_ai_voice_generator_create_body_style.py +382 -2
- magic_hour/types/params/v1_face_swap_create_body_style.py +1 -1
- magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +1 -1
- magic_hour/types/params/v1_lip_sync_create_body.py +12 -0
- magic_hour/types/params/v1_lip_sync_create_body_style.py +37 -0
- magic_hour/types/params/v1_video_to_video_create_body.py +1 -1
- magic_hour/types/params/v1_video_to_video_create_body_style.py +32 -4
- {magic_hour-0.40.0.dist-info → magic_hour-0.44.0.dist-info}/METADATA +77 -62
- {magic_hour-0.40.0.dist-info → magic_hour-0.44.0.dist-info}/RECORD +73 -63
- {magic_hour-0.40.0.dist-info → magic_hour-0.44.0.dist-info}/LICENSE +0 -0
- {magic_hour-0.40.0.dist-info → magic_hour-0.44.0.dist-info}/WHEEL +0 -0
|
@@ -57,7 +57,7 @@ class AiImageEditorClient:
|
|
|
57
57
|
Examples:
|
|
58
58
|
```py
|
|
59
59
|
response = client.v1.ai_image_editor.generate(
|
|
60
|
-
assets={"
|
|
60
|
+
assets={"image_file_paths": ["path/to/image.png", "path/to/image2.png"]},
|
|
61
61
|
style={"prompt": "Add a sunset background"},
|
|
62
62
|
name="Edited Image",
|
|
63
63
|
wait_for_completion=True,
|
|
@@ -69,8 +69,16 @@ class AiImageEditorClient:
|
|
|
69
69
|
|
|
70
70
|
file_client = FilesClient(base_client=self._base_client)
|
|
71
71
|
|
|
72
|
-
image_file_path
|
|
73
|
-
|
|
72
|
+
if "image_file_path" in assets:
|
|
73
|
+
image_file_path = assets["image_file_path"]
|
|
74
|
+
assets["image_file_path"] = file_client.upload_file(file=image_file_path)
|
|
75
|
+
|
|
76
|
+
if "image_file_paths" in assets:
|
|
77
|
+
for image_file_path in assets["image_file_paths"]:
|
|
78
|
+
assets["image_file_paths"] = [
|
|
79
|
+
file_client.upload_file(file=image_file_path)
|
|
80
|
+
for image_file_path in assets["image_file_paths"]
|
|
81
|
+
]
|
|
74
82
|
|
|
75
83
|
create_response = self.create(
|
|
76
84
|
assets=assets, style=style, name=name, request_options=request_options
|
|
@@ -120,8 +128,14 @@ class AiImageEditorClient:
|
|
|
120
128
|
Examples:
|
|
121
129
|
```py
|
|
122
130
|
client.v1.ai_image_editor.create(
|
|
123
|
-
assets={
|
|
124
|
-
|
|
131
|
+
assets={
|
|
132
|
+
"image_file_path": "api-assets/id/1234.png",
|
|
133
|
+
"image_file_paths": [
|
|
134
|
+
"api-assets/id/1234.png",
|
|
135
|
+
"api-assets/id/1235.png",
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
style={"model": "Nano Banana", "prompt": "Give me sunglasses"},
|
|
125
139
|
name="Ai Image Editor image",
|
|
126
140
|
)
|
|
127
141
|
```
|
|
@@ -177,7 +191,7 @@ class AsyncAiImageEditorClient:
|
|
|
177
191
|
Examples:
|
|
178
192
|
```py
|
|
179
193
|
response = await client.v1.ai_image_editor.generate(
|
|
180
|
-
assets={"
|
|
194
|
+
assets={"image_file_paths": ["path/to/image.png", "path/to/image2.png"]},
|
|
181
195
|
style={"prompt": "Add a sunset background"},
|
|
182
196
|
name="Edited Image",
|
|
183
197
|
wait_for_completion=True,
|
|
@@ -189,8 +203,18 @@ class AsyncAiImageEditorClient:
|
|
|
189
203
|
|
|
190
204
|
file_client = AsyncFilesClient(base_client=self._base_client)
|
|
191
205
|
|
|
192
|
-
image_file_path
|
|
193
|
-
|
|
206
|
+
if "image_file_path" in assets:
|
|
207
|
+
image_file_path = assets["image_file_path"]
|
|
208
|
+
assets["image_file_path"] = await file_client.upload_file(
|
|
209
|
+
file=image_file_path
|
|
210
|
+
)
|
|
211
|
+
|
|
212
|
+
if "image_file_paths" in assets:
|
|
213
|
+
for image_file_path in assets["image_file_paths"]:
|
|
214
|
+
assets["image_file_paths"] = [
|
|
215
|
+
await file_client.upload_file(file=image_file_path)
|
|
216
|
+
for image_file_path in assets["image_file_paths"]
|
|
217
|
+
]
|
|
194
218
|
|
|
195
219
|
create_response = await self.create(
|
|
196
220
|
assets=assets, style=style, name=name, request_options=request_options
|
|
@@ -240,8 +264,14 @@ class AsyncAiImageEditorClient:
|
|
|
240
264
|
Examples:
|
|
241
265
|
```py
|
|
242
266
|
await client.v1.ai_image_editor.create(
|
|
243
|
-
assets={
|
|
244
|
-
|
|
267
|
+
assets={
|
|
268
|
+
"image_file_path": "api-assets/id/1234.png",
|
|
269
|
+
"image_file_paths": [
|
|
270
|
+
"api-assets/id/1234.png",
|
|
271
|
+
"api-assets/id/1235.png",
|
|
272
|
+
],
|
|
273
|
+
},
|
|
274
|
+
style={"model": "Nano Banana", "prompt": "Give me sunglasses"},
|
|
245
275
|
name="Ai Image Editor image",
|
|
246
276
|
)
|
|
247
277
|
```
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## Module Functions
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
<!-- CUSTOM DOCS START -->
|
|
8
6
|
|
|
9
7
|
### Ai Image Generator Generate Workflow <a name="generate"></a>
|
|
@@ -63,22 +61,24 @@ res = await client.v1.ai_image_generator.generate(
|
|
|
63
61
|
```
|
|
64
62
|
|
|
65
63
|
<!-- CUSTOM DOCS END -->
|
|
66
|
-
### AI Images <a name="create"></a>
|
|
67
64
|
|
|
68
|
-
|
|
65
|
+
### AI Image Generator <a name="create"></a>
|
|
66
|
+
|
|
67
|
+
Create an AI image. Each standard image costs 5 credits. Pro quality images cost 30 credits.
|
|
69
68
|
|
|
70
69
|
**API Endpoint**: `POST /v1/ai-image-generator`
|
|
71
70
|
|
|
72
71
|
#### Parameters
|
|
73
72
|
|
|
74
|
-
| Parameter
|
|
75
|
-
|
|
76
|
-
| `image_count`
|
|
77
|
-
| `orientation`
|
|
78
|
-
| `style`
|
|
79
|
-
| `└─ prompt`
|
|
80
|
-
| `└─
|
|
81
|
-
| `
|
|
73
|
+
| Parameter | Required | Description | Example |
|
|
74
|
+
| ----------------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
75
|
+
| `image_count` | ✓ | Number of images to generate. | `1` |
|
|
76
|
+
| `orientation` | ✓ | The orientation of the output image(s). | `"landscape"` |
|
|
77
|
+
| `style` | ✓ | The art style to use for image generation. | `{"prompt": "Cool image", "quality_mode": "standard", "tool": "ai-anime-generator"}` |
|
|
78
|
+
| `└─ prompt` | ✓ | The prompt used for the image(s). | `"Cool image"` |
|
|
79
|
+
| `└─ quality_mode` | ✗ | Controls the quality of the generated image. Defaults to 'standard' if not specified. **Options:** - `standard` - Standard quality generation. Cost: 5 credits per image. - `pro` - Pro quality generation with enhanced details and quality. Cost: 30 credits per image. Note: Pro mode is available for users on Creator, Pro, or Business tier. | `"standard"` |
|
|
80
|
+
| `└─ tool` | ✗ | The art style to use for image generation. Defaults to 'general' if not provided. | `"ai-anime-generator"` |
|
|
81
|
+
| `name` | ✗ | The name of image. This value is mainly used for your own identification of the image. | `"Ai Image image"` |
|
|
82
82
|
|
|
83
83
|
#### Synchronous Client
|
|
84
84
|
|
|
@@ -90,10 +90,13 @@ client = Client(token=getenv("API_TOKEN"))
|
|
|
90
90
|
res = client.v1.ai_image_generator.create(
|
|
91
91
|
image_count=1,
|
|
92
92
|
orientation="landscape",
|
|
93
|
-
style={
|
|
93
|
+
style={
|
|
94
|
+
"prompt": "Cool image",
|
|
95
|
+
"quality_mode": "standard",
|
|
96
|
+
"tool": "ai-anime-generator",
|
|
97
|
+
},
|
|
94
98
|
name="Ai Image image",
|
|
95
99
|
)
|
|
96
|
-
|
|
97
100
|
```
|
|
98
101
|
|
|
99
102
|
#### Asynchronous Client
|
|
@@ -106,18 +109,23 @@ client = AsyncClient(token=getenv("API_TOKEN"))
|
|
|
106
109
|
res = await client.v1.ai_image_generator.create(
|
|
107
110
|
image_count=1,
|
|
108
111
|
orientation="landscape",
|
|
109
|
-
style={
|
|
112
|
+
style={
|
|
113
|
+
"prompt": "Cool image",
|
|
114
|
+
"quality_mode": "standard",
|
|
115
|
+
"tool": "ai-anime-generator",
|
|
116
|
+
},
|
|
110
117
|
name="Ai Image image",
|
|
111
118
|
)
|
|
112
|
-
|
|
113
119
|
```
|
|
114
120
|
|
|
115
121
|
#### Response
|
|
116
122
|
|
|
117
123
|
##### Type
|
|
124
|
+
|
|
118
125
|
[V1AiImageGeneratorCreateResponse](/magic_hour/types/models/v1_ai_image_generator_create_response.py)
|
|
119
126
|
|
|
120
127
|
##### Example
|
|
121
|
-
`{"credits_charged": 5, "frame_cost": 5, "id": "cuid-example"}`
|
|
122
|
-
|
|
123
128
|
|
|
129
|
+
```python
|
|
130
|
+
{"credits_charged": 5, "frame_cost": 5, "id": "cuid-example"}
|
|
131
|
+
```
|
|
@@ -101,9 +101,9 @@ class AiImageGeneratorClient:
|
|
|
101
101
|
request_options: typing.Optional[RequestOptions] = None,
|
|
102
102
|
) -> models.V1AiImageGeneratorCreateResponse:
|
|
103
103
|
"""
|
|
104
|
-
AI
|
|
104
|
+
AI Image Generator
|
|
105
105
|
|
|
106
|
-
Create an AI image. Each image costs 5 credits.
|
|
106
|
+
Create an AI image. Each standard image costs 5 credits. Pro quality images cost 30 credits.
|
|
107
107
|
|
|
108
108
|
POST /v1/ai-image-generator
|
|
109
109
|
|
|
@@ -126,7 +126,11 @@ class AiImageGeneratorClient:
|
|
|
126
126
|
client.v1.ai_image_generator.create(
|
|
127
127
|
image_count=1,
|
|
128
128
|
orientation="landscape",
|
|
129
|
-
style={
|
|
129
|
+
style={
|
|
130
|
+
"prompt": "Cool image",
|
|
131
|
+
"quality_mode": "standard",
|
|
132
|
+
"tool": "ai-anime-generator",
|
|
133
|
+
},
|
|
130
134
|
name="Ai Image image",
|
|
131
135
|
)
|
|
132
136
|
```
|
|
@@ -231,9 +235,9 @@ class AsyncAiImageGeneratorClient:
|
|
|
231
235
|
request_options: typing.Optional[RequestOptions] = None,
|
|
232
236
|
) -> models.V1AiImageGeneratorCreateResponse:
|
|
233
237
|
"""
|
|
234
|
-
AI
|
|
238
|
+
AI Image Generator
|
|
235
239
|
|
|
236
|
-
Create an AI image. Each image costs 5 credits.
|
|
240
|
+
Create an AI image. Each standard image costs 5 credits. Pro quality images cost 30 credits.
|
|
237
241
|
|
|
238
242
|
POST /v1/ai-image-generator
|
|
239
243
|
|
|
@@ -256,7 +260,11 @@ class AsyncAiImageGeneratorClient:
|
|
|
256
260
|
await client.v1.ai_image_generator.create(
|
|
257
261
|
image_count=1,
|
|
258
262
|
orientation="landscape",
|
|
259
|
-
style={
|
|
263
|
+
style={
|
|
264
|
+
"prompt": "Cool image",
|
|
265
|
+
"quality_mode": "standard",
|
|
266
|
+
"tool": "ai-anime-generator",
|
|
267
|
+
},
|
|
260
268
|
name="Ai Image image",
|
|
261
269
|
)
|
|
262
270
|
```
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## Module Functions
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
<!-- CUSTOM DOCS START -->
|
|
8
6
|
|
|
9
7
|
### Ai Image Upscaler Generate Workflow <a name="generate"></a>
|
|
@@ -63,6 +61,7 @@ res = await client.v1.ai_image_upscaler.generate(
|
|
|
63
61
|
```
|
|
64
62
|
|
|
65
63
|
<!-- CUSTOM DOCS END -->
|
|
64
|
+
|
|
66
65
|
### AI Image Upscaler <a name="create"></a>
|
|
67
66
|
|
|
68
67
|
Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale costs 200 credits.
|
|
@@ -71,15 +70,15 @@ Upscale your image using AI. Each 2x upscale costs 50 credits, and 4x upscale co
|
|
|
71
70
|
|
|
72
71
|
#### Parameters
|
|
73
72
|
|
|
74
|
-
| Parameter
|
|
75
|
-
|
|
76
|
-
| `assets`
|
|
77
|
-
| `└─ image_file_path` |
|
|
78
|
-
| `scale_factor`
|
|
79
|
-
| `style`
|
|
80
|
-
| `└─ enhancement`
|
|
81
|
-
| `└─ prompt`
|
|
82
|
-
| `name`
|
|
73
|
+
| Parameter | Required | Description | Example |
|
|
74
|
+
| -------------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------- |
|
|
75
|
+
| `assets` | ✓ | Provide the assets for upscaling | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
76
|
+
| `└─ image_file_path` | ✓ | The image to upscale. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more. | `"api-assets/id/1234.png"` |
|
|
77
|
+
| `scale_factor` | ✓ | How much to scale the image. Must be either 2 or 4. Note: 4x upscale is only available on Creator, Pro, or Business tier. | `2.0` |
|
|
78
|
+
| `style` | ✓ | | `{"enhancement": "Balanced"}` |
|
|
79
|
+
| `└─ enhancement` | ✓ | | `"Balanced"` |
|
|
80
|
+
| `└─ prompt` | ✗ | A prompt to guide the final image. This value is ignored if `enhancement` is not Creative | `"string"` |
|
|
81
|
+
| `name` | ✗ | The name of image. This value is mainly used for your own identification of the image. | `"Image Upscaler image"` |
|
|
83
82
|
|
|
84
83
|
#### Synchronous Client
|
|
85
84
|
|
|
@@ -94,7 +93,6 @@ res = client.v1.ai_image_upscaler.create(
|
|
|
94
93
|
style={"enhancement": "Balanced"},
|
|
95
94
|
name="Image Upscaler image",
|
|
96
95
|
)
|
|
97
|
-
|
|
98
96
|
```
|
|
99
97
|
|
|
100
98
|
#### Asynchronous Client
|
|
@@ -110,15 +108,16 @@ res = await client.v1.ai_image_upscaler.create(
|
|
|
110
108
|
style={"enhancement": "Balanced"},
|
|
111
109
|
name="Image Upscaler image",
|
|
112
110
|
)
|
|
113
|
-
|
|
114
111
|
```
|
|
115
112
|
|
|
116
113
|
#### Response
|
|
117
114
|
|
|
118
115
|
##### Type
|
|
116
|
+
|
|
119
117
|
[V1AiImageUpscalerCreateResponse](/magic_hour/types/models/v1_ai_image_upscaler_create_response.py)
|
|
120
118
|
|
|
121
119
|
##### Example
|
|
122
|
-
`{"credits_charged": 50, "frame_cost": 50, "id": "cuid-example"}`
|
|
123
|
-
|
|
124
120
|
|
|
121
|
+
```python
|
|
122
|
+
{"credits_charged": 50, "frame_cost": 50, "id": "cuid-example"}
|
|
123
|
+
```
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## Module Functions
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
<!-- CUSTOM DOCS START -->
|
|
8
6
|
|
|
9
7
|
### Ai Meme Generator Generate Workflow <a name="generate"></a>
|
|
@@ -67,6 +65,7 @@ res = await client.v1.ai_meme_generator.generate(
|
|
|
67
65
|
```
|
|
68
66
|
|
|
69
67
|
<!-- CUSTOM DOCS END -->
|
|
68
|
+
|
|
70
69
|
### AI Meme Generator <a name="create"></a>
|
|
71
70
|
|
|
72
71
|
Create an AI generated meme. Each meme costs 10 credits.
|
|
@@ -75,13 +74,13 @@ Create an AI generated meme. Each meme costs 10 credits.
|
|
|
75
74
|
|
|
76
75
|
#### Parameters
|
|
77
76
|
|
|
78
|
-
| Parameter
|
|
79
|
-
|
|
80
|
-
| `style`
|
|
81
|
-
| `└─ search_web` |
|
|
82
|
-
| `└─ template`
|
|
83
|
-
| `└─ topic`
|
|
84
|
-
| `name`
|
|
77
|
+
| Parameter | Required | Description | Example |
|
|
78
|
+
| --------------- | :------: | ----------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
|
|
79
|
+
| `style` | ✓ | | `{"search_web": False, "template": "Drake Hotline Bling", "topic": "When the code finally works"}` |
|
|
80
|
+
| `└─ search_web` | ✗ | Whether to search the web for meme content. | `False` |
|
|
81
|
+
| `└─ template` | ✓ | To use our templates, pass in one of the enum values. | `"Drake Hotline Bling"` |
|
|
82
|
+
| `└─ topic` | ✓ | The topic of the meme. | `"When the code finally works"` |
|
|
83
|
+
| `name` | ✗ | The name of the meme. | `"My Funny Meme"` |
|
|
85
84
|
|
|
86
85
|
#### Synchronous Client
|
|
87
86
|
|
|
@@ -98,7 +97,6 @@ res = client.v1.ai_meme_generator.create(
|
|
|
98
97
|
},
|
|
99
98
|
name="My Funny Meme",
|
|
100
99
|
)
|
|
101
|
-
|
|
102
100
|
```
|
|
103
101
|
|
|
104
102
|
#### Asynchronous Client
|
|
@@ -116,15 +114,16 @@ res = await client.v1.ai_meme_generator.create(
|
|
|
116
114
|
},
|
|
117
115
|
name="My Funny Meme",
|
|
118
116
|
)
|
|
119
|
-
|
|
120
117
|
```
|
|
121
118
|
|
|
122
119
|
#### Response
|
|
123
120
|
|
|
124
121
|
##### Type
|
|
122
|
+
|
|
125
123
|
[V1AiMemeGeneratorCreateResponse](/magic_hour/types/models/v1_ai_meme_generator_create_response.py)
|
|
126
124
|
|
|
127
125
|
##### Example
|
|
128
|
-
`{"credits_charged": 10, "frame_cost": 10, "id": "cuid-example"}`
|
|
129
|
-
|
|
130
126
|
|
|
127
|
+
```python
|
|
128
|
+
{"credits_charged": 10, "frame_cost": 10, "id": "cuid-example"}
|
|
129
|
+
```
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## Module Functions
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
<!-- CUSTOM DOCS START -->
|
|
8
6
|
|
|
9
7
|
### Ai Photo Editor Generate Workflow <a name="generate"></a>
|
|
@@ -81,9 +79,10 @@ res = await client.v1.ai_photo_editor.generate(
|
|
|
81
79
|
```
|
|
82
80
|
|
|
83
81
|
<!-- CUSTOM DOCS END -->
|
|
82
|
+
|
|
84
83
|
### AI Photo Editor <a name="create"></a>
|
|
85
84
|
|
|
86
|
-
> **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.
|
|
85
|
+
> **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.
|
|
87
86
|
|
|
88
87
|
Edit photo using AI. Each photo costs 10 credits.
|
|
89
88
|
|
|
@@ -91,22 +90,22 @@ Edit photo using AI. Each photo costs 10 credits.
|
|
|
91
90
|
|
|
92
91
|
#### Parameters
|
|
93
92
|
|
|
94
|
-
| Parameter
|
|
95
|
-
|
|
96
|
-
| `assets`
|
|
97
|
-
| `└─ image_file_path`
|
|
98
|
-
| `resolution`
|
|
99
|
-
| `style`
|
|
100
|
-
| `└─ image_description` |
|
|
101
|
-
| `└─ likeness_strength` |
|
|
102
|
-
| `└─ negative_prompt`
|
|
103
|
-
| `└─ prompt`
|
|
104
|
-
| `└─ prompt_strength`
|
|
105
|
-
| `└─ steps`
|
|
106
|
-
| `└─ upscale_factor`
|
|
107
|
-
| `└─ upscale_fidelity`
|
|
108
|
-
| `name`
|
|
109
|
-
| `steps`
|
|
93
|
+
| Parameter | Required | Deprecated | Description | Example |
|
|
94
|
+
| ---------------------- | :------: | :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
95
|
+
| `assets` | ✓ | ✗ | Provide the assets for photo editor | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
96
|
+
| `└─ image_file_path` | ✓ | — | The image used to generate the output. This value is either - a direct URL to the video file - `file_path` field from the response of the [upload urls API](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls). Please refer to the [Input File documentation](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) to learn more. | `"api-assets/id/1234.png"` |
|
|
97
|
+
| `resolution` | ✓ | ✗ | The resolution of the final output image. The allowed value is based on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details | `768` |
|
|
98
|
+
| `style` | ✓ | ✗ | | `{"image_description": "A photo of a person", "likeness_strength": 5.2, "negative_prompt": "painting, cartoon, sketch", "prompt": "A photo portrait of a person wearing a hat", "prompt_strength": 3.75, "steps": 4, "upscale_factor": 2, "upscale_fidelity": 0.5}` |
|
|
99
|
+
| `└─ image_description` | ✓ | — | Use this to describe what your input image is. This helps maintain aspects of the image you don't want to change. | `"A photo of a person"` |
|
|
100
|
+
| `└─ likeness_strength` | ✓ | — | Determines the input image's influence. Higher values align the output more with the initial image. | `5.2` |
|
|
101
|
+
| `└─ negative_prompt` | ✗ | — | What you want to avoid seeing in the final output; has a minor effect. | `"painting, cartoon, sketch"` |
|
|
102
|
+
| `└─ prompt` | ✓ | — | What you want your final output to look like. We recommend starting with the image description and making minor edits for best results. | `"A photo portrait of a person wearing a hat"` |
|
|
103
|
+
| `└─ prompt_strength` | ✓ | — | Determines the prompt's influence. Higher values align the output more with the prompt. | `3.75` |
|
|
104
|
+
| `└─ steps` | ✗ | — | Number of iterations used to generate the output. Higher values improve quality and increase the strength of the prompt but increase processing time. | `4` |
|
|
105
|
+
| `└─ upscale_factor` | ✗ | — | The multiplier applied to an image's original dimensions during the upscaling process. For example, a scale of 2 doubles the width and height (e.g., from 512x512 to 1024x1024). | `2` |
|
|
106
|
+
| `└─ upscale_fidelity` | ✗ | — | Upscale fidelity refers to the level of quality desired in the generated image. Fidelity value of 1 means more details. | `0.5` |
|
|
107
|
+
| `name` | ✗ | ✗ | The name of image. This value is mainly used for your own identification of the image. | `"Photo Editor image"` |
|
|
108
|
+
| `steps` | ✗ | ✓ | Deprecated: Please use `.style.steps` instead. Number of iterations used to generate the output. Higher values improve quality and increase the strength of the prompt but increase processing time. | `123` |
|
|
110
109
|
|
|
111
110
|
#### Synchronous Client
|
|
112
111
|
|
|
@@ -130,7 +129,6 @@ res = client.v1.ai_photo_editor.create(
|
|
|
130
129
|
},
|
|
131
130
|
name="Photo Editor image",
|
|
132
131
|
)
|
|
133
|
-
|
|
134
132
|
```
|
|
135
133
|
|
|
136
134
|
#### Asynchronous Client
|
|
@@ -155,15 +153,16 @@ res = await client.v1.ai_photo_editor.create(
|
|
|
155
153
|
},
|
|
156
154
|
name="Photo Editor image",
|
|
157
155
|
)
|
|
158
|
-
|
|
159
156
|
```
|
|
160
157
|
|
|
161
158
|
#### Response
|
|
162
159
|
|
|
163
160
|
##### Type
|
|
161
|
+
|
|
164
162
|
[V1AiPhotoEditorCreateResponse](/magic_hour/types/models/v1_ai_photo_editor_create_response.py)
|
|
165
163
|
|
|
166
164
|
##### Example
|
|
167
|
-
`{"credits_charged": 10, "frame_cost": 10, "id": "cuid-example"}`
|
|
168
|
-
|
|
169
165
|
|
|
166
|
+
```python
|
|
167
|
+
{"credits_charged": 10, "frame_cost": 10, "id": "cuid-example"}
|
|
168
|
+
```
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
## Module Functions
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
5
|
<!-- CUSTOM DOCS START -->
|
|
8
6
|
|
|
9
7
|
### Ai Qr Code Generator Generate Workflow <a name="generate"></a>
|
|
@@ -61,20 +59,21 @@ res = await client.v1.ai_qr_code_generator.generate(
|
|
|
61
59
|
```
|
|
62
60
|
|
|
63
61
|
<!-- CUSTOM DOCS END -->
|
|
64
|
-
### AI QR Code <a name="create"></a>
|
|
65
62
|
|
|
66
|
-
|
|
63
|
+
### AI QR Code Generator <a name="create"></a>
|
|
64
|
+
|
|
65
|
+
Create an AI QR code. Each QR code costs 0 credits.
|
|
67
66
|
|
|
68
67
|
**API Endpoint**: `POST /v1/ai-qr-code-generator`
|
|
69
68
|
|
|
70
69
|
#### Parameters
|
|
71
70
|
|
|
72
|
-
| Parameter
|
|
73
|
-
|
|
74
|
-
| `content`
|
|
75
|
-
| `style`
|
|
76
|
-
| `└─ art_style` |
|
|
77
|
-
| `name`
|
|
71
|
+
| Parameter | Required | Description | Example |
|
|
72
|
+
| -------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------- |
|
|
73
|
+
| `content` | ✓ | The content of the QR code. | `"https://magichour.ai"` |
|
|
74
|
+
| `style` | ✓ | | `{"art_style": "Watercolor"}` |
|
|
75
|
+
| `└─ art_style` | ✓ | To use our templates, pass in one of Watercolor, Cyberpunk City, Ink Landscape, Interior Painting, Japanese Street, Mech, Minecraft, Picasso Painting, Game Map, Spaceship, Chinese Painting, Winter Village, or pass any custom art style. | `"Watercolor"` |
|
|
76
|
+
| `name` | ✗ | The name of image. This value is mainly used for your own identification of the image. | `"Qr Code image"` |
|
|
78
77
|
|
|
79
78
|
#### Synchronous Client
|
|
80
79
|
|
|
@@ -88,7 +87,6 @@ res = client.v1.ai_qr_code_generator.create(
|
|
|
88
87
|
style={"art_style": "Watercolor"},
|
|
89
88
|
name="Qr Code image",
|
|
90
89
|
)
|
|
91
|
-
|
|
92
90
|
```
|
|
93
91
|
|
|
94
92
|
#### Asynchronous Client
|
|
@@ -103,15 +101,16 @@ res = await client.v1.ai_qr_code_generator.create(
|
|
|
103
101
|
style={"art_style": "Watercolor"},
|
|
104
102
|
name="Qr Code image",
|
|
105
103
|
)
|
|
106
|
-
|
|
107
104
|
```
|
|
108
105
|
|
|
109
106
|
#### Response
|
|
110
107
|
|
|
111
108
|
##### Type
|
|
109
|
+
|
|
112
110
|
[V1AiQrCodeGeneratorCreateResponse](/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py)
|
|
113
111
|
|
|
114
112
|
##### Example
|
|
115
|
-
`{"credits_charged": 20, "frame_cost": 20, "id": "cuid-example"}`
|
|
116
|
-
|
|
117
113
|
|
|
114
|
+
```python
|
|
115
|
+
{"credits_charged": 0, "frame_cost": 0, "id": "cuid-example"}
|
|
116
|
+
```
|
|
@@ -91,9 +91,9 @@ class AiQrCodeGeneratorClient:
|
|
|
91
91
|
request_options: typing.Optional[RequestOptions] = None,
|
|
92
92
|
) -> models.V1AiQrCodeGeneratorCreateResponse:
|
|
93
93
|
"""
|
|
94
|
-
AI QR Code
|
|
94
|
+
AI QR Code Generator
|
|
95
95
|
|
|
96
|
-
Create an AI QR code. Each QR code costs
|
|
96
|
+
Create an AI QR code. Each QR code costs 0 credits.
|
|
97
97
|
|
|
98
98
|
POST /v1/ai-qr-code-generator
|
|
99
99
|
|
|
@@ -205,9 +205,9 @@ class AsyncAiQrCodeGeneratorClient:
|
|
|
205
205
|
request_options: typing.Optional[RequestOptions] = None,
|
|
206
206
|
) -> models.V1AiQrCodeGeneratorCreateResponse:
|
|
207
207
|
"""
|
|
208
|
-
AI QR Code
|
|
208
|
+
AI QR Code Generator
|
|
209
209
|
|
|
210
|
-
Create an AI QR code. Each QR code costs
|
|
210
|
+
Create an AI QR code. Each QR code costs 0 credits.
|
|
211
211
|
|
|
212
212
|
POST /v1/ai-qr-code-generator
|
|
213
213
|
|