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
657 changes: 657 additions & 0 deletions codemod/generate_asset_types.py

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions magic_hour/types/params/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
V1AiClothesChangerCreateBodyAssets,
_SerializerV1AiClothesChangerCreateBodyAssets,
)
from .v1_ai_clothes_changer_generate_body_assets import (
V1AiClothesChangerGenerateBodyAssets,
)
from .v1_ai_face_editor_create_body import (
V1AiFaceEditorCreateBody,
_SerializerV1AiFaceEditorCreateBody,
Expand All @@ -18,6 +21,7 @@
V1AiFaceEditorCreateBodyStyle,
_SerializerV1AiFaceEditorCreateBodyStyle,
)
from .v1_ai_face_editor_generate_body_assets import V1AiFaceEditorGenerateBodyAssets
from .v1_ai_gif_generator_create_body import (
V1AiGifGeneratorCreateBody,
_SerializerV1AiGifGeneratorCreateBody,
Expand All @@ -38,6 +42,9 @@
V1AiHeadshotGeneratorCreateBodyStyle,
_SerializerV1AiHeadshotGeneratorCreateBodyStyle,
)
from .v1_ai_headshot_generator_generate_body_assets import (
V1AiHeadshotGeneratorGenerateBodyAssets,
)
from .v1_ai_image_editor_create_body import (
V1AiImageEditorCreateBody,
_SerializerV1AiImageEditorCreateBody,
Expand All @@ -50,6 +57,7 @@
V1AiImageEditorCreateBodyStyle,
_SerializerV1AiImageEditorCreateBodyStyle,
)
from .v1_ai_image_editor_generate_body_assets import V1AiImageEditorGenerateBodyAssets
from .v1_ai_image_generator_create_body import (
V1AiImageGeneratorCreateBody,
_SerializerV1AiImageGeneratorCreateBody,
Expand All @@ -70,6 +78,9 @@
V1AiImageUpscalerCreateBodyStyle,
_SerializerV1AiImageUpscalerCreateBodyStyle,
)
from .v1_ai_image_upscaler_generate_body_assets import (
V1AiImageUpscalerGenerateBodyAssets,
)
from .v1_ai_meme_generator_create_body import (
V1AiMemeGeneratorCreateBody,
_SerializerV1AiMemeGeneratorCreateBody,
Expand All @@ -90,6 +101,7 @@
V1AiPhotoEditorCreateBodyStyle,
_SerializerV1AiPhotoEditorCreateBodyStyle,
)
from .v1_ai_photo_editor_generate_body_assets import V1AiPhotoEditorGenerateBodyAssets
from .v1_ai_qr_code_generator_create_body import (
V1AiQrCodeGeneratorCreateBody,
_SerializerV1AiQrCodeGeneratorCreateBody,
Expand All @@ -110,6 +122,7 @@
V1AiTalkingPhotoCreateBodyStyle,
_SerializerV1AiTalkingPhotoCreateBodyStyle,
)
from .v1_ai_talking_photo_generate_body_assets import V1AiTalkingPhotoGenerateBodyAssets
from .v1_animation_create_body import (
V1AnimationCreateBody,
_SerializerV1AnimationCreateBody,
Expand All @@ -122,6 +135,7 @@
V1AnimationCreateBodyStyle,
_SerializerV1AnimationCreateBodyStyle,
)
from .v1_animation_generate_body_assets import V1AnimationGenerateBodyAssets
from .v1_auto_subtitle_generator_create_body import (
V1AutoSubtitleGeneratorCreateBody,
_SerializerV1AutoSubtitleGeneratorCreateBody,
Expand All @@ -138,6 +152,9 @@
V1AutoSubtitleGeneratorCreateBodyStyleCustomConfig,
_SerializerV1AutoSubtitleGeneratorCreateBodyStyleCustomConfig,
)
from .v1_auto_subtitle_generator_generate_body_assets import (
V1AutoSubtitleGeneratorGenerateBodyAssets,
)
from .v1_face_detection_create_body import (
V1FaceDetectionCreateBody,
_SerializerV1FaceDetectionCreateBody,
Expand All @@ -146,6 +163,7 @@
V1FaceDetectionCreateBodyAssets,
_SerializerV1FaceDetectionCreateBodyAssets,
)
from .v1_face_detection_generate_body_assets import V1FaceDetectionGenerateBodyAssets
from .v1_face_swap_create_body import (
V1FaceSwapCreateBody,
_SerializerV1FaceSwapCreateBody,
Expand All @@ -158,6 +176,10 @@
V1FaceSwapCreateBodyAssetsFaceMappingsItem,
_SerializerV1FaceSwapCreateBodyAssetsFaceMappingsItem,
)
from .v1_face_swap_generate_body_assets import V1FaceSwapGenerateBodyAssets
from .v1_face_swap_generate_body_assets_face_mappings_item import (
V1FaceSwapGenerateBodyAssetsFaceMappingsItem,
)
from .v1_face_swap_photo_create_body import (
V1FaceSwapPhotoCreateBody,
_SerializerV1FaceSwapPhotoCreateBody,
Expand All @@ -170,6 +192,10 @@
V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem,
_SerializerV1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem,
)
from .v1_face_swap_photo_generate_body_assets import V1FaceSwapPhotoGenerateBodyAssets
from .v1_face_swap_photo_generate_body_assets_face_mappings_item import (
V1FaceSwapPhotoGenerateBodyAssetsFaceMappingsItem,
)
from .v1_files_upload_urls_create_body import (
V1FilesUploadUrlsCreateBody,
_SerializerV1FilesUploadUrlsCreateBody,
Expand All @@ -186,6 +212,9 @@
V1ImageBackgroundRemoverCreateBodyAssets,
_SerializerV1ImageBackgroundRemoverCreateBodyAssets,
)
from .v1_image_background_remover_generate_body_assets import (
V1ImageBackgroundRemoverGenerateBodyAssets,
)
from .v1_image_to_video_create_body import (
V1ImageToVideoCreateBody,
_SerializerV1ImageToVideoCreateBody,
Expand All @@ -198,11 +227,13 @@
V1ImageToVideoCreateBodyStyle,
_SerializerV1ImageToVideoCreateBodyStyle,
)
from .v1_image_to_video_generate_body_assets import V1ImageToVideoGenerateBodyAssets
from .v1_lip_sync_create_body import V1LipSyncCreateBody, _SerializerV1LipSyncCreateBody
from .v1_lip_sync_create_body_assets import (
V1LipSyncCreateBodyAssets,
_SerializerV1LipSyncCreateBodyAssets,
)
from .v1_lip_sync_generate_body_assets import V1LipSyncGenerateBodyAssets
from .v1_photo_colorizer_create_body import (
V1PhotoColorizerCreateBody,
_SerializerV1PhotoColorizerCreateBody,
Expand All @@ -211,6 +242,7 @@
V1PhotoColorizerCreateBodyAssets,
_SerializerV1PhotoColorizerCreateBodyAssets,
)
from .v1_photo_colorizer_generate_body_assets import V1PhotoColorizerGenerateBodyAssets
from .v1_text_to_video_create_body import (
V1TextToVideoCreateBody,
_SerializerV1TextToVideoCreateBody,
Expand All @@ -231,68 +263,88 @@
V1VideoToVideoCreateBodyStyle,
_SerializerV1VideoToVideoCreateBodyStyle,
)
from .v1_video_to_video_generate_body_assets import V1VideoToVideoGenerateBodyAssets


