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
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

106 changes: 104 additions & 2 deletions src/runwayml/resources/image_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1407,6 +1407,53 @@ def create(
"""
...

@overload
def create(
self,
*,
model: Literal["kling_4"],
prompt_image: Union[str, Iterable[object]],
duration: int | Omit = omit,
prompt_text: str | Omit = omit,
ratio: Literal["auto_720p", "auto_1080p"] | Omit = omit,
references: Iterable[image_to_video_create_params.Kling4Reference] | Omit = omit,
reference_videos: Iterable[object] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NewTaskCreatedResponse:
"""
This endpoint will start a new task to generate a video from an image.

Args:
prompt_image: The first frame of the video, or an array with a first frame and optional middle
and last frames. The video follows the first frame’s aspect ratio.

duration: The duration of the output video in seconds.

prompt_text: A text prompt describing what should happen in the video.

ratio: Output quality tier. The video keeps the input media framing.

references: Images of characters, objects or styles to use in the video. Up to 10 images in
total, frames included.

reference_videos: Up to 5 videos whose style, motion or camera work should guide the output,
together at most 30 seconds long.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
...

@required_args(
["duration", "model", "prompt_image", "prompt_text", "ratio"],
["model", "prompt_image", "ratio"],
Expand Down Expand Up @@ -1445,7 +1492,8 @@ def create(
| Literal["wan3_prime"]
| Literal["h3_max"]
| Literal["seedance2_5"]
| Literal["grok_imagine_1_5_lite"],
| Literal["grok_imagine_1_5_lite"]
| Literal["kling_4"],
prompt_image: Union[str, Iterable[image_to_video_create_params.Gen4_5PromptImagePromptImage]]
| Union[str, Iterable[image_to_video_create_params.Gen4TurboPromptImagePromptImage]]
| Union[str, Iterable[image_to_video_create_params.Veo3_1PromptImagePromptImage]]
Expand Down Expand Up @@ -1559,6 +1607,7 @@ def create(
"1080:1920",
]
| Literal["auto_480p", "auto_720p", "auto_1080p"]
| Literal["auto_720p", "auto_1080p"]
| Omit = omit,
content_moderation: image_to_video_create_params.Gen4_5ContentModeration
| image_to_video_create_params.Gen4TurboContentModeration
Expand Down Expand Up @@ -1593,6 +1642,7 @@ def create(
references: Union[str, Iterable[image_to_video_create_params.KlingO3_4kReferencesReferenceImage]]
| Union[str, Iterable[image_to_video_create_params.KlingO3ProReferencesReferenceImage]]
| Union[str, Iterable[image_to_video_create_params.KlingO3StandardReferencesReferenceImage]]
| Iterable[image_to_video_create_params.Kling4Reference]
| Omit = omit,
reference_audio: Iterable[image_to_video_create_params.Hailuo3ReferenceAudio]
| Iterable[image_to_video_create_params.Seedance2ReferenceAudio]
Expand All @@ -1610,6 +1660,7 @@ def create(
cfg_scale: float | Omit = omit,
reference_videos: Iterable[image_to_video_create_params.Wan3ReferenceVideo]
| Iterable[image_to_video_create_params.Wan3PrimeReferenceVideo]
| Iterable[object]
| Omit = omit,
prompt_expansion_mode: Literal["disabled", "balanced", "quality"] | Omit = omit,
draft: bool | Omit = omit,
Expand Down Expand Up @@ -3030,6 +3081,53 @@ async def create(
"""
...

@overload
async def create(
self,
*,
model: Literal["kling_4"],
prompt_image: Union[str, Iterable[object]],
duration: int | Omit = omit,
prompt_text: str | Omit = omit,
ratio: Literal["auto_720p", "auto_1080p"] | Omit = omit,
references: Iterable[image_to_video_create_params.Kling4Reference] | Omit = omit,
reference_videos: Iterable[object] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncNewTaskCreatedResponse:
"""
This endpoint will start a new task to generate a video from an image.

Args:
prompt_image: The first frame of the video, or an array with a first frame and optional middle
and last frames. The video follows the first frame’s aspect ratio.

duration: The duration of the output video in seconds.

prompt_text: A text prompt describing what should happen in the video.

ratio: Output quality tier. The video keeps the input media framing.

references: Images of characters, objects or styles to use in the video. Up to 10 images in
total, frames included.

reference_videos: Up to 5 videos whose style, motion or camera work should guide the output,
together at most 30 seconds long.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
...

@required_args(
["duration", "model", "prompt_image", "prompt_text", "ratio"],
["model", "prompt_image", "ratio"],
Expand Down Expand Up @@ -3068,7 +3166,8 @@ async def create(
| Literal["wan3_prime"]
| Literal["h3_max"]
| Literal["seedance2_5"]
| Literal["grok_imagine_1_5_lite"],
| Literal["grok_imagine_1_5_lite"]
| Literal["kling_4"],
prompt_image: Union[str, Iterable[image_to_video_create_params.Gen4_5PromptImagePromptImage]]
| Union[str, Iterable[image_to_video_create_params.Gen4TurboPromptImagePromptImage]]
| Union[str, Iterable[image_to_video_create_params.Veo3_1PromptImagePromptImage]]
Expand Down Expand Up @@ -3182,6 +3281,7 @@ async def create(
"1080:1920",
]
| Literal["auto_480p", "auto_720p", "auto_1080p"]
| Literal["auto_720p", "auto_1080p"]
| Omit = omit,
content_moderation: image_to_video_create_params.Gen4_5ContentModeration
| image_to_video_create_params.Gen4TurboContentModeration
Expand Down Expand Up @@ -3216,6 +3316,7 @@ async def create(
references: Union[str, Iterable[image_to_video_create_params.KlingO3_4kReferencesReferenceImage]]
| Union[str, Iterable[image_to_video_create_params.KlingO3ProReferencesReferenceImage]]
| Union[str, Iterable[image_to_video_create_params.KlingO3StandardReferencesReferenceImage]]
| Iterable[image_to_video_create_params.Kling4Reference]
| Omit = omit,
reference_audio: Iterable[image_to_video_create_params.Hailuo3ReferenceAudio]
| Iterable[image_to_video_create_params.Seedance2ReferenceAudio]
Expand All @@ -3233,6 +3334,7 @@ async def create(
cfg_scale: float | Omit = omit,
reference_videos: Iterable[image_to_video_create_params.Wan3ReferenceVideo]
| Iterable[image_to_video_create_params.Wan3PrimeReferenceVideo]
| Iterable[object]
| Omit = omit,
prompt_expansion_mode: Literal["disabled", "balanced", "quality"] | Omit = omit,
draft: bool | Omit = omit,
Expand Down
146 changes: 144 additions & 2 deletions src/runwayml/resources/text_to_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,62 @@ def create(
"""
...

@overload
def create(
self,
*,
model: Literal["kling_4"],
prompt_text: str,
duration: int | Omit = omit,
ratio: Literal[
"1280:720",
"720:1280",
"940:940",
"1460:624",
"1920:1080",
"1080:1920",
"1440:1440",
"2200:940",
"auto_720p",
"auto_1080p",
]
| Omit = omit,
references: Iterable[text_to_video_create_params.Kling4Reference] | Omit = omit,
reference_videos: Iterable[object] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> NewTaskCreatedResponse:
"""
This endpoint will start a new task to generate a video from a text prompt.

Args:
prompt_text: A text prompt describing what should happen in the video.

duration: The duration of the output video in seconds.

ratio: The target output size. Use a pixel ratio such as `1280:720` or `auto_720p` /
`auto_1080p` for adaptive framing.

references: Images of characters, objects or styles to use in the video. Up to 10 images in
total, frames included.

reference_videos: Up to 5 videos whose style, motion or camera work should guide the output,
together at most 30 seconds long.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
...

@required_args(
["duration", "model", "prompt_text", "ratio"],
["model", "prompt_text", "ratio"],
Expand Down Expand Up @@ -1374,7 +1430,8 @@ def create(
| Literal["wan3_prime"]
| Literal["h3_max"]
| Literal["seedance2_5"]
| Literal["grok_imagine_1_5_lite"],
| Literal["grok_imagine_1_5_lite"]
| Literal["kling_4"],
prompt_text: str | Omit = omit,
ratio: Literal["1280:720", "720:1280"]
| Literal["1280:720", "720:1280", "1080:1920", "1920:1080"]
Expand Down Expand Up @@ -1500,6 +1557,18 @@ def create(
"1744:1152",
"1152:1744",
]
| Literal[
"1280:720",
"720:1280",
"940:940",
"1460:624",
"1920:1080",
"1080:1920",
"1440:1440",
"2200:940",
"auto_720p",
"auto_1080p",
]
| Omit = omit,
content_moderation: text_to_video_create_params.Gen4_5ContentModeration | Omit = omit,
output_format: Literal[
Expand Down Expand Up @@ -1547,6 +1616,7 @@ def create(
| Iterable[text_to_video_create_params.GeminiOmniFlash1_1Reference]
| Iterable[text_to_video_create_params.Wan3PrimeReference]
| Iterable[text_to_video_create_params.Seedance2_5Reference]
| Iterable[text_to_video_create_params.Kling4Reference]
| Omit = omit,
reference_videos: Iterable[text_to_video_create_params.Hailuo3ReferenceVideo]
| Iterable[text_to_video_create_params.Seedance2ReferenceVideo]
Expand All @@ -1556,6 +1626,7 @@ def create(
| Iterable[text_to_video_create_params.GeminiOmniFlash1_1ReferenceVideo]
| Iterable[text_to_video_create_params.Wan3PrimeReferenceVideo]
| Iterable[text_to_video_create_params.Seedance2_5ReferenceVideo]
| Iterable[object]
| Omit = omit,
resolution: Literal["768p", "2k", "768P", "2K"]
| Literal["480p", "720p", "1080p"]
Expand Down Expand Up @@ -2911,6 +2982,62 @@ async def create(
"""
...

@overload
async def create(
self,
*,
model: Literal["kling_4"],
prompt_text: str,
duration: int | Omit = omit,
ratio: Literal[
"1280:720",
"720:1280",
"940:940",
"1460:624",
"1920:1080",
"1080:1920",
"1440:1440",
"2200:940",
"auto_720p",
"auto_1080p",
]
| Omit = omit,
references: Iterable[text_to_video_create_params.Kling4Reference] | Omit = omit,
reference_videos: Iterable[object] | Omit = omit,
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
# The extra values given here take precedence over values defined on the client or passed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = not_given,
) -> AsyncNewTaskCreatedResponse:
"""
This endpoint will start a new task to generate a video from a text prompt.

Args:
prompt_text: A text prompt describing what should happen in the video.

duration: The duration of the output video in seconds.

ratio: The target output size. Use a pixel ratio such as `1280:720` or `auto_720p` /
`auto_1080p` for adaptive framing.

references: Images of characters, objects or styles to use in the video. Up to 10 images in
total, frames included.

reference_videos: Up to 5 videos whose style, motion or camera work should guide the output,
together at most 30 seconds long.

extra_headers: Send extra headers

extra_query: Add additional query parameters to the request

extra_body: Add additional JSON properties to the request

timeout: Override the client-level default timeout for this request, in seconds
"""
...

@required_args(
["duration", "model", "prompt_text", "ratio"],
["model", "prompt_text", "ratio"],
Expand Down Expand Up @@ -2949,7 +3076,8 @@ async def create(
| Literal["wan3_prime"]
| Literal["h3_max"]
| Literal["seedance2_5"]
| Literal["grok_imagine_1_5_lite"],
| Literal["grok_imagine_1_5_lite"]
| Literal["kling_4"],
prompt_text: str | Omit = omit,
ratio: Literal["1280:720", "720:1280"]
| Literal["1280:720", "720:1280", "1080:1920", "1920:1080"]
Expand Down Expand Up @@ -3075,6 +3203,18 @@ async def create(
"1744:1152",
"1152:1744",
]
| Literal[
"1280:720",
"720:1280",
"940:940",
"1460:624",
"1920:1080",
"1080:1920",
"1440:1440",
"2200:940",
"auto_720p",
"auto_1080p",
]
| Omit = omit,
content_moderation: text_to_video_create_params.Gen4_5ContentModeration | Omit = omit,
output_format: Literal[
Expand Down Expand Up @@ -3122,6 +3262,7 @@ async def create(
| Iterable[text_to_video_create_params.GeminiOmniFlash1_1Reference]
| Iterable[text_to_video_create_params.Wan3PrimeReference]
| Iterable[text_to_video_create_params.Seedance2_5Reference]
| Iterable[text_to_video_create_params.Kling4Reference]
| Omit = omit,
reference_videos: Iterable[text_to_video_create_params.Hailuo3ReferenceVideo]
| Iterable[text_to_video_create_params.Seedance2ReferenceVideo]
Expand All @@ -3131,6 +3272,7 @@ async def create(
| Iterable[text_to_video_create_params.GeminiOmniFlash1_1ReferenceVideo]
| Iterable[text_to_video_create_params.Wan3PrimeReferenceVideo]
| Iterable[text_to_video_create_params.Seedance2_5ReferenceVideo]
| Iterable[object]
| Omit = omit,
resolution: Literal["768p", "2k", "768P", "2K"]
| Literal["480p", "720p", "1080p"]
Expand Down
Loading
Loading