UNPKG

@fal-ai/client

Version:

The fal.ai client for JavaScript and TypeScript

1,502 lines 1.93 MB
export type AceStepAudioInpaintInput = { /** * URL of the audio file to be inpainted. */ audio_url: string | Blob | File; /** * end time in seconds for the inpainting process. Default value: `30` */ end_time?: number; /** * Whether the end time is relative to the start or end of the audio. Default value: `"start"` */ end_time_relative_to?: "start" | "end"; /** * Granularity scale for the generation process. Higher values can reduce artifacts. Default value: `10` */ granularity_scale?: number; /** * Guidance interval for the generation. 0.5 means only apply guidance in the middle steps (0.25 * infer_steps to 0.75 * infer_steps) Default value: `0.5` */ guidance_interval?: number; /** * Guidance interval decay for the generation. Guidance scale will decay from guidance_scale to min_guidance_scale in the interval. 0.0 means no decay. */ guidance_interval_decay?: number; /** * Guidance scale for the generation. Default value: `15` */ guidance_scale?: number; /** * Type of CFG to use for the generation process. Default value: `"apg"` */ guidance_type?: "cfg" | "apg" | "cfg_star"; /** * Lyric guidance scale for the generation. Default value: `1.5` */ lyric_guidance_scale?: number; /** * Lyrics to be sung in the audio. If not provided or if [inst] or [instrumental] is the content of this field, no lyrics will be sung. Use control structures like [verse], [chorus] and [bridge] to control the structure of the song. Default value: `""` */ lyrics?: string; /** * Minimum guidance scale for the generation after the decay. Default value: `3` */ minimum_guidance_scale?: number; /** * Number of steps to generate the audio. Default value: `27` */ number_of_steps?: number; /** * Scheduler to use for the generation process. Default value: `"euler"` */ scheduler?: "euler" | "heun"; /** * Random seed for reproducibility. If not provided, a random seed will be used. */ seed?: number; /** * start time in seconds for the inpainting process. */ start_time?: number; /** * Whether the start time is relative to the start or end of the audio. Default value: `"start"` */ start_time_relative_to?: "start" | "end"; /** * Tag guidance scale for the generation. Default value: `5` */ tag_guidance_scale?: number; /** * Comma-separated list of genre tags to control the style of the generated audio. */ tags: string; /** * Variance for the inpainting process. Higher values can lead to more diverse results. Default value: `0.5` */ variance?: number; }; export type AceStepAudioOutpaintInput = { /** * URL of the audio file to be outpainted. */ audio_url: string | Blob | File; /** * Duration in seconds to extend the audio from the end. Default value: `30` */ extend_after_duration?: number; /** * Duration in seconds to extend the audio from the start. */ extend_before_duration?: number; /** * Granularity scale for the generation process. Higher values can reduce artifacts. Default value: `10` */ granularity_scale?: number; /** * Guidance interval for the generation. 0.5 means only apply guidance in the middle steps (0.25 * infer_steps to 0.75 * infer_steps) Default value: `0.5` */ guidance_interval?: number; /** * Guidance interval decay for the generation. Guidance scale will decay from guidance_scale to min_guidance_scale in the interval. 0.0 means no decay. */ guidance_interval_decay?: number; /** * Guidance scale for the generation. Default value: `15` */ guidance_scale?: number; /** * Type of CFG to use for the generation process. Default value: `"apg"` */ guidance_type?: "cfg" | "apg" | "cfg_star"; /** * Lyric guidance scale for the generation. Default value: `1.5` */ lyric_guidance_scale?: number; /** * Lyrics to be sung in the audio. If not provided or if [inst] or [instrumental] is the content of this field, no lyrics will be sung. Use control structures like [verse], [chorus] and [bridge] to control the structure of the song. Default value: `""` */ lyrics?: string; /** * Minimum guidance scale for the generation after the decay. Default value: `3` */ minimum_guidance_scale?: number; /** * Number of steps to generate the audio. Default value: `27` */ number_of_steps?: number; /** * Scheduler to use for the generation process. Default value: `"euler"` */ scheduler?: "euler" | "heun"; /** * Random seed for reproducibility. If not provided, a random seed will be used. */ seed?: number; /** * Tag guidance scale for the generation. Default value: `5` */ tag_guidance_scale?: number; /** * Comma-separated list of genre tags to control the style of the generated audio. */ tags: string; }; export type AceStepAudioToAudioInput = { /** * URL of the audio file to be outpainted. */ audio_url: string | Blob | File; /** * Whether to edit the lyrics only or remix the audio. Default value: `"remix"` */ edit_mode?: "lyrics" | "remix"; /** * Granularity scale for the generation process. Higher values can reduce artifacts. Default value: `10` */ granularity_scale?: number; /** * Guidance interval for the generation. 0.5 means only apply guidance in the middle steps (0.25 * infer_steps to 0.75 * infer_steps) Default value: `0.5` */ guidance_interval?: number; /** * Guidance interval decay for the generation. Guidance scale will decay from guidance_scale to min_guidance_scale in the interval. 0.0 means no decay. */ guidance_interval_decay?: number; /** * Guidance scale for the generation. Default value: `15` */ guidance_scale?: number; /** * Type of CFG to use for the generation process. Default value: `"apg"` */ guidance_type?: "cfg" | "apg" | "cfg_star"; /** * Lyric guidance scale for the generation. Default value: `1.5` */ lyric_guidance_scale?: number; /** * Lyrics to be sung in the audio. If not provided or if [inst] or [instrumental] is the content of this field, no lyrics will be sung. Use control structures like [verse], [chorus] and [bridge] to control the structure of the song. Default value: `""` */ lyrics?: string; /** * Minimum guidance scale for the generation after the decay. Default value: `3` */ minimum_guidance_scale?: number; /** * Number of steps to generate the audio. Default value: `27` */ number_of_steps?: number; /** * Original lyrics of the audio file. Default value: `""` */ original_lyrics?: string; /** * Original seed of the audio file. */ original_seed?: number; /** * Original tags of the audio file. */ original_tags: string; /** * Scheduler to use for the generation process. Default value: `"euler"` */ scheduler?: "euler" | "heun"; /** * Random seed for reproducibility. If not provided, a random seed will be used. */ seed?: number; /** * Tag guidance scale for the generation. Default value: `5` */ tag_guidance_scale?: number; /** * Comma-separated list of genre tags to control the style of the generated audio. */ tags: string; }; export type AceStepInput = { /** * The duration of the generated audio in seconds. Default value: `60` */ duration?: number; /** * Granularity scale for the generation process. Higher values can reduce artifacts. Default value: `10` */ granularity_scale?: number; /** * Guidance interval for the generation. 0.5 means only apply guidance in the middle steps (0.25 * infer_steps to 0.75 * infer_steps) Default value: `0.5` */ guidance_interval?: number; /** * Guidance interval decay for the generation. Guidance scale will decay from guidance_scale to min_guidance_scale in the interval. 0.0 means no decay. */ guidance_interval_decay?: number; /** * Guidance scale for the generation. Default value: `15` */ guidance_scale?: number; /** * Type of CFG to use for the generation process. Default value: `"apg"` */ guidance_type?: "cfg" | "apg" | "cfg_star"; /** * Lyric guidance scale for the generation. Default value: `1.5` */ lyric_guidance_scale?: number; /** * Lyrics to be sung in the audio. If not provided or if [inst] or [instrumental] is the content of this field, no lyrics will be sung. Use control structures like [verse], [chorus] and [bridge] to control the structure of the song. Default value: `""` */ lyrics?: string; /** * Minimum guidance scale for the generation after the decay. Default value: `3` */ minimum_guidance_scale?: number; /** * Number of steps to generate the audio. Default value: `27` */ number_of_steps?: number; /** * Scheduler to use for the generation process. Default value: `"euler"` */ scheduler?: "euler" | "heun"; /** * Random seed for reproducibility. If not provided, a random seed will be used. */ seed?: number; /** * Tag guidance scale for the generation. Default value: `5` */ tag_guidance_scale?: number; /** * Comma-separated list of genre tags to control the style of the generated audio. */ tags: string; }; export type AceStepOutput = { /** * The generated audio file. */ audio: File; /** * The lyrics used in the generation process. */ lyrics: string; /** * The random seed used for the generation process. */ seed: number; /** * The genre tags used in the generation process. */ tags: string; }; export type AceStepPromptToAudioInput = { /** * The duration of the generated audio in seconds. Default value: `60` */ duration?: number; /** * Granularity scale for the generation process. Higher values can reduce artifacts. Default value: `10` */ granularity_scale?: number; /** * Guidance interval for the generation. 0.5 means only apply guidance in the middle steps (0.25 * infer_steps to 0.75 * infer_steps) Default value: `0.5` */ guidance_interval?: number; /** * Guidance interval decay for the generation. Guidance scale will decay from guidance_scale to min_guidance_scale in the interval. 0.0 means no decay. */ guidance_interval_decay?: number; /** * Guidance scale for the generation. Default value: `15` */ guidance_scale?: number; /** * Type of CFG to use for the generation process. Default value: `"apg"` */ guidance_type?: "cfg" | "apg" | "cfg_star"; /** * Whether to generate an instrumental version of the audio. */ instrumental?: boolean; /** * Lyric guidance scale for the generation. Default value: `1.5` */ lyric_guidance_scale?: number; /** * Minimum guidance scale for the generation after the decay. Default value: `3` */ minimum_guidance_scale?: number; /** * Number of steps to generate the audio. Default value: `27` */ number_of_steps?: number; /** * Prompt to control the style of the generated audio. This will be used to generate tags and lyrics. */ prompt: string; /** * Scheduler to use for the generation process. Default value: `"euler"` */ scheduler?: "euler" | "heun"; /** * Random seed for reproducibility. If not provided, a random seed will be used. */ seed?: number; /** * Tag guidance scale for the generation. Default value: `5` */ tag_guidance_scale?: number; }; export type AddSubtitlesToVideoInput = { /** * Background box color for subtitle text (use 'none' for no background, TikTok style uses no background) Default value: `none` */ background_color?: "black" | "white" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta" | "transparent" | "none"; /** * Opacity of subtitle background box if used (0.0-1.0, 0.0=transparent) */ background_opacity?: number; /** * Subtitle text color Default value: `"white"` */ font_color?: "white" | "black" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta"; /** * Any Google Font name from fonts.google.com (e.g., 'Montserrat', 'Poppins', 'BBH Sans Hegarty'). TikTok commonly uses bold sans-serif fonts. Default value: `"Montserrat"` */ font_name?: string; /** * Font size for subtitles (TikTok style uses larger, bold text) Default value: `70` */ font_size?: number; /** * Font weight (TikTok style typically uses bold or black) Default value: `"bold"` */ font_weight?: "normal" | "bold" | "black"; /** * Vertical position of subtitles on screen Default value: `"bottom"` */ position?: "bottom" | "top" | "center"; /** * Text stroke/outline color Default value: `"black"` */ stroke_color?: "black" | "white" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta"; /** * Text stroke/outline width in pixels (0 for no stroke, TikTok uses 2-4) Default value: `3` */ stroke_width?: number; /** * List of subtitle segments. Click + to add more subtitle segments. */ subtitles: Array<SubtitleSegment>; /** * URL of the video file to add subtitles to */ video_url: string | Blob | File; /** * Vertical offset from position in pixels (-500 to 500, positive moves down) */ y_offset?: number; }; export type AddTextToImageInput = { /** * Text anchor point Default value: `"center"` */ anchor?: "left" | "center" | "right"; /** * Optional background color for text box (use 'none' or leave empty for no background) */ background_color?: "black" | "white" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta" | "transparent" | "none"; /** * Padding around text in pixels (only if background_color is set) Default value: `10` */ background_padding?: number; /** * Text color Default value: `"white"` */ font_color?: "white" | "black" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta"; /** * Font size in pixels Default value: `40` */ font_size?: number; /** * The URL of the image to add text to */ image_url: string | Blob | File; /** * Output format for the result image Default value: `"png"` */ output_format?: "png" | "jpg" | "jpeg" | "webp"; /** * Color of text stroke/outline Default value: `"black"` */ stroke_color?: "black" | "white" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta"; /** * Width of text outline/stroke in pixels (0 for no stroke) */ stroke_width?: number; /** * Text to add to the image */ text: string; /** * X position as percentage of image width (0-100) Default value: `50` */ x_percent?: number; /** * Y position as percentage of image height (0-100) Default value: `50` */ y_percent?: number; }; export type AdvancedInput = { /** * Default caption to use if no caption is found for a media file. */ default_caption?: string; /** * The multiplier for the learning rate for the high resolution training stage. This is useful when you want to train the high resolution stage with a different learning rate than the low resolution stage. Default value: `2.5` */ hires_lr_multiplier?: number; /** * Whether to include synthetic captions. */ include_synthetic_captions?: boolean; /** * The percentage of the image to use for low resolution training. 0.0 means no low resolution training, 1.0 means full low resolution training. Default value: `0.3` */ low_res_percentage?: number; /** * URL to the training data. */ training_data_url: string | Blob | File; /** * List of training stages. Each stage can have different parameters. */ training_stages?: Array<TrainingStage>; /** * Trigger phrase for the model. */ trigger_phrase: string; /** * Whether to use face cropping for the training data. When enabled, images will be cropped to the face before resizing. */ use_face_cropping?: boolean; /** * Whether to use face detection for the training data. When enabled, images will use the center of the face as the center of the image when resizing. Default value: `true` */ use_face_detection?: boolean; /** * Whether to use masks for the training data. Default value: `true` */ use_masks?: boolean; }; export type AdvancedLipsyncCreateTaskInput = { /** * Specified Face for Lip-Sync. Includes Face ID, lip movement reference data, etc. Currently only supports one person lip-sync. */ face_choose: FaceChoice; /** * The session id of the lip-sync task */ session_id: string; }; export type AdvancedLipsyncOutput = { /** * The generated lip-sync video */ videos: Array<File>; }; export type Aesthetics = { /** * The aesthetic score of the image (e.g., 'very high', 'high', 'medium', 'low'). */ aesthetic_score?: string; /** * The color scheme of the image to be generated. */ color_scheme?: string; /** * The composition of the image to be generated. */ composition?: string; /** * The mood and atmosphere of the image to be generated. */ mood_atmosphere?: string; /** * The preference score of the image (e.g., 'very high', 'high', 'medium', 'low'). */ preference_score?: string; }; export type AgeModifyInput = { /** * Aspect ratio for 4K output (default: 3:4 for portraits) */ aspect_ratio?: AspectRatio; /** * Portrait image URL for age modification */ image_url: string | Blob | File; /** * Default value: `true` */ preserve_identity?: boolean; /** * Default value: `30` */ target_age?: number; }; export type AIAvatarInput = { /** * The URL of the audio file. */ audio_url: string | Blob | File; /** * The URL of the image to use as your avatar */ image_url: string | Blob | File; /** * The prompt to use for the video generation. Default value: `"."` */ prompt?: string; }; export type AiAvatarMultiInput = { /** * The acceleration level to use for generation. Default value: `"regular"` */ acceleration?: "none" | "regular" | "high"; /** * The URL of the Person 1 audio file. */ first_audio_url: string | Blob | File; /** * URL of the input image. If the input image does not match the chosen aspect ratio, it is resized and center cropped. */ image_url: string | Blob | File; /** * Number of frames to generate. Must be between 81 to 129 (inclusive). If the number of frames is greater than 81, the video will be generated with 1.25x more billing units. Default value: `181` */ num_frames?: number; /** * The text prompt to guide video generation. */ prompt: string; /** * Resolution of the video to generate. Must be either 480p or 720p. Default value: `"480p"` */ resolution?: "480p" | "720p"; /** * The URL of the Person 2 audio file. */ second_audio_url?: string | Blob | File; /** * Random seed for reproducibility. If None, a random seed is chosen. Default value: `81` */ seed?: number; /** * Whether to use only the first audio file. */ use_only_first_audio?: boolean; }; export type AiAvatarMultiTextInput = { /** * The acceleration level to use for generation. Default value: `"regular"` */ acceleration?: "none" | "regular" | "high"; /** * The text input to guide video generation. */ first_text_input: string; /** * URL of the input image. If the input image does not match the chosen aspect ratio, it is resized and center cropped. */ image_url: string | Blob | File; /** * Number of frames to generate. Must be between 81 to 129 (inclusive). If the number of frames is greater than 81, the video will be generated with 1.25x more billing units. Default value: `191` */ num_frames?: number; /** * The text prompt to guide video generation. */ prompt: string; /** * Resolution of the video to generate. Must be either 480p or 720p. Default value: `"480p"` */ resolution?: "480p" | "720p"; /** * The text input to guide video generation. */ second_text_input: string; /** * Random seed for reproducibility. If None, a random seed is chosen. Default value: `81` */ seed?: number; /** * The first person's voice to use for speech generation Default value: `"Sarah"` */ voice1?: "Aria" | "Roger" | "Sarah" | "Laura" | "Charlie" | "George" | "Callum" | "River" | "Liam" | "Charlotte" | "Alice" | "Matilda" | "Will" | "Jessica" | "Eric" | "Chris" | "Brian" | "Daniel" | "Lily" | "Bill"; /** * The second person's voice to use for speech generation Default value: `"Roger"` */ voice2?: "Aria" | "Roger" | "Sarah" | "Laura" | "Charlie" | "George" | "Callum" | "River" | "Liam" | "Charlotte" | "Alice" | "Matilda" | "Will" | "Jessica" | "Eric" | "Chris" | "Brian" | "Daniel" | "Lily" | "Bill"; }; export type AIAvatarOutput = { /** * Duration of the output video in seconds. */ duration: number; /** * The generated video */ video: File; }; export type AiAvatarSingleTextInput = { /** * The acceleration level to use for generation. Default value: `"regular"` */ acceleration?: "none" | "regular" | "high"; /** * URL of the input image. If the input image does not match the chosen aspect ratio, it is resized and center cropped. */ image_url: string | Blob | File; /** * Number of frames to generate. Must be between 81 to 129 (inclusive). If the number of frames is greater than 81, the video will be generated with 1.25x more billing units. Default value: `136` */ num_frames?: number; /** * The text prompt to guide video generation. */ prompt: string; /** * Resolution of the video to generate. Must be either 480p or 720p. Default value: `"480p"` */ resolution?: "480p" | "720p"; /** * Random seed for reproducibility. If None, a random seed is chosen. Default value: `42` */ seed?: number; /** * The text input to guide video generation. */ text_input: string; /** * The voice to use for speech generation */ voice: "Aria" | "Roger" | "Sarah" | "Laura" | "Charlie" | "George" | "Callum" | "River" | "Liam" | "Charlotte" | "Alice" | "Matilda" | "Will" | "Jessica" | "Eric" | "Chris" | "Brian" | "Daniel" | "Lily" | "Bill"; }; export type AllInFocusInput = { /** * If set to true, the safety checker will be enabled. Default value: `true` */ enable_safety_checker?: boolean; /** * The URL of the image to deblur and restore to all-in-focus. */ image_url: string | Blob | File; /** * The number of inference steps to perform. Lower values are faster but may reduce quality. Default value: `28` */ num_inference_steps?: number; /** * The format of the generated image. Default value: `"jpeg"` */ output_format?: "jpeg" | "png"; /** * The same seed and the same input given to the same version of the model will output the same image every time. */ seed?: number; /** * If `True`, the media will be returned as a data URI and the output data won't be available in the request history. */ sync_mode?: boolean; /** * Resize the image so the longer side matches this value (in pixels). If not set, the original resolution is used (aligned to 16px). Recommended range: 512 to 2000. Default value: `512` */ target_long_side?: number; }; export type AmixAudioInput = { /** * List of audio file URLs to mix together */ audio_urls: Array<string>; /** * Transition time in seconds for volume renormalization when an input ends Default value: `2` */ dropout_transition?: number; /** * How to determine output duration Default value: `"longest"` */ duration?: "longest" | "shortest" | "first"; /** * Always scale inputs instead of only doing summation. Prevents clipping Default value: `true` */ normalize?: boolean; /** * Optional weights for each audio input. If fewer weights than inputs, last weight applies to remaining. Default is 1.0 for all */ weights?: Array<number>; }; export type AMTFrameInterpolationInput = { /** * Frames to interpolate */ frames: Array<Frame>; /** * Output frames per second Default value: `24` */ output_fps?: number; /** * Number of recursive interpolation passes Default value: `4` */ recursive_interpolation_passes?: number; }; export type AmtInterpolationInput = { /** * Output frames per second Default value: `24` */ output_fps?: number; /** * Number of recursive interpolation passes Default value: `2` */ recursive_interpolation_passes?: number; /** * URL of the video to be processed */ video_url: string | Blob | File; }; export type AnimatediffSparsectrlLcmInput = { /** * The type of controlnet to use for generating the video. The controlnet determines how the video will be animated. Default value: `"scribble"` */ controlnet_type?: "scribble" | "rgb"; /** * The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. Default value: `1` */ guidance_scale?: number; /** * The URL of the first keyframe to use for the generation. */ keyframe_0_image_url?: string | Blob | File; /** * The frame index of the first keyframe to use for the generation. */ keyframe_0_index?: number; /** * The URL of the second keyframe to use for the generation. */ keyframe_1_image_url?: string | Blob | File; /** * The frame index of the second keyframe to use for the generation. */ keyframe_1_index?: number; /** * The URL of the third keyframe to use for the generation. */ keyframe_2_image_url?: string | Blob | File; /** * The frame index of the third keyframe to use for the generation. */ keyframe_2_index?: number; /** * The negative prompt to use. Use it to specify what you don't want. Default value: `""` */ negative_prompt?: string; /** * Increasing the amount of steps tells Stable Diffusion that it should take more steps to generate your final result which can increase the amount of detail in your image. Default value: `4` */ num_inference_steps?: number; /** * The prompt to use for generating the image. Be as descriptive as possible for best results. */ prompt: string; /** * The same seed and the same prompt given to the same version of Stable * Diffusion will output the same image every time. */ seed?: number; }; export type AnimateDiffT2VInput = { /** * Number of frames per second to extract from the video. Default value: `8` */ fps?: number; /** * The CFG (Classifier Free Guidance) scale is a measure of how close you want * the model to stick to your prompt when looking for a related image to show you. Default value: `7.5` */ guidance_scale?: number; /** * The motions to apply to the video. */ motions?: Array<"zoom-out" | "zoom-in" | "pan-left" | "pan-right" | "tilt-up" | "tilt-down">; /** * The negative prompt to use. Use it to address details that you don't want * in the image. This could be colors, objects, scenery and even the small details * (e.g. moustache, blurry, low resolution). Default value: `"(bad quality, worst quality:1.2), ugly faces, bad anime"` */ negative_prompt?: string; /** * The number of frames to generate for the video. Default value: `16` */ num_frames?: number; /** * The number of inference steps to perform. Default value: `25` */ num_inference_steps?: number; /** * The prompt to use for generating the video. Be as descriptive as possible for best results. */ prompt: string; /** * The same seed and the same prompt given to the same version of Stable Diffusion * will output the same image every time. */ seed?: number; /** * The size of the video to generate. Default value: `square` */ video_size?: ImageSize | "square_hd" | "square" | "portrait_4_3" | "portrait_16_9" | "landscape_4_3" | "landscape_16_9"; }; export type AnimateDiffT2VTurboInput = { /** * Number of frames per second to extract from the video. Default value: `8` */ fps?: number; /** * The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. Default value: `2` */ guidance_scale?: number; /** * The negative prompt to use. Use it to address details that you don't want * in the image. This could be colors, objects, scenery and even the small details * (e.g. moustache, blurry, low resolution). Default value: `"(bad quality, worst quality:1.2), ugly faces, bad anime"` */ negative_prompt?: string; /** * The number of frames to generate for the video. Default value: `16` */ num_frames?: number; /** * The number of inference steps to perform. 4-12 is recommended for turbo mode. Default value: `8` */ num_inference_steps?: number; /** * The prompt to use for generating the video. Be as descriptive as possible for best results. */ prompt: string; /** * The same seed and the same prompt given to the same version of Stable Diffusion * will output the same image every time. */ seed?: number; /** * The size of the video to generate. Default value: `square` */ video_size?: ImageSize | "square_hd" | "square" | "portrait_4_3" | "portrait_16_9" | "landscape_4_3" | "landscape_16_9"; }; export type AnimateDiffV2VInput = { /** * The first N number of seconds of video to animate. Default value: `3` */ first_n_seconds?: number; /** * Number of frames per second to extract from the video. Default value: `8` */ fps?: number; /** * The CFG (Classifier Free Guidance) scale is a measure of how close you want * the model to stick to your prompt when looking for a related image to show you. Default value: `7.5` */ guidance_scale?: number; /** * The motions to apply to the video. */ motions?: Array<"zoom-out" | "zoom-in" | "pan-left" | "pan-right" | "tilt-up" | "tilt-down">; /** * The negative prompt to use. Use it to address details that you don't want * in the image. This could be colors, objects, scenery and even the small details * (e.g. moustache, blurry, low resolution). Default value: `"(bad quality, worst quality:1.2), ugly faces, bad anime"` */ negative_prompt?: string; /** * The number of inference steps to perform. Default value: `25` */ num_inference_steps?: number; /** * The prompt to use for generating the image. Be as descriptive as possible for best results. */ prompt: string; /** * The same seed and the same prompt given to the same version of Stable Diffusion * will output the same image every time. */ seed?: number; /** * The strength of the input video in the final output. Default value: `0.7` */ strength?: number; /** * URL of the video. */ video_url: string | Blob | File; }; export type AnimateDiffV2VTurboInput = { /** * The first N number of seconds of video to animate. Default value: `3` */ first_n_seconds?: number; /** * Number of frames per second to extract from the video. Default value: `8` */ fps?: number; /** * The CFG (Classifier Free Guidance) scale is a measure of how close you want the model to stick to your prompt when looking for a related image to show you. Default value: `2` */ guidance_scale?: number; /** * The negative prompt to use. Use it to address details that you don't want * in the image. This could be colors, objects, scenery and even the small details * (e.g. moustache, blurry, low resolution). Default value: `"(bad quality, worst quality:1.2), ugly faces, bad anime"` */ negative_prompt?: string; /** * The number of inference steps to perform. 4-12 is recommended for turbo mode. Default value: `12` */ num_inference_steps?: number; /** * The prompt to use for generating the image. Be as descriptive as possible for best results. */ prompt: string; /** * The same seed and the same prompt given to the same version of Stable Diffusion * will output the same image every time. */ seed?: number; /** * The strength of the input video in the final output. Default value: `0.7` */ strength?: number; /** * URL of the video. */ video_url: string | Blob | File; }; export type ArbiterImageImageInput = { /** * The inputs to use for the measurement. */ inputs: Array<ReferenceImageInput>; /** * The measurements to use for the measurement. */ measurements: Array<"dists" | "mse" | "lpips" | "sdi" | "ssim">; }; export type ArbiterImageInput = { /** * The inputs to use for the measurement. */ inputs: Array<ImageInput>; /** * The measurements to use for the measurement. */ measurements: Array<"arniqa" | "clip_iqa" | "musiq" | "nima" | "lapvar">; }; export type ArbiterImageOutput = { /** * The values of the measurements. */ values?: Array<unknown>; }; export type ArbiterImageTextInput = { /** * The inputs to use for the measurement. */ inputs: Array<SemanticImageInput>; /** * The measurements to use for the measurement. */ measurements: Array<string>; }; export type AspectRatio = { /** * Aspect ratio for 4K resolution output Default value: `"1:1"` */ ratio?: "1:1" | "16:9" | "9:16" | "4:3" | "3:4"; }; export type Audio = { /** * Overall bitrate of the media in bits per second */ bitrate: number; /** * Number of audio channels */ channels: number; /** * Codec used to encode the media */ codec: string; /** * Container format of the media file (e.g., 'mp4', 'mov') */ container: string; /** * MIME type of the media file */ content_type: string; /** * Duration of the media in seconds */ duration: number; /** * Original filename of the media */ file_name: string; /** * Size of the file in bytes */ file_size: number; /** * Type of media (always 'audio') Default value: `"audio"` */ media_type?: string; /** * Audio sample rate in Hz */ sample_rate: number; /** * URL where the media file can be accessed */ url: string; }; export type Audio2VideoInput = { /** * */ audio_url: string | Blob | File; /** * The avatar to use for the video */ avatar_id: "emily_vertical_primary" | "emily_vertical_secondary" | "marcus_vertical_primary" | "marcus_vertical_secondary" | "mira_vertical_primary" | "mira_vertical_secondary" | "jasmine_vertical_primary" | "jasmine_vertical_secondary" | "jasmine_vertical_walking" | "aisha_vertical_walking" | "elena_vertical_primary" | "elena_vertical_secondary" | "any_male_vertical_primary" | "any_female_vertical_primary" | "any_male_vertical_secondary" | "any_female_vertical_secondary" | "any_female_vertical_walking" | "emily_primary" | "emily_side" | "marcus_primary" | "marcus_side" | "aisha_walking" | "elena_primary" | "elena_side" | "any_male_primary" | "any_female_primary" | "any_male_side" | "any_female_side"; }; export type AudioCompressorInput = { /** * Attack time in milliseconds (how fast compression starts) Default value: `5` */ attack?: number; /** * URL of the audio file to compress */ audio_url: string | Blob | File; /** * Knee width in dB for soft knee compression (0 = hard knee) Default value: `2.83` */ knee?: number; /** * Makeup gain in dB to compensate for volume reduction Default value: `8` */ makeup?: number; /** * Output audio bitrate Default value: `"192k"` */ output_bitrate?: "128k" | "192k" | "256k" | "320k"; /** * Compression ratio (1 = no compression, higher = more compression) Default value: `3` */ ratio?: number; /** * Release time in milliseconds (how fast compression stops) Default value: `50` */ release?: number; /** * Threshold level in dB above which compression is applied (-60 to 0) Default value: `-18` */ threshold?: number; }; export type AudioEqualizerInput = { /** * URL of the audio file to equalize */ audio_url: string | Blob | File; /** * List of EQ bands to apply. Each band has frequency, width, and gain. */ bands: Array<EQBand>; /** * Output audio bitrate Default value: `"192k"` */ output_bitrate?: "128k" | "192k" | "256k" | "320k"; }; export type AudioFile = { /** * The bitrate of the audio (e.g., '192k' or 192000) */ bitrate?: string | number; /** * The number of channels in the audio */ channels?: number; /** * The mime type of the file. */ content_type?: string; /** * The duration of the audio */ duration?: number; /** * The name of the file. It will be auto-generated if not provided. */ file_name?: string; /** * The size of the file in bytes. */ file_size?: number; /** * The sample rate of the audio */ sample_rate?: number; /** * The URL where the file can be downloaded from. */ url: string; }; export type AudioInput = { /** * URL or data URI of the audio file to process. Supported formats: wav, mp3, aiff, aac, ogg, flac, m4a. */ audio_url: string | Blob | File; /** * This sets the upper limit for the number of tokens the model can generate in response. It won't produce more than this limit. The maximum value is the context length minus the prompt length. */ max_tokens?: number; /** * Name of the model to use. Charged based on actual token usage. */ model: string; /** * Prompt to be used for the audio processing */ prompt: string; /** * Should reasoning be the part of the final answer. */ reasoning?: boolean; /** * System prompt to provide context or instructions to the model */ system_prompt?: string; /** * This setting influences the variety in the model's responses. Lower values lead to more predictable and typical responses, while higher values encourage more diverse and less common responses. At 0, the model always gives the same response for a given input. Default value: `1` */ temperature?: number; }; export type AudioOutput = { /** * Generated output from audio processing */ output: string; /** * Token usage information */ usage: UsageInfo; }; export type AudioSetting = { /** * Bitrate of generated audio Default value: `"128000"` */ bitrate?: "32000" | "64000" | "128000" | "256000"; /** * Number of audio channels (1=mono, 2=stereo) Default value: `"1"` */ channel?: "1" | "2"; /** * Audio format Default value: `"mp3"` */ format?: "mp3" | "pcm" | "flac"; /** * Sample rate of generated audio Default value: `"32000"` */ sample_rate?: "8000" | "16000" | "22050" | "24000" | "32000" | "44100"; }; export type AudioTimeSpan = { /** * End time of the span in seconds */ end: number; /** * Whether to include (True) or exclude (False) sounds in this span Default value: `true` */ include?: boolean; /** * Start time of the span in seconds */ start: number; }; export type AudioToAudioInput = { /** * The audio clip to transform */ audio_url: string | Blob | File; /** * How strictly the diffusion process adheres to the prompt text (higher values make your audio closer to your prompt). Default value: `1` */ guidance_scale?: number; /** * The number of steps to denoise the audio for Default value: `8` */ num_inference_steps?: number; /** * The prompt to guide the audio generation */ prompt: string; /** * */ seed?: number; /** * Sometimes referred to as denoising, this parameter controls how much influence the `audio_url` parameter has on the generated audio. A value of 0 would yield audio that is identical to the input. A value of 1 would be as if you passed in no audio at all. Default value: `0.8` */ strength?: number; /** * If `True`, the media will be returned as a data URI and the output data won't be available in the request history. */ sync_mode?: boolean; /** * The duration of the audio clip to generate. If not provided, it will be set to the duration of the input audio. */ total_seconds?: number; }; export type AudioTrack = { /** * Audio bitrate in bits per second */ bitrate: number; /** * Number of audio channels */ channels: number; /** * Audio codec used (e.g., 'aac', 'mp3') */ codec: string; /** * Audio sample rate in Hz */ sample_rate: number; }; export type AudioUnderstandingInput = { /** * URL of the audio file to analyze */ audio_url: string | Blob | File; /** * Whether to request a more detailed analysis of the audio */ detailed_analysis?: boolean; /** * The question or prompt about the audio content. */ prompt: string; }; export type AudioVolumeInput = { /** * URL of the audio file to process */ audio_url: string | Blob | File; /** * Fade-in duration in seconds from the start of the audio. None = no fade-in. */ fade_in?: number; /** * Fade-out duration in seconds before the end of the audio. None = no fade-out. */ fade_out?: number; /** * Output audio format. If not provided, the format is determined automatically. */ output_format?: "mp3" | "wav" | "aac" | "flac"; /** * Volume multiplier (0.0 = silent, 1.0 = unchanged, 2.0 = double volume) Default value: `1` */ volume?: number; }; export type AudioVolumeOutput = { /** * The processed audio file */ audio: File; /** * Audio duration in seconds */ duration_seconds: number; }; export type AuraFlowInput = { /** * Whether to perform prompt expansion (recommended) Default value: `true` */ expand_prompt?: boolean; /** * Classifier free guidance scale Default value: `3.5` */ guidance_scale?: number; /** * The number of images to generate Default value: `1` */ num_images?: number; /** * The number of inference steps to take Default value: `50` */ num_inference_steps?: number; /** * The prompt to generate images from */ prompt: string; /** * The seed to use for generating images */ seed?: number; /** * If `True`, the media will be returned as a data URI and the output data won't be available in the request history. */ sync_mode?: boolean; }; export type AuraFlowOutput = { /** * The generated images */ images: Array<Image>; /** * The expanded prompt */ prompt: string; /** * The seed used to generate the images */ seed: number; }; export type AuraSrInput = { /** * Checkpoint to use for upscaling. More coming soon. Default value: `"v1"` */ checkpoint?: "v1" | "v2"; /** * URL of the image to upscale. */ image_url: string | Blob | File; /** * Whether to use overlapping tiles for upscaling. Setting this to true helps remove seams but doubles the inference time. */ overlapping_tiles?: boolean; /** * Upscaling factor. More coming soon. Default value: `4` */ upscale_factor?: number; }; export type AuraSrOutput = { /** * Upscaled image */ image: Image; /** * Timings for each step in the pipeline. */ timings: unknown; }; export type AutoCaptionInput = { /** * Size of text in generated captions. Default value: `24` */ font_size?: number; /** * Left-to-right alignment of the text. Can be a string ('left', 'center', 'right') or a float (0.0-1.0) Default value: `center` */ left_align?: string | number; /** * Number of seconds the captions should stay on screen. A higher number will also result in more text being displayed at once. Default value: `1.5` */ refresh_interval?: number; /** * Width of the text strokes in pixels Default value: `1` */ stroke_width?: number; /** * Top-to-bottom alignment of the text. Can be a string ('top', 'center', 'bottom') or a float (0.0-1.0) Default value: `center` */ top_align?: string | number; /** * Colour of the text. Can be a RGB tuple, a color name, or an hexadecimal notation. Default value: `"white"` */ txt_color?: string; /** * Font for generated captions. Choose one in 'Arial','Standard','Garamond', 'Times New Roman','Georgia', or pass a url to a .ttf file Default value: `"Standard"` */ txt_font?: string; /** * URL to the .mp4 video with audio. Only videos of size <400MB are allowed. */ video_url: string | Blob | File; }; export type AutoCaptionOutput = { /** * URL to the caption .mp4 video. */ video_url: string | Blob | File; }; export type AutoSubtitleInput = { /** * Background color behind text ('none' or 'transparent' for no background) Default value: `"none"` */ background_color?: "black" | "white" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta" | "none" | "transparent"; /** * Background opacity (0.0 = fully transparent, 1.0 = fully opaque) */ background_opacity?: number; /** * Enable animation effects for subtitles (bounce style entrance) Default value: `true` */ enable_animation?: boolean; /** * Subtitle text color for non-active words Default value: `"white"` */ font_color?: "white" | "black" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta"; /** * Any Google Font name from fonts.google.com (e.g., 'Montserrat', 'Poppins', 'BBH Sans Hegarty') Default value: `"Montserrat"` */ font_name?: string; /** * Font size for subtitles (TikTok style uses larger text) Default value: `100` */ font_size?: number; /** * Font weight (TikTok style typically uses bold or black) Default value: `"bold"` */ font_weight?: "normal" | "bold" | "black"; /** * Color for the currently speaking word (karaoke-style highlight) Default value: `"purple"` */ highlight_color?: "white" | "black" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta"; /** * Language code for transcription (e.g., 'en', 'es', 'fr', 'de', 'it', 'pt', 'nl', 'ja', 'zh', 'ko') or 3-letter ISO code (e.g., 'eng', 'spa', 'fra') Default value: `"en"` */ language?: string; /** * Vertical position of subtitles Default value: `"bottom"` */ position?: "top" | "center" | "bottom"; /** * Text stroke/outline color Default value: `"black"` */ stroke_color?: "black" | "white" | "red" | "green" | "blue" | "yellow" | "orange" | "purple" | "pink" | "brown" | "gray" | "cyan" | "magenta"; /** * Text stroke/outline width in pixels (0 for no stroke) Default value: `3` */ stroke_width?: number; /** * URL of the video file to add automatic subtitles to */ video_url: string | Blob | File; /** * Maximum number of words per subtitle segment. Use 1 for single-word d