__all__ = [
"V1AiClothesChangerCreateBody",
"V1AiClothesChangerCreateBodyAssets",
"V1AiClothesChangerGenerateBodyAssets",
"V1AiFaceEditorCreateBody",
"V1AiFaceEditorCreateBodyAssets",
"V1AiFaceEditorCreateBodyStyle",
"V1AiFaceEditorGenerateBodyAssets",
"V1AiGifGeneratorCreateBody",
"V1AiGifGeneratorCreateBodyStyle",
"V1AiHeadshotGeneratorCreateBody",
"V1AiHeadshotGeneratorCreateBodyAssets",
"V1AiHeadshotGeneratorCreateBodyStyle",
"V1AiHeadshotGeneratorGenerateBodyAssets",
"V1AiImageEditorCreateBody",
"V1AiImageEditorCreateBodyAssets",
"V1AiImageEditorCreateBodyStyle",
"V1AiImageEditorGenerateBodyAssets",
"V1AiImageGeneratorCreateBody",
"V1AiImageGeneratorCreateBodyStyle",
"V1AiImageUpscalerCreateBody",
"V1AiImageUpscalerCreateBodyAssets",
"V1AiImageUpscalerCreateBodyStyle",
"V1AiImageUpscalerGenerateBodyAssets",
"V1AiMemeGeneratorCreateBody",
"V1AiMemeGeneratorCreateBodyStyle",
"V1AiPhotoEditorCreateBody",
"V1AiPhotoEditorCreateBodyAssets",
"V1AiPhotoEditorCreateBodyStyle",
"V1AiPhotoEditorGenerateBodyAssets",
"V1AiQrCodeGeneratorCreateBody",
"V1AiQrCodeGeneratorCreateBodyStyle",
"V1AiTalkingPhotoCreateBody",
"V1AiTalkingPhotoCreateBodyAssets",
"V1AiTalkingPhotoCreateBodyStyle",
"V1AiTalkingPhotoGenerateBodyAssets",
"V1AnimationCreateBody",
"V1AnimationCreateBodyAssets",
"V1AnimationCreateBodyStyle",
"V1AnimationGenerateBodyAssets",
"V1AutoSubtitleGeneratorCreateBody",
"V1AutoSubtitleGeneratorCreateBodyAssets",
"V1AutoSubtitleGeneratorCreateBodyStyle",
"V1AutoSubtitleGeneratorCreateBodyStyleCustomConfig",
"V1AutoSubtitleGeneratorGenerateBodyAssets",
"V1FaceDetectionCreateBody",
"V1FaceDetectionCreateBodyAssets",
"V1FaceDetectionGenerateBodyAssets",
"V1FaceSwapCreateBody",
"V1FaceSwapCreateBodyAssets",
"V1FaceSwapCreateBodyAssetsFaceMappingsItem",
"V1FaceSwapGenerateBodyAssets",
"V1FaceSwapGenerateBodyAssetsFaceMappingsItem",
"V1FaceSwapPhotoCreateBody",
"V1FaceSwapPhotoCreateBodyAssets",
"V1FaceSwapPhotoCreateBodyAssetsFaceMappingsItem",
"V1FaceSwapPhotoGenerateBodyAssets",
"V1FaceSwapPhotoGenerateBodyAssetsFaceMappingsItem",
"V1FilesUploadUrlsCreateBody",
"V1FilesUploadUrlsCreateBodyItemsItem",
"V1ImageBackgroundRemoverCreateBody",
"V1ImageBackgroundRemoverCreateBodyAssets",
"V1ImageBackgroundRemoverGenerateBodyAssets",
"V1ImageToVideoCreateBody",
"V1ImageToVideoCreateBodyAssets",
"V1ImageToVideoCreateBodyStyle",
"V1ImageToVideoGenerateBodyAssets",
"V1LipSyncCreateBody",
"V1LipSyncCreateBodyAssets",
"V1LipSyncGenerateBodyAssets",
"V1PhotoColorizerCreateBody",
"V1PhotoColorizerCreateBodyAssets",
"V1PhotoColorizerGenerateBodyAssets",
"V1TextToVideoCreateBody",
"V1TextToVideoCreateBodyStyle",
"V1VideoToVideoCreateBody",
"V1VideoToVideoCreateBodyAssets",
"V1VideoToVideoCreateBodyStyle",
"V1VideoToVideoGenerateBodyAssets",
"_SerializerV1AiClothesChangerCreateBody",
"_SerializerV1AiClothesChangerCreateBodyAssets",
"_SerializerV1AiFaceEditorCreateBody",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import pydantic
import typing_extensions


class V1AiClothesChangerGenerateBodyAssets(typing_extensions.TypedDict):
"""
Provide the assets for clothes changer
"""

garment_file_path: typing_extensions.Required[str]
"""
The image of the outfit. This value is either
- a direct URL to the image file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""

garment_type: typing_extensions.Required[
typing_extensions.Literal["dresses", "lower_body", "upper_body"]
]
"""
The type of the outfit.
"""

person_file_path: typing_extensions.Required[str]
"""
The image with the person. This value is either
- a direct URL to the image file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""
17 changes: 17 additions & 0 deletions magic_hour/types/params/v1_ai_face_editor_generate_body_assets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pydantic
import typing_extensions


class V1AiFaceEditorGenerateBodyAssets(typing_extensions.TypedDict):
"""
Provide the assets for face editor
"""

image_file_path: typing_extensions.Required[str]
"""
This is the image whose face will be edited. This value is either
- a direct URL to the image file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pydantic
import typing_extensions


class V1AiHeadshotGeneratorGenerateBodyAssets(typing_extensions.TypedDict):
"""
Provide the assets for headshot photo
"""

image_file_path: typing_extensions.Required[str]
"""
The image used to generate the headshot. This image must contain one detectable face. This value is either
- a direct URL to the image file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""
17 changes: 17 additions & 0 deletions magic_hour/types/params/v1_ai_image_editor_generate_body_assets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pydantic
import typing_extensions


class V1AiImageEditorGenerateBodyAssets(typing_extensions.TypedDict):
"""
Provide the assets for image edit
"""

image_file_path: typing_extensions.Required[str]
"""
The image used in the edit. This value is either
- a direct URL to the image file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pydantic
import typing_extensions


class V1AiImageUpscalerGenerateBodyAssets(typing_extensions.TypedDict):
"""
Provide the assets for upscaling
"""

image_file_path: typing_extensions.Required[str]
"""
The image to upscale. This value is either
- a direct URL to the image file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""
17 changes: 17 additions & 0 deletions magic_hour/types/params/v1_ai_photo_editor_generate_body_assets.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import pydantic
import typing_extensions


class V1AiPhotoEditorGenerateBodyAssets(typing_extensions.TypedDict):
"""
Provide the assets for photo editor
"""

image_file_path: typing_extensions.Required[str]
"""
The image used to generate the output. This value is either
- a direct URL to the image file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import pydantic
import typing_extensions


class V1AiTalkingPhotoGenerateBodyAssets(typing_extensions.TypedDict):
"""
Provide the assets for creating a talking photo
"""

audio_file_path: typing_extensions.Required[str]
"""
The audio file to sync with the image. This value is either
- a direct URL to the video file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""

image_file_path: typing_extensions.Required[str]
"""
The source image to animate. This value is either
- a direct URL to the video file
- a path to a local file

Note: if the path begins with `api-assets`, it will be assumed to already be uploaded to Magic Hour's storage, and will not be uploaded again.
"""
Loading