magic_hour 0.23.0__tar.gz → 0.24.0__tar.gz
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-0.23.0 → magic_hour-0.24.0}/PKG-INFO +1 -1
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/query.py +5 -6
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/environment.py +1 -1
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_clothes_changer/README.md +9 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_face_editor/README.md +10 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_gif_generator/README.md +9 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_headshot_generator/README.md +10 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_generator/README.md +13 -2
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_generator/client.py +2 -2
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_upscaler/README.md +11 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_meme_generator/README.md +9 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_photo_editor/README.md +12 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_qr_code_generator/README.md +10 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_talking_photo/README.md +12 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/animation/README.md +14 -0
- magic_hour-0.24.0/magic_hour/resources/v1/face_swap/README.md +64 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/face_swap_photo/README.md +9 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/files/upload_urls/README.md +8 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_background_remover/README.md +9 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_projects/README.md +16 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_to_video/README.md +13 -0
- magic_hour-0.24.0/magic_hour/resources/v1/lip_sync/README.md +67 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/photo_colorizer/README.md +9 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/text_to_video/README.md +11 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/video_projects/README.md +16 -0
- magic_hour-0.24.0/magic_hour/resources/v1/video_to_video/README.md +74 -0
- magic_hour-0.24.0/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +111 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/pyproject.toml +1 -1
- magic_hour-0.23.0/magic_hour/resources/v1/face_swap/README.md +0 -51
- magic_hour-0.23.0/magic_hour/resources/v1/lip_sync/README.md +0 -53
- magic_hour-0.23.0/magic_hour/resources/v1/video_to_video/README.md +0 -59
- magic_hour-0.23.0/magic_hour/types/params/v1_ai_image_generator_create_body_style.py +0 -28
- {magic_hour-0.23.0 → magic_hour-0.24.0}/LICENSE +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/README.md +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/api_error.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/auth.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/base_client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/binary_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/request.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/type_utils.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/core/utils.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_clothes_changer/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_clothes_changer/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_face_editor/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_face_editor/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_gif_generator/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_gif_generator/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_headshot_generator/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_headshot_generator/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_generator/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_upscaler/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_upscaler/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_meme_generator/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_meme_generator/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_photo_editor/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_photo_editor/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_qr_code_generator/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_qr_code_generator/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_talking_photo/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_talking_photo/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/animation/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/animation/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/face_swap/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/face_swap/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/face_swap_photo/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/face_swap_photo/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/files/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/files/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/files/upload_urls/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/files/upload_urls/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_background_remover/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_background_remover/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_projects/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_projects/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_to_video/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_to_video/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/lip_sync/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/lip_sync/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/photo_colorizer/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/photo_colorizer/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/text_to_video/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/text_to_video/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/video_projects/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/video_projects/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/video_to_video/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/video_to_video/client.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_clothes_changer_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_face_editor_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_gif_generator_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_headshot_generator_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_image_generator_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_image_upscaler_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_meme_generator_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_photo_editor_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_qr_code_generator_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_ai_talking_photo_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_animation_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_face_swap_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_face_swap_photo_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_files_upload_urls_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_files_upload_urls_create_response_items_item.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_image_background_remover_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_image_projects_get_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_image_projects_get_response_downloads_item.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_image_projects_get_response_error.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_image_to_video_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_lip_sync_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_photo_colorizer_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_text_to_video_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_video_projects_get_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_video_projects_get_response_download.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_video_projects_get_response_downloads_item.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_video_projects_get_response_error.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/models/v1_video_to_video_create_response.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/__init__.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_clothes_changer_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_face_editor_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_face_editor_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_face_editor_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_gif_generator_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_gif_generator_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_headshot_generator_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_image_generator_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_image_upscaler_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_meme_generator_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_meme_generator_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_photo_editor_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_photo_editor_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_qr_code_generator_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_talking_photo_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_ai_talking_photo_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_animation_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_animation_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_animation_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_face_swap_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_face_swap_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_face_swap_photo_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_face_swap_photo_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_files_upload_urls_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_files_upload_urls_create_body_items_item.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_image_background_remover_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_image_background_remover_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_image_to_video_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_image_to_video_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_image_to_video_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_lip_sync_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_lip_sync_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_photo_colorizer_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_photo_colorizer_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_text_to_video_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_text_to_video_create_body_style.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_video_to_video_create_body.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_video_to_video_create_body_assets.py +0 -0
- {magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/types/params/v1_video_to_video_create_body_style.py +0 -0
|
@@ -2,7 +2,6 @@ import json
|
|
|
2
2
|
|
|
3
3
|
from typing import Any, Dict, Union
|
|
4
4
|
from typing_extensions import Literal, Sequence
|
|
5
|
-
from urllib.parse import quote_plus, quote
|
|
6
5
|
|
|
7
6
|
import httpx
|
|
8
7
|
|
|
@@ -47,19 +46,19 @@ def _encode_form(params: QueryParams, name: str, value: Any, explode: bool):
|
|
|
47
46
|
"""
|
|
48
47
|
if isinstance(value, list) and not explode:
|
|
49
48
|
# non-explode form lists should be encoded like /users?id=3,4,5
|
|
50
|
-
params[name] =
|
|
49
|
+
params[name] = ",".join(map(_query_str, value))
|
|
51
50
|
elif isinstance(value, dict):
|
|
52
51
|
if explode:
|
|
53
52
|
# explode form objects should be encoded like /users?key0=val0&key1=val1
|
|
54
53
|
# the input param name will be omitted
|
|
55
54
|
for k, v in value.items():
|
|
56
|
-
params[k] =
|
|
55
|
+
params[k] = _query_str(v)
|
|
57
56
|
else:
|
|
58
57
|
# non-explode form objects should be encoded like /users?id=key0,val0,key1,val1
|
|
59
58
|
encoded_chunks = []
|
|
60
59
|
for k, v in value.items():
|
|
61
60
|
encoded_chunks.extend([str(k), _query_str(v)])
|
|
62
|
-
params[name] =
|
|
61
|
+
params[name] = ",".join(encoded_chunks)
|
|
63
62
|
else:
|
|
64
63
|
params[name] = value
|
|
65
64
|
|
|
@@ -71,7 +70,7 @@ def _encode_spaced_delimited(params: QueryParams, name: str, value: Any, explode
|
|
|
71
70
|
"""
|
|
72
71
|
if isinstance(value, list) and not explode:
|
|
73
72
|
# non-explode spaceDelimited lists should be encoded like /users?id=3%204%205
|
|
74
|
-
params[name] =
|
|
73
|
+
params[name] = " ".join(map(_query_str, value))
|
|
75
74
|
else:
|
|
76
75
|
# according to the docs, spaceDelimited + explode=false only effects lists,
|
|
77
76
|
# all other encodings are marked as n/a or are the same as `form` style
|
|
@@ -86,7 +85,7 @@ def _encode_pipe_delimited(params: QueryParams, name: str, value: Any, explode:
|
|
|
86
85
|
"""
|
|
87
86
|
if isinstance(value, list) and not explode:
|
|
88
87
|
# non-explode pipeDelimited lists should be encoded like /users?id=3|4|5
|
|
89
|
-
params[name] =
|
|
88
|
+
params[name] = "|".join(map(_query_str, value))
|
|
90
89
|
else:
|
|
91
90
|
# according to the docs, pipeDelimited + explode=false only effects lists,
|
|
92
91
|
# all other encodings are marked as n/a or are the same as `form` style
|
|
@@ -6,7 +6,7 @@ class Environment(enum.Enum):
|
|
|
6
6
|
"""Pre-defined base URLs for the API"""
|
|
7
7
|
|
|
8
8
|
ENVIRONMENT = "https://api.magichour.ai"
|
|
9
|
-
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.
|
|
9
|
+
MOCK_SERVER = "https://api.sideko.dev/v1/mock/magichour/magic-hour/0.24.0"
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def _get_base_url(
|
{magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_clothes_changer/README.md
RENAMED
|
@@ -20,6 +20,7 @@ res = client.v1.ai_clothes_changer.create(
|
|
|
20
20
|
},
|
|
21
21
|
name="Clothes Changer image",
|
|
22
22
|
)
|
|
23
|
+
|
|
23
24
|
```
|
|
24
25
|
|
|
25
26
|
#### Asynchronous Client
|
|
@@ -37,4 +38,12 @@ res = await client.v1.ai_clothes_changer.create(
|
|
|
37
38
|
},
|
|
38
39
|
name="Clothes Changer image",
|
|
39
40
|
)
|
|
41
|
+
|
|
40
42
|
```
|
|
43
|
+
|
|
44
|
+
#### Parameters
|
|
45
|
+
|
|
46
|
+
| Parameter | Required | Description | Example |
|
|
47
|
+
|-----------|:--------:|-------------|--------|
|
|
48
|
+
| `assets` | ✓ | Provide the assets for clothes changer | `{"garment_file_path": "api-assets/id/outfit.png", "garment_type": "dresses", "person_file_path": "api-assets/id/model.png"}` |
|
|
49
|
+
| `name` | ✗ | The name of image | `"Clothes Changer image"` |
|
|
@@ -33,6 +33,7 @@ res = client.v1.ai_face_editor.create(
|
|
|
33
33
|
},
|
|
34
34
|
name="Face Editor image",
|
|
35
35
|
)
|
|
36
|
+
|
|
36
37
|
```
|
|
37
38
|
|
|
38
39
|
#### Asynchronous Client
|
|
@@ -63,4 +64,13 @@ res = await client.v1.ai_face_editor.create(
|
|
|
63
64
|
},
|
|
64
65
|
name="Face Editor image",
|
|
65
66
|
)
|
|
67
|
+
|
|
66
68
|
```
|
|
69
|
+
|
|
70
|
+
#### Parameters
|
|
71
|
+
|
|
72
|
+
| Parameter | Required | Description | Example |
|
|
73
|
+
|-----------|:--------:|-------------|--------|
|
|
74
|
+
| `assets` | ✓ | Provide the assets for face editor | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
75
|
+
| `style` | ✓ | Face editing parameters | `{"enhance_face": False, "eye_gaze_horizontal": 0.0, "eye_gaze_vertical": 0.0, "eye_open_ratio": 0.0, "eyebrow_direction": 0.0, "head_pitch": 0.0, "head_roll": 0.0, "head_yaw": 0.0, "lip_open_ratio": 0.0, "mouth_grim": 0.0, "mouth_position_horizontal": 0.0, "mouth_position_vertical": 0.0, "mouth_pout": 0.0, "mouth_purse": 0.0, "mouth_smile": 0.0}` |
|
|
76
|
+
| `name` | ✗ | The name of image | `"Face Editor image"` |
|
|
@@ -15,6 +15,7 @@ client = Client(token=getenv("API_TOKEN"))
|
|
|
15
15
|
res = client.v1.ai_gif_generator.create(
|
|
16
16
|
style={"prompt": "Cute dancing cat, pixel art"}, name="Ai Gif gif"
|
|
17
17
|
)
|
|
18
|
+
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
#### Asynchronous Client
|
|
@@ -27,4 +28,12 @@ client = AsyncClient(token=getenv("API_TOKEN"))
|
|
|
27
28
|
res = await client.v1.ai_gif_generator.create(
|
|
28
29
|
style={"prompt": "Cute dancing cat, pixel art"}, name="Ai Gif gif"
|
|
29
30
|
)
|
|
31
|
+
|
|
30
32
|
```
|
|
33
|
+
|
|
34
|
+
#### Parameters
|
|
35
|
+
|
|
36
|
+
| Parameter | Required | Description | Example |
|
|
37
|
+
|-----------|:--------:|-------------|--------|
|
|
38
|
+
| `style` | ✓ | | `{"prompt": "Cute dancing cat, pixel art"}` |
|
|
39
|
+
| `name` | ✗ | The name of gif | `"Ai Gif gif"` |
|
{magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_headshot_generator/README.md
RENAMED
|
@@ -15,6 +15,7 @@ client = Client(token=getenv("API_TOKEN"))
|
|
|
15
15
|
res = client.v1.ai_headshot_generator.create(
|
|
16
16
|
assets={"image_file_path": "api-assets/id/1234.png"}, name="Ai Headshot image"
|
|
17
17
|
)
|
|
18
|
+
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
#### Asynchronous Client
|
|
@@ -27,4 +28,13 @@ client = AsyncClient(token=getenv("API_TOKEN"))
|
|
|
27
28
|
res = await client.v1.ai_headshot_generator.create(
|
|
28
29
|
assets={"image_file_path": "api-assets/id/1234.png"}, name="Ai Headshot image"
|
|
29
30
|
)
|
|
31
|
+
|
|
30
32
|
```
|
|
33
|
+
|
|
34
|
+
#### Parameters
|
|
35
|
+
|
|
36
|
+
| Parameter | Required | Description | Example |
|
|
37
|
+
|-----------|:--------:|-------------|--------|
|
|
38
|
+
| `assets` | ✓ | Provide the assets for headshot photo | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
39
|
+
| `name` | ✗ | The name of image | `"Ai Headshot image"` |
|
|
40
|
+
| `style` | ✗ | | `{"prompt": "professional passport photo, business attire, smiling, good posture, light blue background, centered, plain background"}` |
|
{magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_generator/README.md
RENAMED
|
@@ -15,9 +15,10 @@ client = Client(token=getenv("API_TOKEN"))
|
|
|
15
15
|
res = client.v1.ai_image_generator.create(
|
|
16
16
|
image_count=1,
|
|
17
17
|
orientation="landscape",
|
|
18
|
-
style={"prompt": "Cool image"},
|
|
18
|
+
style={"prompt": "Cool image", "tool": "ai-anime-generator"},
|
|
19
19
|
name="Ai Image image",
|
|
20
20
|
)
|
|
21
|
+
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
#### Asynchronous Client
|
|
@@ -30,7 +31,17 @@ client = AsyncClient(token=getenv("API_TOKEN"))
|
|
|
30
31
|
res = await client.v1.ai_image_generator.create(
|
|
31
32
|
image_count=1,
|
|
32
33
|
orientation="landscape",
|
|
33
|
-
style={"prompt": "Cool image"},
|
|
34
|
+
style={"prompt": "Cool image", "tool": "ai-anime-generator"},
|
|
34
35
|
name="Ai Image image",
|
|
35
36
|
)
|
|
37
|
+
|
|
36
38
|
```
|
|
39
|
+
|
|
40
|
+
#### Parameters
|
|
41
|
+
|
|
42
|
+
| Parameter | Required | Description | Example |
|
|
43
|
+
|-----------|:--------:|-------------|--------|
|
|
44
|
+
| `image_count` | ✓ | number to images to generate | `1` |
|
|
45
|
+
| `orientation` | ✓ | | `"landscape"` |
|
|
46
|
+
| `style` | ✓ | | `{"prompt": "Cool image", "tool": "ai-anime-generator"}` |
|
|
47
|
+
| `name` | ✗ | The name of image | `"Ai Image image"` |
|
{magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_image_generator/client.py
RENAMED
|
@@ -53,7 +53,7 @@ class AiImageGeneratorClient:
|
|
|
53
53
|
client.v1.ai_image_generator.create(
|
|
54
54
|
image_count=1,
|
|
55
55
|
orientation="landscape",
|
|
56
|
-
style={"prompt": "Cool image"},
|
|
56
|
+
style={"prompt": "Cool image", "tool": "ai-anime-generator"},
|
|
57
57
|
name="Ai Image image",
|
|
58
58
|
)
|
|
59
59
|
```
|
|
@@ -118,7 +118,7 @@ class AsyncAiImageGeneratorClient:
|
|
|
118
118
|
await client.v1.ai_image_generator.create(
|
|
119
119
|
image_count=1,
|
|
120
120
|
orientation="landscape",
|
|
121
|
-
style={"prompt": "Cool image"},
|
|
121
|
+
style={"prompt": "Cool image", "tool": "ai-anime-generator"},
|
|
122
122
|
name="Ai Image image",
|
|
123
123
|
)
|
|
124
124
|
```
|
|
@@ -18,6 +18,7 @@ res = client.v1.ai_image_upscaler.create(
|
|
|
18
18
|
style={"enhancement": "Balanced"},
|
|
19
19
|
name="Image Upscaler image",
|
|
20
20
|
)
|
|
21
|
+
|
|
21
22
|
```
|
|
22
23
|
|
|
23
24
|
#### Asynchronous Client
|
|
@@ -33,4 +34,14 @@ res = await client.v1.ai_image_upscaler.create(
|
|
|
33
34
|
style={"enhancement": "Balanced"},
|
|
34
35
|
name="Image Upscaler image",
|
|
35
36
|
)
|
|
37
|
+
|
|
36
38
|
```
|
|
39
|
+
|
|
40
|
+
#### Parameters
|
|
41
|
+
|
|
42
|
+
| Parameter | Required | Description | Example |
|
|
43
|
+
|-----------|:--------:|-------------|--------|
|
|
44
|
+
| `assets` | ✓ | Provide the assets for upscaling | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
45
|
+
| `scale_factor` | ✓ | How much to scale the image. Must be either 2 or 4 | `2.0` |
|
|
46
|
+
| `style` | ✓ | | `{"enhancement": "Balanced"}` |
|
|
47
|
+
| `name` | ✗ | The name of image | `"Image Upscaler image"` |
|
|
@@ -20,6 +20,7 @@ res = client.v1.ai_meme_generator.create(
|
|
|
20
20
|
},
|
|
21
21
|
name="My Funny Meme",
|
|
22
22
|
)
|
|
23
|
+
|
|
23
24
|
```
|
|
24
25
|
|
|
25
26
|
#### Asynchronous Client
|
|
@@ -37,4 +38,12 @@ res = await client.v1.ai_meme_generator.create(
|
|
|
37
38
|
},
|
|
38
39
|
name="My Funny Meme",
|
|
39
40
|
)
|
|
41
|
+
|
|
40
42
|
```
|
|
43
|
+
|
|
44
|
+
#### Parameters
|
|
45
|
+
|
|
46
|
+
| Parameter | Required | Description | Example |
|
|
47
|
+
|-----------|:--------:|-------------|--------|
|
|
48
|
+
| `style` | ✓ | | `{"search_web": False, "template": "Drake Hotline Bling", "topic": "When the code finally works"}` |
|
|
49
|
+
| `name` | ✗ | The name of the meme. | `"My Funny Meme"` |
|
|
@@ -29,6 +29,7 @@ res = client.v1.ai_photo_editor.create(
|
|
|
29
29
|
},
|
|
30
30
|
name="Photo Editor image",
|
|
31
31
|
)
|
|
32
|
+
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
#### Asynchronous Client
|
|
@@ -53,4 +54,15 @@ res = await client.v1.ai_photo_editor.create(
|
|
|
53
54
|
},
|
|
54
55
|
name="Photo Editor image",
|
|
55
56
|
)
|
|
57
|
+
|
|
56
58
|
```
|
|
59
|
+
|
|
60
|
+
#### Parameters
|
|
61
|
+
|
|
62
|
+
| Parameter | Required | Description | Example |
|
|
63
|
+
|-----------|:--------:|-------------|--------|
|
|
64
|
+
| `assets` | ✓ | Provide the assets for photo editor | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
65
|
+
| `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` |
|
|
66
|
+
| `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}` |
|
|
67
|
+
| `name` | ✗ | The name of image | `"Photo Editor image"` |
|
|
68
|
+
| `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` |
|
{magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/ai_qr_code_generator/README.md
RENAMED
|
@@ -17,6 +17,7 @@ res = client.v1.ai_qr_code_generator.create(
|
|
|
17
17
|
style={"art_style": "Watercolor"},
|
|
18
18
|
name="Qr Code image",
|
|
19
19
|
)
|
|
20
|
+
|
|
20
21
|
```
|
|
21
22
|
|
|
22
23
|
#### Asynchronous Client
|
|
@@ -31,4 +32,13 @@ res = await client.v1.ai_qr_code_generator.create(
|
|
|
31
32
|
style={"art_style": "Watercolor"},
|
|
32
33
|
name="Qr Code image",
|
|
33
34
|
)
|
|
35
|
+
|
|
34
36
|
```
|
|
37
|
+
|
|
38
|
+
#### Parameters
|
|
39
|
+
|
|
40
|
+
| Parameter | Required | Description | Example |
|
|
41
|
+
|-----------|:--------:|-------------|--------|
|
|
42
|
+
| `content` | ✓ | The content of the QR code. | `"https://magichour.ai"` |
|
|
43
|
+
| `style` | ✓ | | `{"art_style": "Watercolor"}` |
|
|
44
|
+
| `name` | ✗ | The name of image | `"Qr Code image"` |
|
|
@@ -21,6 +21,7 @@ res = client.v1.ai_talking_photo.create(
|
|
|
21
21
|
start_seconds=0.0,
|
|
22
22
|
name="Talking Photo image",
|
|
23
23
|
)
|
|
24
|
+
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
#### Asynchronous Client
|
|
@@ -39,4 +40,15 @@ res = await client.v1.ai_talking_photo.create(
|
|
|
39
40
|
start_seconds=0.0,
|
|
40
41
|
name="Talking Photo image",
|
|
41
42
|
)
|
|
43
|
+
|
|
42
44
|
```
|
|
45
|
+
|
|
46
|
+
#### Parameters
|
|
47
|
+
|
|
48
|
+
| Parameter | Required | Description | Example |
|
|
49
|
+
|-----------|:--------:|-------------|--------|
|
|
50
|
+
| `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"}` |
|
|
51
|
+
| `end_seconds` | ✓ | The end time of the input audio in seconds. The maximum duration allowed is 30 seconds. | `15.0` |
|
|
52
|
+
| `start_seconds` | ✓ | The start time of the input audio in seconds. The maximum duration allowed is 30 seconds. | `0.0` |
|
|
53
|
+
| `name` | ✗ | The name of image | `"Talking Photo image"` |
|
|
54
|
+
| `style` | ✗ | Attributes used to dictate the style of the output | `{"generation_mode": "expressive", "intensity": 1.5}` |
|
|
@@ -31,6 +31,7 @@ res = client.v1.animation.create(
|
|
|
31
31
|
width=512,
|
|
32
32
|
name="Animation video",
|
|
33
33
|
)
|
|
34
|
+
|
|
34
35
|
```
|
|
35
36
|
|
|
36
37
|
#### Asynchronous Client
|
|
@@ -59,4 +60,17 @@ res = await client.v1.animation.create(
|
|
|
59
60
|
width=512,
|
|
60
61
|
name="Animation video",
|
|
61
62
|
)
|
|
63
|
+
|
|
62
64
|
```
|
|
65
|
+
|
|
66
|
+
#### Parameters
|
|
67
|
+
|
|
68
|
+
| Parameter | Required | Description | Example |
|
|
69
|
+
|-----------|:--------:|-------------|--------|
|
|
70
|
+
| `assets` | ✓ | Provide the assets for animation. | `{"audio_file_path": "api-assets/id/1234.mp3", "audio_source": "file", "image_file_path": "api-assets/id/1234.png"}` |
|
|
71
|
+
| `end_seconds` | ✓ | The end time of the input video in seconds | `15.0` |
|
|
72
|
+
| `fps` | ✓ | The desire output video frame rate | `12.0` |
|
|
73
|
+
| `height` | ✓ | The height of the final output video. The maximum height depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details | `960` |
|
|
74
|
+
| `style` | ✓ | Defines the style of the output video | `{"art_style": "Painterly Illustration", "camera_effect": "Accelerate", "prompt": "Cyberpunk city", "prompt_type": "ai_choose", "transition_speed": 5}` |
|
|
75
|
+
| `width` | ✓ | The width of the final output video. The maximum width depends on your subscription. Please refer to our [pricing page](https://magichour.ai/pricing) for more details | `512` |
|
|
76
|
+
| `name` | ✗ | The name of video | `"Animation video"` |
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
### Face Swap video <a name="create"></a>
|
|
3
|
+
|
|
4
|
+
Create a Face Swap video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
5
|
+
|
|
6
|
+
Get more information about this mode at our [product page](/products/face-swap).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
**API Endpoint**: `POST /v1/face-swap`
|
|
10
|
+
|
|
11
|
+
#### Synchronous Client
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from magic_hour import Client
|
|
15
|
+
from os import getenv
|
|
16
|
+
|
|
17
|
+
client = Client(token=getenv("API_TOKEN"))
|
|
18
|
+
res = client.v1.face_swap.create(
|
|
19
|
+
assets={
|
|
20
|
+
"image_file_path": "image/id/1234.png",
|
|
21
|
+
"video_file_path": "api-assets/id/1234.mp4",
|
|
22
|
+
"video_source": "file",
|
|
23
|
+
},
|
|
24
|
+
end_seconds=15.0,
|
|
25
|
+
start_seconds=0.0,
|
|
26
|
+
height=960,
|
|
27
|
+
name="Face Swap video",
|
|
28
|
+
width=512,
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
#### Asynchronous Client
|
|
34
|
+
|
|
35
|
+
```python
|
|
36
|
+
from magic_hour import AsyncClient
|
|
37
|
+
from os import getenv
|
|
38
|
+
|
|
39
|
+
client = AsyncClient(token=getenv("API_TOKEN"))
|
|
40
|
+
res = await client.v1.face_swap.create(
|
|
41
|
+
assets={
|
|
42
|
+
"image_file_path": "image/id/1234.png",
|
|
43
|
+
"video_file_path": "api-assets/id/1234.mp4",
|
|
44
|
+
"video_source": "file",
|
|
45
|
+
},
|
|
46
|
+
end_seconds=15.0,
|
|
47
|
+
start_seconds=0.0,
|
|
48
|
+
height=960,
|
|
49
|
+
name="Face Swap video",
|
|
50
|
+
width=512,
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
#### Parameters
|
|
56
|
+
|
|
57
|
+
| Parameter | Required | Description | Example |
|
|
58
|
+
|-----------|:--------:|-------------|--------|
|
|
59
|
+
| `assets` | ✓ | Provide the assets for face swap. For video, The `video_source` field determines whether `video_file_path` or `youtube_url` field is used | `{"image_file_path": "image/id/1234.png", "video_file_path": "api-assets/id/1234.mp4", "video_source": "file"}` |
|
|
60
|
+
| `end_seconds` | ✓ | The end time of the input video in seconds | `15.0` |
|
|
61
|
+
| `start_seconds` | ✓ | The start time of the input video in seconds | `0.0` |
|
|
62
|
+
| `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` |
|
|
63
|
+
| `name` | ✗ | The name of video | `"Face Swap video"` |
|
|
64
|
+
| `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` |
|
|
@@ -19,6 +19,7 @@ res = client.v1.face_swap_photo.create(
|
|
|
19
19
|
},
|
|
20
20
|
name="Face Swap image",
|
|
21
21
|
)
|
|
22
|
+
|
|
22
23
|
```
|
|
23
24
|
|
|
24
25
|
#### Asynchronous Client
|
|
@@ -35,4 +36,12 @@ res = await client.v1.face_swap_photo.create(
|
|
|
35
36
|
},
|
|
36
37
|
name="Face Swap image",
|
|
37
38
|
)
|
|
39
|
+
|
|
38
40
|
```
|
|
41
|
+
|
|
42
|
+
#### Parameters
|
|
43
|
+
|
|
44
|
+
| Parameter | Required | Description | Example |
|
|
45
|
+
|-----------|:--------:|-------------|--------|
|
|
46
|
+
| `assets` | ✓ | Provide the assets for face swap photo | `{"source_file_path": "api-assets/id/1234.png", "target_file_path": "api-assets/id/1234.png"}` |
|
|
47
|
+
| `name` | ✗ | The name of image | `"Face Swap image"` |
|
|
@@ -37,6 +37,7 @@ res = client.v1.files.upload_urls.create(
|
|
|
37
37
|
{"extension": "mp3", "type_": "audio"},
|
|
38
38
|
]
|
|
39
39
|
)
|
|
40
|
+
|
|
40
41
|
```
|
|
41
42
|
|
|
42
43
|
#### Asynchronous Client
|
|
@@ -52,4 +53,11 @@ res = await client.v1.files.upload_urls.create(
|
|
|
52
53
|
{"extension": "mp3", "type_": "audio"},
|
|
53
54
|
]
|
|
54
55
|
)
|
|
56
|
+
|
|
55
57
|
```
|
|
58
|
+
|
|
59
|
+
#### Parameters
|
|
60
|
+
|
|
61
|
+
| Parameter | Required | Description | Example |
|
|
62
|
+
|-----------|:--------:|-------------|--------|
|
|
63
|
+
| `items` | ✓ | | `[{"extension": "mp4", "type_": "video"}, {"extension": "mp3", "type_": "audio"}]` |
|
{magic_hour-0.23.0 → magic_hour-0.24.0}/magic_hour/resources/v1/image_background_remover/README.md
RENAMED
|
@@ -16,6 +16,7 @@ res = client.v1.image_background_remover.create(
|
|
|
16
16
|
assets={"image_file_path": "api-assets/id/1234.png"},
|
|
17
17
|
name="Background Remover image",
|
|
18
18
|
)
|
|
19
|
+
|
|
19
20
|
```
|
|
20
21
|
|
|
21
22
|
#### Asynchronous Client
|
|
@@ -29,4 +30,12 @@ res = await client.v1.image_background_remover.create(
|
|
|
29
30
|
assets={"image_file_path": "api-assets/id/1234.png"},
|
|
30
31
|
name="Background Remover image",
|
|
31
32
|
)
|
|
33
|
+
|
|
32
34
|
```
|
|
35
|
+
|
|
36
|
+
#### Parameters
|
|
37
|
+
|
|
38
|
+
| Parameter | Required | Description | Example |
|
|
39
|
+
|-----------|:--------:|-------------|--------|
|
|
40
|
+
| `assets` | ✓ | Provide the assets for background removal | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
41
|
+
| `name` | ✗ | The name of image | `"Background Remover image"` |
|
|
@@ -13,6 +13,7 @@ from os import getenv
|
|
|
13
13
|
|
|
14
14
|
client = Client(token=getenv("API_TOKEN"))
|
|
15
15
|
res = client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
|
|
16
|
+
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
#### Asynchronous Client
|
|
@@ -23,8 +24,15 @@ from os import getenv
|
|
|
23
24
|
|
|
24
25
|
client = AsyncClient(token=getenv("API_TOKEN"))
|
|
25
26
|
res = await client.v1.image_projects.delete(id="cm6pvghix03bvyz0zwash6noj")
|
|
27
|
+
|
|
26
28
|
```
|
|
27
29
|
|
|
30
|
+
#### Parameters
|
|
31
|
+
|
|
32
|
+
| Parameter | Required | Description | Example |
|
|
33
|
+
|-----------|:--------:|-------------|--------|
|
|
34
|
+
| `id` | ✓ | The id of the image project | `"cm6pvghix03bvyz0zwash6noj"` |
|
|
35
|
+
|
|
28
36
|
### Get image details <a name="get"></a>
|
|
29
37
|
|
|
30
38
|
Get the details of a image project. The `downloads` field will be empty unless the image was successfully rendered.
|
|
@@ -48,6 +56,7 @@ from os import getenv
|
|
|
48
56
|
|
|
49
57
|
client = Client(token=getenv("API_TOKEN"))
|
|
50
58
|
res = client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
|
|
59
|
+
|
|
51
60
|
```
|
|
52
61
|
|
|
53
62
|
#### Asynchronous Client
|
|
@@ -58,4 +67,11 @@ from os import getenv
|
|
|
58
67
|
|
|
59
68
|
client = AsyncClient(token=getenv("API_TOKEN"))
|
|
60
69
|
res = await client.v1.image_projects.get(id="cm6pvghix03bvyz0zwash6noj")
|
|
70
|
+
|
|
61
71
|
```
|
|
72
|
+
|
|
73
|
+
#### Parameters
|
|
74
|
+
|
|
75
|
+
| Parameter | Required | Description | Example |
|
|
76
|
+
|-----------|:--------:|-------------|--------|
|
|
77
|
+
| `id` | ✓ | The id of the image project | `"cm6pvghix03bvyz0zwash6noj"` |
|
|
@@ -23,6 +23,7 @@ res = client.v1.image_to_video.create(
|
|
|
23
23
|
name="Image To Video video",
|
|
24
24
|
width=512,
|
|
25
25
|
)
|
|
26
|
+
|
|
26
27
|
```
|
|
27
28
|
|
|
28
29
|
#### Asynchronous Client
|
|
@@ -40,4 +41,16 @@ res = await client.v1.image_to_video.create(
|
|
|
40
41
|
name="Image To Video video",
|
|
41
42
|
width=512,
|
|
42
43
|
)
|
|
44
|
+
|
|
43
45
|
```
|
|
46
|
+
|
|
47
|
+
#### Parameters
|
|
48
|
+
|
|
49
|
+
| Parameter | Required | Description | Example |
|
|
50
|
+
|-----------|:--------:|-------------|--------|
|
|
51
|
+
| `assets` | ✓ | Provide the assets for image-to-video. | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
52
|
+
| `end_seconds` | ✓ | The total duration of the output video in seconds. | `5.0` |
|
|
53
|
+
| `style` | ✓ | Attributed used to dictate the style of the output | `{"prompt": "a dog running"}` |
|
|
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` |
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
### Lip Sync <a name="create"></a>
|
|
3
|
+
|
|
4
|
+
Create a Lip Sync video. The estimated frame cost is calculated using 30 FPS. This amount is deducted from your account balance when a video is queued. Once the video is complete, the cost will be updated based on the actual number of frames rendered.
|
|
5
|
+
|
|
6
|
+
Get more information about this mode at our [product page](/products/lip-sync).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
**API Endpoint**: `POST /v1/lip-sync`
|
|
10
|
+
|
|
11
|
+
#### Synchronous Client
|
|
12
|
+
|
|
13
|
+
```python
|
|
14
|
+
from magic_hour import Client
|
|
15
|
+
from os import getenv
|
|
16
|
+
|
|
17
|
+
client = Client(token=getenv("API_TOKEN"))
|
|
18
|
+
res = client.v1.lip_sync.create(
|
|
19
|
+
assets={
|
|
20
|
+
"audio_file_path": "api-assets/id/1234.mp3",
|
|
21
|
+
"video_file_path": "api-assets/id/1234.mp4",
|
|
22
|
+
"video_source": "file",
|
|
23
|
+
},
|
|
24
|
+
end_seconds=15.0,
|
|
25
|
+
start_seconds=0.0,
|
|
26
|
+
height=960,
|
|
27
|
+
max_fps_limit=12.0,
|
|
28
|
+
name="Lip Sync video",
|
|
29
|
+
width=512,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
#### Asynchronous Client
|
|
35
|
+
|
|
36
|
+
```python
|
|
37
|
+
from magic_hour import AsyncClient
|
|
38
|
+
from os import getenv
|
|
39
|
+
|
|
40
|
+
client = AsyncClient(token=getenv("API_TOKEN"))
|
|
41
|
+
res = await client.v1.lip_sync.create(
|
|
42
|
+
assets={
|
|
43
|
+
"audio_file_path": "api-assets/id/1234.mp3",
|
|
44
|
+
"video_file_path": "api-assets/id/1234.mp4",
|
|
45
|
+
"video_source": "file",
|
|
46
|
+
},
|
|
47
|
+
end_seconds=15.0,
|
|
48
|
+
start_seconds=0.0,
|
|
49
|
+
height=960,
|
|
50
|
+
max_fps_limit=12.0,
|
|
51
|
+
name="Lip Sync video",
|
|
52
|
+
width=512,
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
#### Parameters
|
|
58
|
+
|
|
59
|
+
| Parameter | Required | Description | Example |
|
|
60
|
+
|-----------|:--------:|-------------|--------|
|
|
61
|
+
| `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"}` |
|
|
62
|
+
| `end_seconds` | ✓ | The end time of the input video in seconds | `15.0` |
|
|
63
|
+
| `start_seconds` | ✓ | The start time of the input video in seconds | `0.0` |
|
|
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` |
|
|
@@ -15,6 +15,7 @@ client = Client(token=getenv("API_TOKEN"))
|
|
|
15
15
|
res = client.v1.photo_colorizer.create(
|
|
16
16
|
assets={"image_file_path": "api-assets/id/1234.png"}, name="Photo Colorizer image"
|
|
17
17
|
)
|
|
18
|
+
|
|
18
19
|
```
|
|
19
20
|
|
|
20
21
|
#### Asynchronous Client
|
|
@@ -27,4 +28,12 @@ client = AsyncClient(token=getenv("API_TOKEN"))
|
|
|
27
28
|
res = await client.v1.photo_colorizer.create(
|
|
28
29
|
assets={"image_file_path": "api-assets/id/1234.png"}, name="Photo Colorizer image"
|
|
29
30
|
)
|
|
31
|
+
|
|
30
32
|
```
|
|
33
|
+
|
|
34
|
+
#### Parameters
|
|
35
|
+
|
|
36
|
+
| Parameter | Required | Description | Example |
|
|
37
|
+
|-----------|:--------:|-------------|--------|
|
|
38
|
+
| `assets` | ✓ | Provide the assets for photo colorization | `{"image_file_path": "api-assets/id/1234.png"}` |
|
|
39
|
+
| `name` | ✗ | The name of image | `"Photo Colorizer image"` |
|
|
@@ -21,6 +21,7 @@ res = client.v1.text_to_video.create(
|
|
|
21
21
|
style={"prompt": "a dog running"},
|
|
22
22
|
name="Text To Video video",
|
|
23
23
|
)
|
|
24
|
+
|
|
24
25
|
```
|
|
25
26
|
|
|
26
27
|
#### Asynchronous Client
|
|
@@ -36,4 +37,14 @@ res = await client.v1.text_to_video.create(
|
|
|
36
37
|
style={"prompt": "a dog running"},
|
|
37
38
|
name="Text To Video video",
|
|
38
39
|
)
|
|
40
|
+
|
|
39
41
|
```
|
|
42
|
+
|
|
43
|
+
#### Parameters
|
|
44
|
+
|
|
45
|
+
| Parameter | Required | Description | Example |
|
|
46
|
+
|-----------|:--------:|-------------|--------|
|
|
47
|
+
| `end_seconds` | ✓ | The total duration of the output video in seconds. | `5.0` |
|
|
48
|
+
| `orientation` | ✓ | Determines the orientation of the output video | `"landscape"` |
|
|
49
|
+
| `style` | ✓ | | `{"prompt": "a dog running"}` |
|
|
50
|
+
| `name` | ✗ | The name of video | `"Text To Video video"` |
|