From 90bc24eda321b4a7f0b7ef3c923362c60ccc18f2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 19:26:48 +0000 Subject: [PATCH 1/3] feat(api): seedance2_fast --- .stats.yml | 4 +- src/runwayml/resources/image_to_video.py | 170 ++++++++++++++- src/runwayml/resources/text_to_video.py | 196 +++++++++++++++++- src/runwayml/resources/video_to_video.py | 194 ++++++++++++++++- .../types/image_to_video_create_params.py | 85 +++++++- .../organization_retrieve_usage_response.py | 2 + .../types/text_to_video_create_params.py | 101 ++++++++- .../types/video_to_video_create_params.py | 100 ++++++++- tests/api_resources/test_image_to_video.py | 116 ++++++++++- tests/api_resources/test_text_to_video.py | 134 +++++++++++- tests/api_resources/test_video_to_video.py | 128 ++++++++++++ 11 files changed, 1184 insertions(+), 46 deletions(-) diff --git a/.stats.yml b/.stats.yml index f14d7b2..6e10a1c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 38 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-a81793e83ebdccfc40ba42e5f36101fd6877703febd5f1476e8e6e9dabd505ab.yml -openapi_spec_hash: ea99f8ca625ee33071b0dc7a812fc222 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runwayml/runwayml-10c9a846a0c356c45d6896a3f4c2c8058a13dc31374f75859044270418dd5f5a.yml +openapi_spec_hash: 8dda646a596bd23feda0d25eca7abbfd config_hash: 6d8ca402de13857362ee587c404baca9 diff --git a/src/runwayml/resources/image_to_video.py b/src/runwayml/resources/image_to_video.py index 8e3d57a..e16de5f 100644 --- a/src/runwayml/resources/image_to_video.py +++ b/src/runwayml/resources/image_to_video.py @@ -370,8 +370,8 @@ def create( duration: The number of seconds of duration for the output video. - prompt_text: An optional text prompt up to 3500 characters (measured in UTF-16 code units). - This should describe in detail what should appear in the output. + prompt_text: An optional text prompt up to 3500 characters describing what should appear in + the output. ratio: The resolution of the output video. @@ -388,6 +388,68 @@ def create( """ ... + @overload + def create( + self, + *, + model: Literal["seedance2_fast"], + prompt_image: Union[str, Iterable[image_to_video_create_params.Seedance2FastPromptImagePromptImage]], + audio: bool | Omit = omit, + duration: int | Omit = omit, + prompt_text: str | Omit = omit, + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + | Omit = omit, + reference_audio: Iterable[image_to_video_create_params.Seedance2FastReferenceAudio] | 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, + ) -> ImageToVideoCreateResponse: + """ + This endpoint will start a new task to generate a video from an image. + + Args: + prompt_image: An image or array of images. Use position `first`/`last` for keyframe mode, or + omit position for reference images. The two modes cannot be mixed. + + audio: Whether to generate audio for the video. Audio inclusion affects pricing. + + duration: The number of seconds of duration for the output video. + + prompt_text: An optional text prompt up to 3500 characters describing what should appear in + the output. + + ratio: The resolution of the output video. Seedance 2.0 Fast supports 480p and 720p + only. + + reference_audio: An optional array of audio references. Audio references require a text prompt, + and the total combined duration must not exceed 15 seconds. + + 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 + """ + ... + @overload def create( self, @@ -445,6 +507,7 @@ def create( | Literal["veo3.1_fast"] | Literal["happyhorse_1_0"] | Literal["seedance2"] + | Literal["seedance2_fast"] | Literal["veo3"], prompt_image: Union[str, Iterable[image_to_video_create_params.Gen4_5PromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Gen4TurboPromptImagePromptImage]] @@ -478,6 +541,20 @@ def create( "1248:1664", "1080:1920", ] + | Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] | Omit = omit, content_moderation: image_to_video_create_params.Gen4_5ContentModeration | image_to_video_create_params.Gen4TurboContentModeration @@ -486,7 +563,9 @@ def create( seed: int | Omit = omit, audio: bool | Omit = omit, resolution: Literal["720P", "1080P"] | Omit = omit, - reference_audio: Iterable[image_to_video_create_params.Seedance2ReferenceAudio] | Omit = omit, + reference_audio: Iterable[image_to_video_create_params.Seedance2ReferenceAudio] + | Iterable[image_to_video_create_params.Seedance2FastReferenceAudio] + | 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, @@ -858,8 +937,8 @@ async def create( duration: The number of seconds of duration for the output video. - prompt_text: An optional text prompt up to 3500 characters (measured in UTF-16 code units). - This should describe in detail what should appear in the output. + prompt_text: An optional text prompt up to 3500 characters describing what should appear in + the output. ratio: The resolution of the output video. @@ -876,6 +955,68 @@ async def create( """ ... + @overload + async def create( + self, + *, + model: Literal["seedance2_fast"], + prompt_image: Union[str, Iterable[image_to_video_create_params.Seedance2FastPromptImagePromptImage]], + audio: bool | Omit = omit, + duration: int | Omit = omit, + prompt_text: str | Omit = omit, + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + | Omit = omit, + reference_audio: Iterable[image_to_video_create_params.Seedance2FastReferenceAudio] | 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, + ) -> ImageToVideoCreateResponse: + """ + This endpoint will start a new task to generate a video from an image. + + Args: + prompt_image: An image or array of images. Use position `first`/`last` for keyframe mode, or + omit position for reference images. The two modes cannot be mixed. + + audio: Whether to generate audio for the video. Audio inclusion affects pricing. + + duration: The number of seconds of duration for the output video. + + prompt_text: An optional text prompt up to 3500 characters describing what should appear in + the output. + + ratio: The resolution of the output video. Seedance 2.0 Fast supports 480p and 720p + only. + + reference_audio: An optional array of audio references. Audio references require a text prompt, + and the total combined duration must not exceed 15 seconds. + + 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 + """ + ... + @overload async def create( self, @@ -933,6 +1074,7 @@ async def create( | Literal["veo3.1_fast"] | Literal["happyhorse_1_0"] | Literal["seedance2"] + | Literal["seedance2_fast"] | Literal["veo3"], prompt_image: Union[str, Iterable[image_to_video_create_params.Gen4_5PromptImagePromptImage]] | Union[str, Iterable[image_to_video_create_params.Gen4TurboPromptImagePromptImage]] @@ -966,6 +1108,20 @@ async def create( "1248:1664", "1080:1920", ] + | Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] | Omit = omit, content_moderation: image_to_video_create_params.Gen4_5ContentModeration | image_to_video_create_params.Gen4TurboContentModeration @@ -974,7 +1130,9 @@ async def create( seed: int | Omit = omit, audio: bool | Omit = omit, resolution: Literal["720P", "1080P"] | Omit = omit, - reference_audio: Iterable[image_to_video_create_params.Seedance2ReferenceAudio] | Omit = omit, + reference_audio: Iterable[image_to_video_create_params.Seedance2ReferenceAudio] + | Iterable[image_to_video_create_params.Seedance2FastReferenceAudio] + | 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, diff --git a/src/runwayml/resources/text_to_video.py b/src/runwayml/resources/text_to_video.py index 1d80ddb..9cb35a6 100644 --- a/src/runwayml/resources/text_to_video.py +++ b/src/runwayml/resources/text_to_video.py @@ -266,8 +266,8 @@ def create( This endpoint will start a new task to generate a video from a text prompt. Args: - prompt_text: A non-empty string up to 3500 characters (measured in UTF-16 code units). This - should describe in detail what should appear in the output. + prompt_text: A non-empty text prompt up to 3500 characters describing what should appear in + the output. audio: Whether to generate audio for the video. Audio inclusion affects pricing. @@ -295,6 +295,73 @@ def create( """ ... + @overload + def create( + self, + *, + model: Literal["seedance2_fast"], + prompt_text: str, + audio: bool | Omit = omit, + duration: int | Omit = omit, + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + | Omit = omit, + reference_audio: Iterable[text_to_video_create_params.Seedance2FastReferenceAudio] | Omit = omit, + references: Iterable[text_to_video_create_params.Seedance2FastReference] | Omit = omit, + reference_videos: Iterable[text_to_video_create_params.Seedance2FastReferenceVideo] | 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, + ) -> TextToVideoCreateResponse: + """ + This endpoint will start a new task to generate a video from a text prompt. + + Args: + prompt_text: A non-empty text prompt up to 3500 characters describing what should appear in + the output. + + audio: Whether to generate audio for the video. Audio inclusion affects pricing. + + duration: The number of seconds of duration for the output video. + + ratio: The resolution of the output video. Seedance 2.0 Fast supports 480p and 720p + only. + + reference_audio: An optional array of audio references. Audio references require a text prompt, + and the total combined duration must not exceed 15 seconds. + + references: An optional array of image references (up to 9). See + [our docs](/assets/inputs#images) on image inputs for more information. + + reference_videos: An optional array of video references. The combined duration across all video + references must not exceed 15 seconds. See [our docs](/assets/inputs#videos) on + video inputs for more information. + + 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 + """ + ... + @overload def create( self, @@ -343,6 +410,7 @@ def create( | Literal["veo3.1_fast"] | Literal["happyhorse_1_0"] | Literal["seedance2"] + | Literal["seedance2_fast"] | Literal["veo3"], prompt_text: str, ratio: Literal["1280:720", "720:1280"] @@ -379,13 +447,33 @@ def create( "1248:1664", "1080:1920", ] + | Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] | Omit = omit, content_moderation: text_to_video_create_params.Gen4_5ContentModeration | Omit = omit, seed: int | Omit = omit, audio: bool | Omit = omit, - reference_audio: Iterable[text_to_video_create_params.Seedance2ReferenceAudio] | Omit = omit, - references: Iterable[text_to_video_create_params.Seedance2Reference] | Omit = omit, - reference_videos: Iterable[text_to_video_create_params.Seedance2ReferenceVideo] | Omit = omit, + reference_audio: Iterable[text_to_video_create_params.Seedance2ReferenceAudio] + | Iterable[text_to_video_create_params.Seedance2FastReferenceAudio] + | Omit = omit, + references: Iterable[text_to_video_create_params.Seedance2Reference] + | Iterable[text_to_video_create_params.Seedance2FastReference] + | Omit = omit, + reference_videos: Iterable[text_to_video_create_params.Seedance2ReferenceVideo] + | Iterable[text_to_video_create_params.Seedance2FastReferenceVideo] + | 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, @@ -653,8 +741,8 @@ async def create( This endpoint will start a new task to generate a video from a text prompt. Args: - prompt_text: A non-empty string up to 3500 characters (measured in UTF-16 code units). This - should describe in detail what should appear in the output. + prompt_text: A non-empty text prompt up to 3500 characters describing what should appear in + the output. audio: Whether to generate audio for the video. Audio inclusion affects pricing. @@ -682,6 +770,73 @@ async def create( """ ... + @overload + async def create( + self, + *, + model: Literal["seedance2_fast"], + prompt_text: str, + audio: bool | Omit = omit, + duration: int | Omit = omit, + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + | Omit = omit, + reference_audio: Iterable[text_to_video_create_params.Seedance2FastReferenceAudio] | Omit = omit, + references: Iterable[text_to_video_create_params.Seedance2FastReference] | Omit = omit, + reference_videos: Iterable[text_to_video_create_params.Seedance2FastReferenceVideo] | 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, + ) -> TextToVideoCreateResponse: + """ + This endpoint will start a new task to generate a video from a text prompt. + + Args: + prompt_text: A non-empty text prompt up to 3500 characters describing what should appear in + the output. + + audio: Whether to generate audio for the video. Audio inclusion affects pricing. + + duration: The number of seconds of duration for the output video. + + ratio: The resolution of the output video. Seedance 2.0 Fast supports 480p and 720p + only. + + reference_audio: An optional array of audio references. Audio references require a text prompt, + and the total combined duration must not exceed 15 seconds. + + references: An optional array of image references (up to 9). See + [our docs](/assets/inputs#images) on image inputs for more information. + + reference_videos: An optional array of video references. The combined duration across all video + references must not exceed 15 seconds. See [our docs](/assets/inputs#videos) on + video inputs for more information. + + 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 + """ + ... + @overload async def create( self, @@ -730,6 +885,7 @@ async def create( | Literal["veo3.1_fast"] | Literal["happyhorse_1_0"] | Literal["seedance2"] + | Literal["seedance2_fast"] | Literal["veo3"], prompt_text: str, ratio: Literal["1280:720", "720:1280"] @@ -766,13 +922,33 @@ async def create( "1248:1664", "1080:1920", ] + | Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] | Omit = omit, content_moderation: text_to_video_create_params.Gen4_5ContentModeration | Omit = omit, seed: int | Omit = omit, audio: bool | Omit = omit, - reference_audio: Iterable[text_to_video_create_params.Seedance2ReferenceAudio] | Omit = omit, - references: Iterable[text_to_video_create_params.Seedance2Reference] | Omit = omit, - reference_videos: Iterable[text_to_video_create_params.Seedance2ReferenceVideo] | Omit = omit, + reference_audio: Iterable[text_to_video_create_params.Seedance2ReferenceAudio] + | Iterable[text_to_video_create_params.Seedance2FastReferenceAudio] + | Omit = omit, + references: Iterable[text_to_video_create_params.Seedance2Reference] + | Iterable[text_to_video_create_params.Seedance2FastReference] + | Omit = omit, + reference_videos: Iterable[text_to_video_create_params.Seedance2ReferenceVideo] + | Iterable[text_to_video_create_params.Seedance2FastReferenceVideo] + | 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, diff --git a/src/runwayml/resources/video_to_video.py b/src/runwayml/resources/video_to_video.py index eb2d335..58dedde 100644 --- a/src/runwayml/resources/video_to_video.py +++ b/src/runwayml/resources/video_to_video.py @@ -202,7 +202,7 @@ def create( duration: The number of seconds of duration for the output video. prompt_text: An optional text prompt up to 3500 characters describing what should appear in - the output video. + the output. ratio: The resolution of the output video. @@ -226,11 +226,81 @@ def create( """ ... + @overload + def create( + self, + *, + model: Literal["seedance2_fast"], + prompt_video: str, + audio: bool | Omit = omit, + duration: int | Omit = omit, + prompt_text: str | Omit = omit, + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + | Omit = omit, + reference_audio: Iterable[video_to_video_create_params.Seedance2FastReferenceAudio] | Omit = omit, + references: Iterable[video_to_video_create_params.Seedance2FastReference] | Omit = omit, + reference_videos: Iterable[video_to_video_create_params.Seedance2FastReferenceVideo] | 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, + ) -> VideoToVideoCreateResponse: + """ + This endpoint will start a new task to generate a video from a video. + + Args: + prompt_video: A HTTPS URL. + + audio: Whether to generate audio for the video. Audio inclusion affects pricing. + + duration: The number of seconds of duration for the output video. + + prompt_text: An optional text prompt up to 3500 characters describing what should appear in + the output. + + ratio: The resolution of the output video. Seedance 2.0 Fast supports 480p and 720p + only. + + reference_audio: An optional array of audio references. Audio references require a text prompt, + and the total combined duration must not exceed 15 seconds. + + references: An optional array of image references (up to 9). See + [our docs](/assets/inputs#images) on image inputs for more information. + + reference_videos: An optional array of video references. The combined duration across all video + references must not exceed 15 seconds. See [our docs](/assets/inputs#videos) on + video inputs for more information. + + 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(["model", "prompt_text", "video_uri"], ["model", "prompt_video"]) def create( self, *, - model: Literal["gen4_aleph"] | Literal["aleph2"] | Literal["seedance2"], + model: Literal["gen4_aleph"] | Literal["aleph2"] | Literal["seedance2"] | Literal["seedance2_fast"], prompt_text: str | Omit = omit, video_uri: str | Omit = omit, content_moderation: video_to_video_create_params.Gen4AlephContentModeration @@ -257,9 +327,24 @@ def create( "1248:1664", "1080:1920", ] + | Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] | Omit = omit, references: Iterable[video_to_video_create_params.Gen4AlephReference] | Iterable[video_to_video_create_params.Seedance2Reference] + | Iterable[video_to_video_create_params.Seedance2FastReference] | Omit = omit, seed: int | Omit = omit, keyframes: Iterable[video_to_video_create_params.Aleph2Keyframe] | Omit = omit, @@ -267,8 +352,12 @@ def create( prompt_video: str | Omit = omit, audio: bool | Omit = omit, duration: int | Omit = omit, - reference_audio: Iterable[video_to_video_create_params.Seedance2ReferenceAudio] | Omit = omit, - reference_videos: Iterable[video_to_video_create_params.Seedance2ReferenceVideo] | Omit = omit, + reference_audio: Iterable[video_to_video_create_params.Seedance2ReferenceAudio] + | Iterable[video_to_video_create_params.Seedance2FastReferenceAudio] + | Omit = omit, + reference_videos: Iterable[video_to_video_create_params.Seedance2ReferenceVideo] + | Iterable[video_to_video_create_params.Seedance2FastReferenceVideo] + | 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, @@ -476,7 +565,7 @@ async def create( duration: The number of seconds of duration for the output video. prompt_text: An optional text prompt up to 3500 characters describing what should appear in - the output video. + the output. ratio: The resolution of the output video. @@ -500,11 +589,81 @@ async def create( """ ... + @overload + async def create( + self, + *, + model: Literal["seedance2_fast"], + prompt_video: str, + audio: bool | Omit = omit, + duration: int | Omit = omit, + prompt_text: str | Omit = omit, + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + | Omit = omit, + reference_audio: Iterable[video_to_video_create_params.Seedance2FastReferenceAudio] | Omit = omit, + references: Iterable[video_to_video_create_params.Seedance2FastReference] | Omit = omit, + reference_videos: Iterable[video_to_video_create_params.Seedance2FastReferenceVideo] | 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, + ) -> VideoToVideoCreateResponse: + """ + This endpoint will start a new task to generate a video from a video. + + Args: + prompt_video: A HTTPS URL. + + audio: Whether to generate audio for the video. Audio inclusion affects pricing. + + duration: The number of seconds of duration for the output video. + + prompt_text: An optional text prompt up to 3500 characters describing what should appear in + the output. + + ratio: The resolution of the output video. Seedance 2.0 Fast supports 480p and 720p + only. + + reference_audio: An optional array of audio references. Audio references require a text prompt, + and the total combined duration must not exceed 15 seconds. + + references: An optional array of image references (up to 9). See + [our docs](/assets/inputs#images) on image inputs for more information. + + reference_videos: An optional array of video references. The combined duration across all video + references must not exceed 15 seconds. See [our docs](/assets/inputs#videos) on + video inputs for more information. + + 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(["model", "prompt_text", "video_uri"], ["model", "prompt_video"]) async def create( self, *, - model: Literal["gen4_aleph"] | Literal["aleph2"] | Literal["seedance2"], + model: Literal["gen4_aleph"] | Literal["aleph2"] | Literal["seedance2"] | Literal["seedance2_fast"], prompt_text: str | Omit = omit, video_uri: str | Omit = omit, content_moderation: video_to_video_create_params.Gen4AlephContentModeration @@ -531,9 +690,24 @@ async def create( "1248:1664", "1080:1920", ] + | Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] | Omit = omit, references: Iterable[video_to_video_create_params.Gen4AlephReference] | Iterable[video_to_video_create_params.Seedance2Reference] + | Iterable[video_to_video_create_params.Seedance2FastReference] | Omit = omit, seed: int | Omit = omit, keyframes: Iterable[video_to_video_create_params.Aleph2Keyframe] | Omit = omit, @@ -541,8 +715,12 @@ async def create( prompt_video: str | Omit = omit, audio: bool | Omit = omit, duration: int | Omit = omit, - reference_audio: Iterable[video_to_video_create_params.Seedance2ReferenceAudio] | Omit = omit, - reference_videos: Iterable[video_to_video_create_params.Seedance2ReferenceVideo] | Omit = omit, + reference_audio: Iterable[video_to_video_create_params.Seedance2ReferenceAudio] + | Iterable[video_to_video_create_params.Seedance2FastReferenceAudio] + | Omit = omit, + reference_videos: Iterable[video_to_video_create_params.Seedance2ReferenceVideo] + | Iterable[video_to_video_create_params.Seedance2FastReferenceVideo] + | 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, diff --git a/src/runwayml/types/image_to_video_create_params.py b/src/runwayml/types/image_to_video_create_params.py index b011806..6ec1f88 100644 --- a/src/runwayml/types/image_to_video_create_params.py +++ b/src/runwayml/types/image_to_video_create_params.py @@ -27,6 +27,9 @@ "Seedance2", "Seedance2PromptImagePromptImage", "Seedance2ReferenceAudio", + "Seedance2Fast", + "Seedance2FastPromptImagePromptImage", + "Seedance2FastReferenceAudio", "Veo3", "Veo3PromptImagePromptImage", ] @@ -326,9 +329,9 @@ class Seedance2(TypedDict, total=False): """The number of seconds of duration for the output video.""" prompt_text: Annotated[str, PropertyInfo(alias="promptText")] - """An optional text prompt up to 3500 characters (measured in UTF-16 code units). - - This should describe in detail what should appear in the output. + """ + An optional text prompt up to 3500 characters describing what should appear in + the output. """ ratio: Literal[ @@ -384,6 +387,80 @@ class Seedance2ReferenceAudio(TypedDict, total=False): """A HTTPS URL.""" +class Seedance2Fast(TypedDict, total=False): + model: Required[Literal["seedance2_fast"]] + + prompt_image: Required[ + Annotated[Union[str, Iterable[Seedance2FastPromptImagePromptImage]], PropertyInfo(alias="promptImage")] + ] + """An image or array of images. + + Use position `first`/`last` for keyframe mode, or omit position for reference + images. The two modes cannot be mixed. + """ + + audio: bool + """Whether to generate audio for the video. Audio inclusion affects pricing.""" + + duration: int + """The number of seconds of duration for the output video.""" + + prompt_text: Annotated[str, PropertyInfo(alias="promptText")] + """ + An optional text prompt up to 3500 characters describing what should appear in + the output. + """ + + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + """The resolution of the output video. + + Seedance 2.0 Fast supports 480p and 720p only. + """ + + reference_audio: Annotated[Iterable[Seedance2FastReferenceAudio], PropertyInfo(alias="referenceAudio")] + """An optional array of audio references. + + Audio references require a text prompt, and the total combined duration must not + exceed 15 seconds. + """ + + +class Seedance2FastPromptImagePromptImage(TypedDict, total=False): + uri: Required[str] + """A HTTPS URL.""" + + position: Literal["first", "last"] + """The position of the image in the output video. + + "first" will use the image as the first frame, "last" as the last frame. Omit + for a reference image. + """ + + +class Seedance2FastReferenceAudio(TypedDict, total=False): + """ + An audio reference allows the model to use the audio as additional context for the output. + """ + + type: Required[Literal["audio"]] + + uri: Required[str] + """A HTTPS URL.""" + + class Veo3(TypedDict, total=False): duration: Required[Literal[8]] """The number of seconds of duration for the output video.""" @@ -417,5 +494,5 @@ class Veo3PromptImagePromptImage(TypedDict, total=False): ImageToVideoCreateParams: TypeAlias = Union[ - Gen4_5, Gen4Turbo, Veo3_1, Gen3aTurbo, Veo3_1Fast, Happyhorse1_0, Seedance2, Veo3 + Gen4_5, Gen4Turbo, Veo3_1, Gen3aTurbo, Veo3_1Fast, Happyhorse1_0, Seedance2, Seedance2Fast, Veo3 ] diff --git a/src/runwayml/types/organization_retrieve_usage_response.py b/src/runwayml/types/organization_retrieve_usage_response.py index d79de7c..f60e7ae 100644 --- a/src/runwayml/types/organization_retrieve_usage_response.py +++ b/src/runwayml/types/organization_retrieve_usage_response.py @@ -45,6 +45,7 @@ class ResultUsedCredit(BaseModel): "gwm1_avatar_async_text_to_video", "voice_processing", "seedance2", + "seedance2_fast", "magnific_precision_upscaler_v2", "kling2.5_turbo_pro", "kling3.0_pro", @@ -99,6 +100,7 @@ class OrganizationRetrieveUsageResponse(BaseModel): "gwm1_avatar_async_text_to_video", "voice_processing", "seedance2", + "seedance2_fast", "magnific_precision_upscaler_v2", "kling2.5_turbo_pro", "kling3.0_pro", diff --git a/src/runwayml/types/text_to_video_create_params.py b/src/runwayml/types/text_to_video_create_params.py index 1974f94..d6841cb 100644 --- a/src/runwayml/types/text_to_video_create_params.py +++ b/src/runwayml/types/text_to_video_create_params.py @@ -18,6 +18,10 @@ "Seedance2ReferenceAudio", "Seedance2Reference", "Seedance2ReferenceVideo", + "Seedance2Fast", + "Seedance2FastReferenceAudio", + "Seedance2FastReference", + "Seedance2FastReferenceVideo", "Veo3", ] @@ -131,9 +135,9 @@ class Seedance2(TypedDict, total=False): model: Required[Literal["seedance2"]] prompt_text: Required[Annotated[str, PropertyInfo(alias="promptText")]] - """A non-empty string up to 3500 characters (measured in UTF-16 code units). - - This should describe in detail what should appear in the output. + """ + A non-empty text prompt up to 3500 characters describing what should appear in + the output. """ audio: bool @@ -219,6 +223,95 @@ class Seedance2ReferenceVideo(TypedDict, total=False): """A HTTPS URL.""" +class Seedance2Fast(TypedDict, total=False): + model: Required[Literal["seedance2_fast"]] + + prompt_text: Required[Annotated[str, PropertyInfo(alias="promptText")]] + """ + A non-empty text prompt up to 3500 characters describing what should appear in + the output. + """ + + audio: bool + """Whether to generate audio for the video. Audio inclusion affects pricing.""" + + duration: int + """The number of seconds of duration for the output video.""" + + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + """The resolution of the output video. + + Seedance 2.0 Fast supports 480p and 720p only. + """ + + reference_audio: Annotated[Iterable[Seedance2FastReferenceAudio], PropertyInfo(alias="referenceAudio")] + """An optional array of audio references. + + Audio references require a text prompt, and the total combined duration must not + exceed 15 seconds. + """ + + references: Iterable[Seedance2FastReference] + """An optional array of image references (up to 9). + + See [our docs](/assets/inputs#images) on image inputs for more information. + """ + + reference_videos: Annotated[Iterable[Seedance2FastReferenceVideo], PropertyInfo(alias="referenceVideos")] + """An optional array of video references. + + The combined duration across all video references must not exceed 15 seconds. + See [our docs](/assets/inputs#videos) on video inputs for more information. + """ + + +class Seedance2FastReferenceAudio(TypedDict, total=False): + """ + An audio reference allows the model to use the audio as additional context for the output. + """ + + type: Required[Literal["audio"]] + + uri: Required[str] + """A HTTPS URL.""" + + +class Seedance2FastReference(TypedDict, total=False): + uri: Required[str] + """A HTTPS URL.""" + + position: Literal["first", "last"] + """The position of the image in the output video. + + "first" will use the image as the first frame, "last" as the last frame. Omit + for a reference image. + """ + + +class Seedance2FastReferenceVideo(TypedDict, total=False): + """ + A video reference allows the model to use the video as additional context for the output. + """ + + type: Required[Literal["video"]] + + uri: Required[str] + """A HTTPS URL.""" + + class Veo3(TypedDict, total=False): duration: Required[Literal[8]] """The number of seconds of duration for the output video.""" @@ -235,4 +328,4 @@ class Veo3(TypedDict, total=False): """The resolution of the output video.""" -TextToVideoCreateParams: TypeAlias = Union[Gen4_5, Veo3_1, Veo3_1Fast, Happyhorse1_0, Seedance2, Veo3] +TextToVideoCreateParams: TypeAlias = Union[Gen4_5, Veo3_1, Veo3_1Fast, Happyhorse1_0, Seedance2, Seedance2Fast, Veo3] diff --git a/src/runwayml/types/video_to_video_create_params.py b/src/runwayml/types/video_to_video_create_params.py index 131f3d0..56d1201 100644 --- a/src/runwayml/types/video_to_video_create_params.py +++ b/src/runwayml/types/video_to_video_create_params.py @@ -25,6 +25,10 @@ "Seedance2ReferenceAudio", "Seedance2Reference", "Seedance2ReferenceVideo", + "Seedance2Fast", + "Seedance2FastReferenceAudio", + "Seedance2FastReference", + "Seedance2FastReferenceVideo", ] @@ -204,7 +208,7 @@ class Seedance2(TypedDict, total=False): prompt_text: Annotated[str, PropertyInfo(alias="promptText")] """ An optional text prompt up to 3500 characters describing what should appear in - the output video. + the output. """ ratio: Literal[ @@ -284,4 +288,96 @@ class Seedance2ReferenceVideo(TypedDict, total=False): """A HTTPS URL.""" -VideoToVideoCreateParams: TypeAlias = Union[Gen4Aleph, Aleph2, Seedance2] +class Seedance2Fast(TypedDict, total=False): + model: Required[Literal["seedance2_fast"]] + + prompt_video: Required[Annotated[str, PropertyInfo(alias="promptVideo")]] + """A HTTPS URL.""" + + audio: bool + """Whether to generate audio for the video. Audio inclusion affects pricing.""" + + duration: int + """The number of seconds of duration for the output video.""" + + prompt_text: Annotated[str, PropertyInfo(alias="promptText")] + """ + An optional text prompt up to 3500 characters describing what should appear in + the output. + """ + + ratio: Literal[ + "992:432", + "864:496", + "752:560", + "640:640", + "560:752", + "496:864", + "1470:630", + "1280:720", + "1112:834", + "960:960", + "834:1112", + "720:1280", + ] + """The resolution of the output video. + + Seedance 2.0 Fast supports 480p and 720p only. + """ + + reference_audio: Annotated[Iterable[Seedance2FastReferenceAudio], PropertyInfo(alias="referenceAudio")] + """An optional array of audio references. + + Audio references require a text prompt, and the total combined duration must not + exceed 15 seconds. + """ + + references: Iterable[Seedance2FastReference] + """An optional array of image references (up to 9). + + See [our docs](/assets/inputs#images) on image inputs for more information. + """ + + reference_videos: Annotated[Iterable[Seedance2FastReferenceVideo], PropertyInfo(alias="referenceVideos")] + """An optional array of video references. + + The combined duration across all video references must not exceed 15 seconds. + See [our docs](/assets/inputs#videos) on video inputs for more information. + """ + + +class Seedance2FastReferenceAudio(TypedDict, total=False): + """ + An audio reference allows the model to use the audio as additional context for the output. + """ + + type: Required[Literal["audio"]] + + uri: Required[str] + """A HTTPS URL.""" + + +class Seedance2FastReference(TypedDict, total=False): + uri: Required[str] + """A HTTPS URL.""" + + position: Literal["first", "last"] + """The position of the image in the output video. + + "first" will use the image as the first frame, "last" as the last frame. Omit + for a reference image. + """ + + +class Seedance2FastReferenceVideo(TypedDict, total=False): + """ + A video reference allows the model to use the video as additional context for the output. + """ + + type: Required[Literal["video"]] + + uri: Required[str] + """A HTTPS URL.""" + + +VideoToVideoCreateParams: TypeAlias = Union[Gen4Aleph, Aleph2, Seedance2, Seedance2Fast] diff --git a/tests/api_resources/test_image_to_video.py b/tests/api_resources/test_image_to_video.py index a632cbd..b51e440 100644 --- a/tests/api_resources/test_image_to_video.py +++ b/tests/api_resources/test_image_to_video.py @@ -370,6 +370,58 @@ def test_streaming_response_create_overload_7(self, client: RunwayML) -> None: @parametrize def test_method_create_overload_8(self, client: RunwayML) -> None: + image_to_video = client.image_to_video.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_8(self, client: RunwayML) -> None: + image_to_video = client.image_to_video.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + audio=True, + duration=4, + prompt_text="x", + ratio="992:432", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/file", + } + ], + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + def test_raw_response_create_overload_8(self, client: RunwayML) -> None: + response = client.image_to_video.with_raw_response.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + image_to_video = response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_8(self, client: RunwayML) -> None: + with client.image_to_video.with_streaming_response.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + image_to_video = response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_9(self, client: RunwayML) -> None: image_to_video = client.image_to_video.create( duration=8, model="veo3", @@ -379,7 +431,7 @@ def test_method_create_overload_8(self, client: RunwayML) -> None: assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) @parametrize - def test_method_create_with_all_params_overload_8(self, client: RunwayML) -> None: + def test_method_create_with_all_params_overload_9(self, client: RunwayML) -> None: image_to_video = client.image_to_video.create( duration=8, model="veo3", @@ -390,7 +442,7 @@ def test_method_create_with_all_params_overload_8(self, client: RunwayML) -> Non assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) @parametrize - def test_raw_response_create_overload_8(self, client: RunwayML) -> None: + def test_raw_response_create_overload_9(self, client: RunwayML) -> None: response = client.image_to_video.with_raw_response.create( duration=8, model="veo3", @@ -404,7 +456,7 @@ def test_raw_response_create_overload_8(self, client: RunwayML) -> None: assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) @parametrize - def test_streaming_response_create_overload_8(self, client: RunwayML) -> None: + def test_streaming_response_create_overload_9(self, client: RunwayML) -> None: with client.image_to_video.with_streaming_response.create( duration=8, model="veo3", @@ -778,6 +830,58 @@ async def test_streaming_response_create_overload_7(self, async_client: AsyncRun @parametrize async def test_method_create_overload_8(self, async_client: AsyncRunwayML) -> None: + image_to_video = await async_client.image_to_video.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_8(self, async_client: AsyncRunwayML) -> None: + image_to_video = await async_client.image_to_video.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + audio=True, + duration=4, + prompt_text="x", + ratio="992:432", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/file", + } + ], + ) + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + response = await async_client.image_to_video.with_raw_response.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + image_to_video = await response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + async with async_client.image_to_video.with_streaming_response.create( + model="seedance2_fast", + prompt_image="https://example.com/file", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + image_to_video = await response.parse() + assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_9(self, async_client: AsyncRunwayML) -> None: image_to_video = await async_client.image_to_video.create( duration=8, model="veo3", @@ -787,7 +891,7 @@ async def test_method_create_overload_8(self, async_client: AsyncRunwayML) -> No assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) @parametrize - async def test_method_create_with_all_params_overload_8(self, async_client: AsyncRunwayML) -> None: + async def test_method_create_with_all_params_overload_9(self, async_client: AsyncRunwayML) -> None: image_to_video = await async_client.image_to_video.create( duration=8, model="veo3", @@ -798,7 +902,7 @@ async def test_method_create_with_all_params_overload_8(self, async_client: Asyn assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) @parametrize - async def test_raw_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + async def test_raw_response_create_overload_9(self, async_client: AsyncRunwayML) -> None: response = await async_client.image_to_video.with_raw_response.create( duration=8, model="veo3", @@ -812,7 +916,7 @@ async def test_raw_response_create_overload_8(self, async_client: AsyncRunwayML) assert_matches_type(ImageToVideoCreateResponse, image_to_video, path=["response"]) @parametrize - async def test_streaming_response_create_overload_8(self, async_client: AsyncRunwayML) -> None: + async def test_streaming_response_create_overload_9(self, async_client: AsyncRunwayML) -> None: async with async_client.image_to_video.with_streaming_response.create( duration=8, model="veo3", diff --git a/tests/api_resources/test_text_to_video.py b/tests/api_resources/test_text_to_video.py index 2e1f3ab..f1ad7d2 100644 --- a/tests/api_resources/test_text_to_video.py +++ b/tests/api_resources/test_text_to_video.py @@ -274,6 +274,69 @@ def test_streaming_response_create_overload_5(self, client: RunwayML) -> None: @parametrize def test_method_create_overload_6(self, client: RunwayML) -> None: + text_to_video = client.text_to_video.create( + model="seedance2_fast", + prompt_text="x", + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_6(self, client: RunwayML) -> None: + text_to_video = client.text_to_video.create( + model="seedance2_fast", + prompt_text="x", + audio=True, + duration=4, + ratio="992:432", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/file", + } + ], + references=[ + { + "uri": "https://example.com/file", + "position": "first", + } + ], + reference_videos=[ + { + "type": "video", + "uri": "https://example.com/file", + } + ], + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + def test_raw_response_create_overload_6(self, client: RunwayML) -> None: + response = client.text_to_video.with_raw_response.create( + model="seedance2_fast", + prompt_text="x", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + text_to_video = response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_6(self, client: RunwayML) -> None: + with client.text_to_video.with_streaming_response.create( + model="seedance2_fast", + prompt_text="x", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + text_to_video = response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_method_create_overload_7(self, client: RunwayML) -> None: text_to_video = client.text_to_video.create( duration=8, model="veo3", @@ -283,7 +346,7 @@ def test_method_create_overload_6(self, client: RunwayML) -> None: assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) @parametrize - def test_raw_response_create_overload_6(self, client: RunwayML) -> None: + def test_raw_response_create_overload_7(self, client: RunwayML) -> None: response = client.text_to_video.with_raw_response.create( duration=8, model="veo3", @@ -297,7 +360,7 @@ def test_raw_response_create_overload_6(self, client: RunwayML) -> None: assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) @parametrize - def test_streaming_response_create_overload_6(self, client: RunwayML) -> None: + def test_streaming_response_create_overload_7(self, client: RunwayML) -> None: with client.text_to_video.with_streaming_response.create( duration=8, model="veo3", @@ -575,6 +638,69 @@ async def test_streaming_response_create_overload_5(self, async_client: AsyncRun @parametrize async def test_method_create_overload_6(self, async_client: AsyncRunwayML) -> None: + text_to_video = await async_client.text_to_video.create( + model="seedance2_fast", + prompt_text="x", + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_6(self, async_client: AsyncRunwayML) -> None: + text_to_video = await async_client.text_to_video.create( + model="seedance2_fast", + prompt_text="x", + audio=True, + duration=4, + ratio="992:432", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/file", + } + ], + references=[ + { + "uri": "https://example.com/file", + "position": "first", + } + ], + reference_videos=[ + { + "type": "video", + "uri": "https://example.com/file", + } + ], + ) + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_6(self, async_client: AsyncRunwayML) -> None: + response = await async_client.text_to_video.with_raw_response.create( + model="seedance2_fast", + prompt_text="x", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + text_to_video = await response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_6(self, async_client: AsyncRunwayML) -> None: + async with async_client.text_to_video.with_streaming_response.create( + model="seedance2_fast", + prompt_text="x", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + text_to_video = await response.parse() + assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_7(self, async_client: AsyncRunwayML) -> None: text_to_video = await async_client.text_to_video.create( duration=8, model="veo3", @@ -584,7 +710,7 @@ async def test_method_create_overload_6(self, async_client: AsyncRunwayML) -> No assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) @parametrize - async def test_raw_response_create_overload_6(self, async_client: AsyncRunwayML) -> None: + async def test_raw_response_create_overload_7(self, async_client: AsyncRunwayML) -> None: response = await async_client.text_to_video.with_raw_response.create( duration=8, model="veo3", @@ -598,7 +724,7 @@ async def test_raw_response_create_overload_6(self, async_client: AsyncRunwayML) assert_matches_type(TextToVideoCreateResponse, text_to_video, path=["response"]) @parametrize - async def test_streaming_response_create_overload_6(self, async_client: AsyncRunwayML) -> None: + async def test_streaming_response_create_overload_7(self, async_client: AsyncRunwayML) -> None: async with async_client.text_to_video.with_streaming_response.create( duration=8, model="veo3", diff --git a/tests/api_resources/test_video_to_video.py b/tests/api_resources/test_video_to_video.py index 4ce980a..c339001 100644 --- a/tests/api_resources/test_video_to_video.py +++ b/tests/api_resources/test_video_to_video.py @@ -196,6 +196,70 @@ def test_streaming_response_create_overload_3(self, client: RunwayML) -> None: assert cast(Any, response.is_closed) is True + @parametrize + def test_method_create_overload_4(self, client: RunwayML) -> None: + video_to_video = client.video_to_video.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + ) + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + @parametrize + def test_method_create_with_all_params_overload_4(self, client: RunwayML) -> None: + video_to_video = client.video_to_video.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + audio=True, + duration=4, + prompt_text="x", + ratio="992:432", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/file", + } + ], + references=[ + { + "uri": "https://example.com/file", + "position": "first", + } + ], + reference_videos=[ + { + "type": "video", + "uri": "https://example.com/file", + } + ], + ) + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + @parametrize + def test_raw_response_create_overload_4(self, client: RunwayML) -> None: + response = client.video_to_video.with_raw_response.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + video_to_video = response.parse() + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + @parametrize + def test_streaming_response_create_overload_4(self, client: RunwayML) -> None: + with client.video_to_video.with_streaming_response.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + video_to_video = response.parse() + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True + class TestAsyncVideoToVideo: parametrize = pytest.mark.parametrize( @@ -380,3 +444,67 @@ async def test_streaming_response_create_overload_3(self, async_client: AsyncRun assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) assert cast(Any, response.is_closed) is True + + @parametrize + async def test_method_create_overload_4(self, async_client: AsyncRunwayML) -> None: + video_to_video = await async_client.video_to_video.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + ) + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + @parametrize + async def test_method_create_with_all_params_overload_4(self, async_client: AsyncRunwayML) -> None: + video_to_video = await async_client.video_to_video.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + audio=True, + duration=4, + prompt_text="x", + ratio="992:432", + reference_audio=[ + { + "type": "audio", + "uri": "https://example.com/file", + } + ], + references=[ + { + "uri": "https://example.com/file", + "position": "first", + } + ], + reference_videos=[ + { + "type": "video", + "uri": "https://example.com/file", + } + ], + ) + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + @parametrize + async def test_raw_response_create_overload_4(self, async_client: AsyncRunwayML) -> None: + response = await async_client.video_to_video.with_raw_response.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + video_to_video = await response.parse() + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + @parametrize + async def test_streaming_response_create_overload_4(self, async_client: AsyncRunwayML) -> None: + async with async_client.video_to_video.with_streaming_response.create( + model="seedance2_fast", + prompt_video="https://example.com/video.mp4", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + video_to_video = await response.parse() + assert_matches_type(VideoToVideoCreateResponse, video_to_video, path=["response"]) + + assert cast(Any, response.is_closed) is True From 3d2d3acba9d155508577a13dd0f8446ecaf40c33 Mon Sep 17 00:00:00 2001 From: Matt Basta Date: Fri, 5 Jun 2026 15:29:58 -0400 Subject: [PATCH 2/3] fix(client): Make sd2_fast responses awaitable --- src/runwayml/resources/image_to_video.py | 4 ++-- src/runwayml/resources/text_to_video.py | 4 ++-- src/runwayml/resources/video_to_video.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/runwayml/resources/image_to_video.py b/src/runwayml/resources/image_to_video.py index e16de5f..7cee6c5 100644 --- a/src/runwayml/resources/image_to_video.py +++ b/src/runwayml/resources/image_to_video.py @@ -419,7 +419,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> ImageToVideoCreateResponse: + ) -> NewTaskCreatedResponse: """ This endpoint will start a new task to generate a video from an image. @@ -986,7 +986,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> ImageToVideoCreateResponse: + ) -> AsyncNewTaskCreatedResponse: """ This endpoint will start a new task to generate a video from an image. diff --git a/src/runwayml/resources/text_to_video.py b/src/runwayml/resources/text_to_video.py index 9cb35a6..5f0e4df 100644 --- a/src/runwayml/resources/text_to_video.py +++ b/src/runwayml/resources/text_to_video.py @@ -327,7 +327,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> TextToVideoCreateResponse: + ) -> NewTaskCreatedResponse: """ This endpoint will start a new task to generate a video from a text prompt. @@ -802,7 +802,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> TextToVideoCreateResponse: + ) -> AsyncNewTaskCreatedResponse: """ This endpoint will start a new task to generate a video from a text prompt. diff --git a/src/runwayml/resources/video_to_video.py b/src/runwayml/resources/video_to_video.py index 58dedde..8000675 100644 --- a/src/runwayml/resources/video_to_video.py +++ b/src/runwayml/resources/video_to_video.py @@ -259,7 +259,7 @@ def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> VideoToVideoCreateResponse: + ) -> NewTaskCreatedResponse: """ This endpoint will start a new task to generate a video from a video. @@ -622,7 +622,7 @@ async def create( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = not_given, - ) -> VideoToVideoCreateResponse: + ) -> AsyncNewTaskCreatedResponse: """ This endpoint will start a new task to generate a video from a video. From 05997f73590fcf37da22df70393d3e39b7a1ec8d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Jun 2026 19:30:30 +0000 Subject: [PATCH 3/3] release: 4.18.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 2 +- src/runwayml/_version.py | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 9e5024f..052d78b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.17.0" + ".": "4.18.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5c5e651..28573ec 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 4.18.0 (2026-06-05) + +Full Changelog: [v4.17.0...v4.18.0](https://github.com/runwayml/sdk-python/compare/v4.17.0...v4.18.0) + +### Features + +* **api:** seedance2_fast ([90bc24e](https://github.com/runwayml/sdk-python/commit/90bc24eda321b4a7f0b7ef3c923362c60ccc18f2)) + + +### Bug Fixes + +* **client:** Make sd2_fast responses awaitable ([3d2d3ac](https://github.com/runwayml/sdk-python/commit/3d2d3acba9d155508577a13dd0f8446ecaf40c33)) + ## 4.17.0 (2026-06-03) Full Changelog: [v4.16.0...v4.17.0](https://github.com/runwayml/sdk-python/compare/v4.16.0...v4.17.0) diff --git a/pyproject.toml b/pyproject.toml index 8d0e86c..bff7f49 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runwayml" -version = "4.17.0" +version = "4.18.0" description = "The official Python library for the runwayml API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/runwayml/_version.py b/src/runwayml/_version.py index be5af50..db2286f 100644 --- a/src/runwayml/_version.py +++ b/src/runwayml/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runwayml" -__version__ = "4.17.0" # x-release-please-version +__version__ = "4.18.0" # x-release-please-version