Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion .sdk.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"id": "adf522eb-8026-4017-8244-0e110c2d9aff",
"id": "df69834c-08cc-4981-8694-57b835dbc30e",
"tracked_paths": [
{
"editable": true,
Expand Down Expand Up @@ -161,6 +161,18 @@
"editable": true,
"path": "magic_hour/resources/v1/ai_talking_photo/client.py"
},
{
"editable": true,
"path": "magic_hour/resources/v1/ai_ugc_ad/README.md"
},
{
"editable": true,
"path": "magic_hour/resources/v1/ai_ugc_ad/__init__.py"
},
{
"editable": true,
"path": "magic_hour/resources/v1/ai_ugc_ad/client.py"
},
{
"editable": true,
"path": "magic_hour/resources/v1/ai_video_editor/README.md"
Expand Down Expand Up @@ -525,6 +537,10 @@
"editable": false,
"path": "magic_hour/types/models/v1_ai_talking_photo_create_response.py"
},
{
"editable": false,
"path": "magic_hour/types/models/v1_ai_ugc_ad_create_response.py"
},
{
"editable": false,
"path": "magic_hour/types/models/v1_ai_video_editor_create_response.py"
Expand Down Expand Up @@ -773,6 +789,14 @@
"editable": false,
"path": "magic_hour/types/params/v1_ai_talking_photo_create_body_style.py"
},
{
"editable": false,
"path": "magic_hour/types/params/v1_ai_ugc_ad_create_body.py"
},
{
"editable": false,
"path": "magic_hour/types/params/v1_ai_ugc_ad_create_body_assets.py"
},
{
"editable": false,
"path": "magic_hour/types/params/v1_ai_video_editor_create_body.py"
Expand Down Expand Up @@ -1041,6 +1065,10 @@
"editable": false,
"path": "tests/test_v1_ai_talking_photo_client.py"
},
{
"editable": false,
"path": "tests/test_v1_ai_ugc_ad_client.py"
},
{
"editable": false,
"path": "tests/test_v1_ai_video_editor_client.py"
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ download_urls = result.downloads
- [create](magic_hour/resources/v1/ai_talking_photo/README.md#create) - AI Talking Photo
- [generate](magic_hour/resources/v1/ai_talking_photo/README.md#generate) - Ai Talking Photo Generate Workflow

### [v1.ai_ugc_ad](magic_hour/resources/v1/ai_ugc_ad/README.md)

- [create](magic_hour/resources/v1/ai_ugc_ad/README.md#create) - AI UGC Ad Generator

### [v1.ai_video_editor](magic_hour/resources/v1/ai_video_editor/README.md)

- [create](magic_hour/resources/v1/ai_video_editor/README.md#create) - AI Video Editor
Expand Down
1 change: 1 addition & 0 deletions magic_hour/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [ai_meme_generator](resources/v1/ai_meme_generator/README.md) - ai_meme_generator
- [ai_qr_code_generator](resources/v1/ai_qr_code_generator/README.md) - ai_qr_code_generator
- [ai_talking_photo](resources/v1/ai_talking_photo/README.md) - ai_talking_photo
- [ai_ugc_ad](resources/v1/ai_ugc_ad/README.md) - ai_ugc_ad
- [ai_video_editor](resources/v1/ai_video_editor/README.md) - ai_video_editor
- [ai_video_translator](resources/v1/ai_video_translator/README.md) - ai_video_translator
- [ai_voice_cloner](resources/v1/ai_voice_cloner/README.md) - ai_voice_cloner
Expand Down
2 changes: 1 addition & 1 deletion magic_hour/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Environment(enum.Enum):
"""Pre-defined base URLs for the API"""

ENVIRONMENT = "https://api.magichour.ai"
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.87.1"
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.88.0"


def _get_base_url(
Expand Down
1 change: 1 addition & 0 deletions magic_hour/resources/v1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
- [ai_meme_generator](ai_meme_generator/README.md) - ai_meme_generator
- [ai_qr_code_generator](ai_qr_code_generator/README.md) - ai_qr_code_generator
- [ai_talking_photo](ai_talking_photo/README.md) - ai_talking_photo
- [ai_ugc_ad](ai_ugc_ad/README.md) - ai_ugc_ad
- [ai_video_editor](ai_video_editor/README.md) - ai_video_editor
- [ai_video_translator](ai_video_translator/README.md) - ai_video_translator
- [ai_voice_cloner](ai_voice_cloner/README.md) - ai_voice_cloner
Expand Down
31 changes: 16 additions & 15 deletions magic_hour/resources/v1/ai_talking_photo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,20 @@ Create a talking photo video from an image and an audio file.

#### Parameters

| Parameter | Required | Description | Example |
| -------------------- | :------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `assets` | ✓ | Provide the assets for creating a talking photo | `{"audio_file_path": "api-assets/id/1234.mp3", "image_file_path": "api-assets/id/1234.png"}` |
| `└─ audio_file_path` | ✓ | The audio file to sync with the image. 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). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.mp3"` |
| `└─ image_file_path` | ✓ | The source image to animate. 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). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.png"` |
| `end_seconds` | ✓ | The end time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. | `5.0` |
| `start_seconds` | ✓ | The start time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. | `0.0` |
| `max_resolution` | ✗ | Constrains the larger dimension (height or width) of the output video. Allows you to set a lower resolution than your plan's maximum if desired. The value is capped by your plan's max resolution. | `512` |
| `name` | ✗ | Give your video a custom name for easy identification. | `"My Talking Photo video"` |
| `style` | ✗ | Attributes used to dictate the style of the output | `{"generation_mode": "realistic", "prompt": "A person smiling and speaking naturally to the camera"}` |
| `└─ generation_mode` | ✗ | Controls overall motion style. * `realistic` - Maintains likeness well, high quality, and reliable. * `prompted` - Slightly lower likeness; allows option to prompt scene. **Deprecated values (maintained for backward compatibility):** * `pro` - Deprecated: use `realistic` * `standard` - Deprecated: use `prompted` * `stable` - Deprecated: use `realistic` * `expressive` - Deprecated: use `prompted` | `"realistic"` |
| `└─ intensity` | ✗ | Note: this value is only applicable when generation_mode is `expressive`. The value can include up to 2 decimal places. * Lower values yield more stability but can suppress mouth movement. * Higher values increase motion and expressiveness, with a higher risk of distortion. | `123.0` |
| `└─ prompt` | ✗ | A text prompt to guide the generation. Only applicable when generation_mode is `prompted`. This field is ignored for other modes. | `"A person smiling and speaking naturally to the camera"` |
| Parameter | Required | Deprecated | Description | Example |
| -------------------- | :------: | :--------: | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- |
| `assets` | ✓ | ✗ | Provide the assets for creating a talking photo | `{"audio_file_path": "api-assets/id/1234.mp3", "image_file_path": "api-assets/id/1234.png"}` |
| `└─ audio_file_path` | ✓ | — | The audio file to sync with the image. 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). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.mp3"` |
| `└─ image_file_path` | ✓ | — | The source image to animate. 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). See the [file upload guide](https://docs.magichour.ai/api-reference/files/generate-asset-upload-urls#input-file) for details. | `"api-assets/id/1234.png"` |
| `end_seconds` | ✓ | ✗ | The end time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. | `5.0` |
| `start_seconds` | ✓ | ✗ | The start time of the input audio in seconds. Maximum clip length depends on style.generation_mode: realistic 300s, prompted 45s. | `0.0` |
| `max_resolution` | ✗ | ✓ | Deprecated: use `resolution`. Still accepted as a larger-dimension cap, limited by your plan. Ignored when `resolution` is provided. After plan capping: * Below 1280 maps to `480p` (intermediate values round down). * 1280 or above maps to `720p`. | `123` |
| `name` | ✗ | ✗ | Give your video a custom name for easy identification. | `"My Talking Photo video"` |
| `resolution` | ✗ | ✗ | Output preset. Overrides `max_resolution`. Defaults to 480p in prompted mode; realistic mode uses the mapped plan maximum. | `"480p"` |
| `style` | ✗ | ✗ | Attributes used to dictate the style of the output | `{"generation_mode": "realistic", "prompt": "A person smiling and speaking naturally to the camera"}` |
| `└─ generation_mode` | ✗ | — | Controls overall motion style. * `realistic` - Maintains likeness well, high quality, and reliable. * `prompted` - Slightly lower likeness; allows option to prompt scene. **Deprecated values (maintained for backward compatibility):** * `pro` - Deprecated: use `realistic` * `standard` - Deprecated: use `prompted` * `stable` - Deprecated: use `realistic` * `expressive` - Deprecated: use `prompted` | `"realistic"` |
| `└─ intensity` | ✗ | ✓ | Note: this value is only applicable when generation_mode is `expressive`. The value can include up to 2 decimal places. * Lower values yield more stability but can suppress mouth movement. * Higher values increase motion and expressiveness, with a higher risk of distortion. | `123.0` |
| `└─ prompt` | ✗ | — | A text prompt to guide the generation. Only applicable when generation_mode is `prompted`. This field is ignored for other modes. | `"A person smiling and speaking naturally to the camera"` |

#### Synchronous Client

Expand All @@ -104,8 +105,8 @@ res = client.v1.ai_talking_photo.create(
},
end_seconds=5.0,
start_seconds=0.0,
max_resolution=512,
name="My Talking Photo video",
resolution="480p",
)
```

Expand All @@ -123,8 +124,8 @@ res = await client.v1.ai_talking_photo.create(
},
end_seconds=5.0,
start_seconds=0.0,
max_resolution=512,
name="My Talking Photo video",
resolution="480p",
)
```

Expand Down
Loading
Loading