@fal-ai/client
Version:
The fal.ai client for JavaScript and TypeScript
1,821 lines • 883 kB
TypeScript
export type Audio = {
/**
* Type of media (always 'audio') Default value: `"audio"`
*/
media_type?: "audio";
/**
* URL where the media file can be accessed
*/
url: string;
/**
* MIME type of the media file
*/
content_type: string;
/**
* Original filename of the media
*/
file_name: string;
/**
* Size of the file in bytes
*/
file_size: number;
/**
* Duration of the media in seconds
*/
duration: number;
/**
* Overall bitrate of the media in bits per second
*/
bitrate: number;
/**
* Codec used to encode the media
*/
codec: string;
/**
* Container format of the media file (e.g., 'mp4', 'mov')
*/
container: string;
/**
* Number of audio channels
*/
channels: number;
/**
* Audio sample rate in Hz
*/
sample_rate: number;
};
export type AudioFile = {
/**
* The URL where the file can be downloaded from.
*/
url: string;
/**
* The mime type of the file.
*/
content_type?: string;
/**
* 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;
/**
* File data
*/
file_data?: string;
/**
* The duration of the audio file in seconds.
*/
duration: number;
};
export type AudioTrack = {
/**
* Audio codec used (e.g., 'aac', 'mp3')
*/
codec: string;
/**
* Number of audio channels
*/
channels: number;
/**
* Audio sample rate in Hz
*/
sample_rate: number;
/**
* Audio bitrate in bits per second
*/
bitrate: number;
};
export type BoundingBox = {
/**
* X-coordinate of the top-left corner
*/
x: number;
/**
* Y-coordinate of the top-left corner
*/
y: number;
/**
* Width of the bounding box
*/
w: number;
/**
* Height of the bounding box
*/
h: number;
/**
* Label of the bounding box
*/
label: string;
};
export type BoundingBoxes = {
/**
* List of bounding boxes
*/
bboxes: Array<BoundingBox>;
};
export type BoxPrompt = {
/**
* X Min Coordinate of the box
*/
x_min?: number;
/**
* Y Min Coordinate of the box
*/
y_min?: number;
/**
* X Max Coordinate of the prompt
*/
x_max?: number;
/**
* Y Max Coordinate of the prompt
*/
y_max?: number;
/**
* The frame index to interact with.
*/
frame_index?: number;
};
export type CameraControl = {
/**
* The type of camera movement
*/
movement_type: "horizontal" | "vertical" | "pan" | "tilt" | "roll" | "zoom";
/**
* The value of the camera movement
*/
movement_value: number;
};
export type Color = {
/**
* Red value Default value: `128`
*/
r?: number;
/**
* Green value Default value: `128`
*/
g?: number;
/**
* Blue value Default value: `128`
*/
b?: number;
};
export type ControlLoraWeight = {
/**
* URL or the path to the LoRA weights.
*/
path: string;
/**
* The scale of the LoRA weight. This is used to scale the LoRA weight
* before merging it with the base model. Providing a dictionary as {"layer_name":layer_scale} allows per-layer lora scale settings. Layers with no scale provided will have scale 1.0. Default value: `1`
*/
scale?: any | number;
/**
* URL of the image to be used as the control image.
*/
control_image_url: string | Blob | File;
/**
* Type of preprocessing to apply to the input image. Default value: `"None"`
*/
preprocess?: "canny" | "depth" | "None";
};
export type ControlNet = {
/**
* URL or the path to the control net weights.
*/
path: string;
/**
* optional URL to the controlnet config.json file.
*/
config_url?: string | Blob | File;
/**
* The optional variant if a Hugging Face repo key is used.
*/
variant?: string;
/**
* URL of the image to be used as the control net.
*/
image_url: string | Blob | File;
/**
* The mask to use for the controlnet. When using a mask, the control image size and the mask size must be the same and divisible by 32.
*/
mask_url?: string | Blob | File;
/**
* The scale of the control net weight. This is used to scale the control net weight
* before merging it with the base model. Default value: `1`
*/
conditioning_scale?: number;
/**
* The percentage of the image to start applying the controlnet in terms of the total timesteps.
*/
start_percentage?: number;
/**
* The percentage of the image to end applying the controlnet in terms of the total timesteps. Default value: `1`
*/
end_percentage?: number;
/**
* The index of the IP adapter to be applied to the controlnet. This is only needed for InstantID ControlNets.
*/
ip_adapter_index?: number;
};
export type ControlNetUnion = {
/**
* URL or the path to the control net weights.
*/
path: string;
/**
* optional URL to the controlnet config.json file.
*/
config_url?: string | Blob | File;
/**
* The optional variant if a Hugging Face repo key is used.
*/
variant?: string;
/**
* The control images and modes to use for the control net.
*/
controls: Array<ControlNetUnionInput>;
};
export type DiarizationSegment = {
/**
* Start and end timestamp of the segment
*/
timestamp: Array<void>;
/**
* Speaker ID of the segment
*/
speaker: string;
};
export type DynamicMask = {
/**
* URL of the image for Dynamic Brush Application Area (Mask image created by users using the motion brush)
*/
mask_url: string | Blob | File;
/**
* List of trajectories
*/
trajectories?: Array<Trajectory>;
};
export type Embedding = {
/**
* URL or the path to the embedding weights.
*/
path: string;
/**
* The list of tokens to use for the embedding. Default value: `<s0>,<s1>`
*/
tokens?: Array<string>;
};
export type FaceDetection = {
/**
* Bounding box of the face.
*/
bbox: Array<number>;
/**
* Keypoints of the face.
*/
kps?: Array<Array<number>>;
/**
* Keypoints of the face on the image.
*/
kps_image: Image;
/**
* Confidence score of the detection.
*/
det_score: number;
/**
* Embedding of the face.
*/
embedding_file: File;
/**
* Either M or F if available.
*/
sex?: string;
};
export type File = {
/**
* The URL where the file can be downloaded from.
*/
url: string;
/**
* The mime type of the file.
*/
content_type?: string;
/**
* 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;
/**
* File data
*/
file_data?: string;
};
export type Frame = {
/**
* URL of the frame
*/
url: string;
};
export type Image = {
/**
* The URL where the file can be downloaded from.
*/
url: string;
/**
* The mime type of the file.
*/
content_type?: string;
/**
* 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;
/**
* File data
*/
file_data?: string;
/**
* The width of the image in pixels.
*/
width?: number;
/**
* The height of the image in pixels.
*/
height?: number;
};
export type ImagePrompt = {
/**
* Default value: `"ImagePrompt"`
*/
type?: "ImagePrompt" | "PyraCanny" | "CPDS" | "FaceSwap";
/**
*
*/
image_url?: string | Blob | File;
/**
* Default value: `0.5`
*/
stop_at?: number;
/**
* Default value: `1`
*/
weight?: number;
};
export type ImageSize = {
/**
* The width of the generated image. Default value: `512`
*/
width?: number;
/**
* The height of the generated image. Default value: `512`
*/
height?: number;
};
export type IPAdapter = {
/**
* URL of the image to be used as the IP adapter.
*/
ip_adapter_image_url: string | Blob | File | Array<string | Blob | File>;
/**
* The mask to use for the IP adapter. When using a mask, the ip-adapter image size and the mask size must be the same
*/
ip_adapter_mask_url?: string | Blob | File;
/**
* URL or the path to the IP adapter weights.
*/
path: string;
/**
* Subfolder in the model directory where the IP adapter weights are stored.
*/
model_subfolder?: string;
/**
* Name of the weight file.
*/
weight_name?: string;
/**
* URL or the path to the InsightFace model weights.
*/
insight_face_model_path?: string;
/**
* The scale of the IP adapter weight. This is used to scale the IP adapter weight
* before merging it with the base model. Default value: `1`
*/
scale?: number;
/**
* The scale of the IP adapter weight. This is used to scale the IP adapter weight
* before merging it with the base model.
*/
scale_json?: Record<string, any>;
/**
* The factor to apply to the unconditional noising of the IP adapter.
*/
unconditional_noising_factor?: number;
/**
* The value to set the image projection shortcut to. For FaceID plus V1 models,
* this should be set to False. For FaceID plus V2 models, this should be set to True.
* Default is True. Default value: `true`
*/
image_projection_shortcut?: boolean;
};
export type Keyframe = {
/**
* The timestamp in milliseconds where this keyframe starts
*/
timestamp: number;
/**
* The duration in milliseconds of this keyframe
*/
duration: number;
/**
* The URL where this keyframe's media file can be accessed
*/
url: string;
};
export type LoraWeight = {
/**
* URL or the path to the LoRA weights. Or HF model name.
*/
path: string;
/**
* The scale of the LoRA weight. This is used to scale the LoRA weight
* before merging it with the base model. Default value: `1`
*/
scale?: number;
/**
* If set to true, the embedding will be forced to be used.
*/
force?: boolean;
};
export type MoondreamInputParam = {
/**
* URL of the image to be processed
*/
image_url: string | Blob | File;
/**
* Prompt to be used for the image Default value: `"Describe this image."`
*/
prompt?: string;
};
export type OCRBoundingBox = {
/**
* List of quadrilateral boxes
*/
quad_boxes: Array<OCRBoundingBoxSingle>;
};
export type OCRBoundingBoxSingle = {
/**
* X-coordinate of the top-left corner
*/
x: number;
/**
* Y-coordinate of the top-left corner
*/
y: number;
/**
* Width of the bounding box
*/
w: number;
/**
* Height of the bounding box
*/
h: number;
/**
* Label of the bounding box
*/
label: string;
};
export type PikaImage = {
/**
*
*/
image_url: string | Blob | File;
};
export type PointPrompt = {
/**
* X Coordinate of the prompt Default value: `305`
*/
x?: number;
/**
* Y Coordinate of the prompt Default value: `350`
*/
y?: number;
/**
* Label of the prompt. 1 for foreground, 0 for background Default value: `"1"`
*/
label?: "0" | "1";
/**
* The frame index to interact with.
*/
frame_index?: number;
};
export type Polygon = {
/**
* List of points
*/
points: Array<any>;
/**
* Label of the polygon
*/
label: string;
};
export type ReferenceFace = {
/**
* URL of the reference face image
*/
image_url: string | Blob | File;
};
export type ReferenceImage = {
/**
* URL to the reference image file (PNG format recommended)
*/
image_url: string | Blob | File;
};
export type Region = {
/**
* X-coordinate of the top-left corner
*/
x1: number;
/**
* Y-coordinate of the top-left corner
*/
y1: number;
/**
* X-coordinate of the bottom-right corner
*/
x2: number;
/**
* Y-coordinate of the bottom-right corner
*/
y2: number;
};
export type Resolution = {
/**
* Display aspect ratio (e.g., '16:9')
*/
aspect_ratio: string;
/**
* Width of the video in pixels
*/
width: number;
/**
* Height of the video in pixels
*/
height: number;
};
export type RGBColor = {
/**
* Red color value
*/
r?: number;
/**
* Green color value
*/
g?: number;
/**
* Blue color value
*/
b?: number;
};
export type Speaker = {
/**
*
*/
prompt: string;
/**
*
*/
speaker_id: number;
/**
*
*/
audio_url: string | Blob | File;
};
export type Track = {
/**
* Unique identifier for the track
*/
id: string;
/**
* Type of track ('video' or 'audio')
*/
type: string;
/**
* List of keyframes that make up this track
*/
keyframes: Array<Keyframe>;
};
export type Trajectory = {
/**
* X coordinate of the motion trajectory
*/
x: number;
/**
* Y coordinate of the motion trajectory
*/
y: number;
};
export type TranscriptionWord = {
/**
* The transcribed word or audio event
*/
text: string;
/**
* Start time in seconds
*/
start: number;
/**
* End time in seconds
*/
end: number;
/**
* Type of element (word, spacing, or audio_event)
*/
type: string;
/**
* Speaker identifier if diarization was enabled
*/
speaker_id?: string;
};
export type Turn = {
/**
*
*/
speaker_id: number;
/**
*
*/
text: string;
};
export type Video = {
/**
* Type of media (always 'video') Default value: `"video"`
*/
media_type?: "video";
/**
* URL where the media file can be accessed
*/
url: string;
/**
* MIME type of the media file
*/
content_type: string;
/**
* Original filename of the media
*/
file_name: string;
/**
* Size of the file in bytes
*/
file_size: number;
/**
* Duration of the media in seconds
*/
duration: number;
/**
* Overall bitrate of the media in bits per second
*/
bitrate: number;
/**
* Codec used to encode the media
*/
codec: string;
/**
* Container format of the media file (e.g., 'mp4', 'mov')
*/
container: string;
/**
* Frames per second
*/
fps: number;
/**
* Total number of frames in the video
*/
frame_count: number;
/**
* Time base used for frame timestamps
*/
timebase: string;
/**
* Video resolution information
*/
resolution: Resolution;
/**
* Detailed video format information
*/
format: VideoFormat;
/**
* Audio track information if video has audio
*/
audio?: AudioTrack;
/**
* URL of the extracted first frame
*/
start_frame_url?: string | Blob | File;
/**
* URL of the extracted last frame
*/
end_frame_url?: string | Blob | File;
};
export type VideoFormat = {
/**
* Container format of the video
*/
container: string;
/**
* Video codec used (e.g., 'h264')
*/
video_codec: string;
/**
* Codec profile (e.g., 'main', 'high')
*/
profile: string;
/**
* Codec level (e.g., 4.1)
*/
level: number;
/**
* Pixel format used (e.g., 'yuv420p')
*/
pixel_format: string;
/**
* Video bitrate in bits per second
*/
bitrate: number;
};
export type WhisperChunk = {
/**
* Start and end timestamp of the chunk
*/
timestamp: Array<void>;
/**
* Transcription of the chunk
*/
text: string;
};
export type AdvancedFaceSwapInput = {
/**
* User's face image to face swap FROM
*/
face_image_0: Image;
/**
* The gender of the person in the face image.
*/
gender_0: "" | "male" | "female" | "non-binary";
/**
* (Optional) The Second face image to face swap FROM
*/
face_image_1?: Image;
/**
* The gender of the person in the second face image.
*/
gender_1?: "" | "male" | "female" | "non-binary";
/**
* The target image to face swap TO
*/
target_image: Image;
/**
* The type of face swap workflow. target_hair = preserve target's hair. user_hair = preserve user's hair.
*/
workflow_type: "user_hair" | "target_hair";
/**
* Apply 2x upscale and boost quality. Upscaling will refine the image and make the subjects brighter. Default value: `true`
*/
upscale?: boolean;
};
export type AdvancedFaceSwapOutput = {
/**
* The mirrored image.
*/
image: Image;
};
export type AmEngOutput = {
/**
* The generated music
*/
audio: File;
};
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 AmtInterpolationFrameInterpolationInput = {
/**
* 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 AmtInterpolationFrameInterpolationOutput = {
/**
* Generated video
*/
video: File;
};
export type AmtInterpolationInput = {
/**
* URL of the video to be processed
*/
video_url: string | Blob | File;
/**
* Output frames per second Default value: `24`
*/
output_fps?: number;
/**
* Number of recursive interpolation passes Default value: `2`
*/
recursive_interpolation_passes?: number;
};
export type AMTInterpolationInput = {
/**
* URL of the video to be processed
*/
video_url: string | Blob | File;
/**
* Output frames per second Default value: `24`
*/
output_fps?: number;
/**
* Number of recursive interpolation passes Default value: `2`
*/
recursive_interpolation_passes?: number;
};
export type AmtInterpolationOutput = {
/**
* Generated video
*/
video: File;
};
export type AnimatediffSparsectrlLcmInput = {
/**
* The prompt to use for generating the image. Be as descriptive as possible for best results.
*/
prompt: string;
/**
* The negative prompt to use. Use it to specify what you don't want. Default value: `""`
*/
negative_prompt?: string;
/**
* 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";
/**
* 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 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 same seed and the same prompt given to the same version of Stable
* Diffusion will output the same image every time.
*/
seed?: 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;
};
export type AnimatediffSparsectrlLcmOutput = {
/**
* Generated video file.
*/
video: File;
/**
* The seed used to generate the video.
*/
seed: number;
};
export type AnimateDiffT2VInput = {
/**
* The prompt to use for generating the video. Be as descriptive as possible for best results.
*/
prompt: string;
/**
* 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 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 same seed and the same prompt given to the same version of Stable Diffusion
* will output the same image every time.
*/
seed?: number;
/**
* Number of frames per second to extract from the video. Default value: `8`
*/
fps?: number;
/**
* The motions to apply to the video.
*/
motions?: Array<"zoom-out" | "zoom-in" | "pan-left" | "pan-right" | "tilt-up" | "tilt-down">;
/**
* 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 AnimateDiffT2VOutput = {
/**
* Generated video file.
*/
video: File;
/**
* Seed used for generating the video.
*/
seed: number;
};
export type AnimateDiffT2VTurboInput = {
/**
* The prompt to use for generating the video. Be as descriptive as possible for best results.
*/
prompt: string;
/**
* 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: `4`
*/
num_inference_steps?: 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: `1`
*/
guidance_scale?: number;
/**
* The same seed and the same prompt given to the same version of Stable Diffusion
* will output the same image every time.
*/
seed?: number;
/**
* Number of frames per second to extract from the video. Default value: `8`
*/
fps?: number;
/**
* The motions to apply to the video.
*/
motions?: Array<"zoom-out" | "zoom-in" | "pan-left" | "pan-right" | "tilt-up" | "tilt-down">;
/**
* 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 = {
/**
* URL of the video.
*/
video_url: string | Blob | File;
/**
* The prompt to use for generating the image. Be as descriptive as possible for best results.
*/
prompt: string;
/**
* 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;
/**
* 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: `25`
*/
num_inference_steps?: 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`
*/
guidance_scale?: number;
/**
* Base model to use for animation generation. Default value: `"cardosAnimev20"`
*/
base_model?: "darkSushiMixMix_colorful" | "cardosAnimev20";
/**
* The list of LoRA weights to use. Default value: ``
*/
loras?: Array<LoraWeight>;
/**
* Select every Nth frame from the video.
* This can be used to reduce the number of frames to process, which can reduce the time and the cost.
* However, it can also reduce the quality of the final video. Default value: `2`
*/
select_every_nth_frame?: number;
/**
* 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 AnimateDiffV2VInput = {
/**
* URL of the video.
*/
video_url: string | Blob | File;
/**
* The first N number of seconds of video to animate. Default value: `3`
*/
first_n_seconds?: number;
/**
* The prompt to use for generating the image. Be as descriptive as possible for best results.
*/
prompt: string;
/**
* 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 strength of the input video in the final output. Default value: `0.7`
*/
strength?: 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 same seed and the same prompt given to the same version of Stable Diffusion
* will output the same image every time.
*/
seed?: number;
/**
* Number of frames per second to extract from the video. Default value: `8`
*/
fps?: number;
/**
* The motions to apply to the video.
*/
motions?: Array<"zoom-out" | "zoom-in" | "pan-left" | "pan-right" | "tilt-up" | "tilt-down">;
};
export type AnimatediffV2vOutput = {
/**
* Generated video file.
*/
video: File;
/**
* Seed used for generating the video.
*/
seed: number;
/**
*
*/
timings: any;
};
export type AnimateDiffV2VOutput = {
/**
* Generated video file.
*/
video: File;
/**
* Seed used for generating the video.
*/
seed: number;
};
export type AnimatediffV2vTurboInput = {
/**
* URL of the video.
*/
video_url: string | Blob | File;
/**
* The prompt to use for generating the image. Be as descriptive as possible for best results.
*/
prompt: string;
/**
* 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;
/**
* 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: `8`
*/
num_inference_steps?: 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.2`
*/
guidance_scale?: number;
/**
* The list of LoRA weights to use. Default value: ``
*/
loras?: Array<LoraWeight>;
/**
* The same seed and the same prompt given to the same version of Stable Diffusion
* will output the same image every time.
*/
seed?: number;
/**
* Select every Nth frame from the video.
* This can be used to reduce the number of frames to process, which can reduce the time and the cost.
* However, it can also reduce the quality of the final video. Default value: `2`
*/
select_every_nth_frame?: number;
};
export type AnimateDiffV2VTurboInput = {
/**
* URL of the video.
*/
video_url: string | Blob | File;
/**
* The first N number of seconds of video to animate. Default value: `3`
*/
first_n_seconds?: number;
/**
* The prompt to use for generating the image. Be as descriptive as possible for best results.
*/
prompt: string;
/**
* 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: `8`
*/
num_inference_steps?: number;
/**
* The strength of the input video in the final output. Default value: `0.7`
*/
strength?: 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: `1`
*/
guidance_scale?: number;
/**
* The same seed and the same prompt given to the same version of Stable Diffusion
* will output the same image every time.
*/
seed?: number;
/**
* Number of frames per second to extract from the video. Default value: `8`
*/
fps?: number;
/**
* The motions to apply to the video.
*/
motions?: Array<"zoom-out" | "zoom-in" | "pan-left" | "pan-right" | "tilt-up" | "tilt-down">;
};
export type AnimatediffV2vTurboOutput = {
/**
* Generated video file.
*/
video: File;
/**
* Seed used for generating the video.
*/
seed: number;
/**
*
*/
timings: any;
};
export type AnimateDiffV2VTurboOutput = {
/**
* Generated video file.
*/
video: File;
/**
* Seed used for generating the video.
*/
seed: number;
/**
*
*/
timings: any;
};
export type AnyLlmInput = {
/**
* Name of the model to use. Premium models are charged at 10x the rate of standard models, they include: meta-llama/llama-3.2-90b-vision-instruct, openai/gpt-4o, anthropic/claude-3-5-haiku, google/gemini-pro-1.5, anthropic/claude-3.5-sonnet. Default value: `"google/gemini-flash-1.5"`
*/
model?: "anthropic/claude-3.5-sonnet" | "anthropic/claude-3-5-haiku" | "anthropic/claude-3-haiku" | "google/gemini-pro-1.5" | "google/gemini-flash-1.5" | "google/gemini-flash-1.5-8b" | "meta-llama/llama-3.2-1b-instruct" | "meta-llama/llama-3.2-3b-instruct" | "meta-llama/llama-3.1-8b-instruct" | "meta-llama/llama-3.1-70b-instruct" | "openai/gpt-4o-mini" | "openai/gpt-4o" | "deepseek/deepseek-r1";
/**
* Prompt to be used for the chat completion
*/
prompt: string;
/**
* System prompt to provide context or instructions to the model
*/
system_prompt?: string;
/**
* Should reasoning be the part of the final answer.
*/
reasoning?: boolean;
};
export type AnyLlmOutput = {
/**
* Generated output
*/
output: string;
/**
* Generated reasoning for the final answer
*/
reasoning?: string;
/**
* Whether the output is partial
*/
partial?: boolean;
/**
* Error message if an error occurred
*/
error?: string;
};
export type AnyLlmVisionInput = {
/**
* Name of the model to use. Premium models are charged at 3x the rate of standard models, they include: meta-llama/llama-3.2-90b-vision-instruct, openai/gpt-4o, anthropic/claude-3-5-haiku, google/gemini-pro-1.5, anthropic/claude-3.5-sonnet. Default value: `"google/gemini-flash-1.5"`
*/
model?: "anthropic/claude-3.5-sonnet" | "anthropic/claude-3-haiku" | "google/gemini-pro-1.5" | "google/gemini-flash-1.5" | "google/gemini-flash-1.5-8b" | "openai/gpt-4o" | "meta-llama/llama-3.2-90b-vision-instruct";
/**
* Prompt to be used for the image
*/
prompt: string;
/**
* System prompt to provide context or instructions to the model
*/
system_prompt?: string;
/**
* Should reasoning be the part of the final answer.
*/
reasoning?: boolean;
/**
* URL of the image to be processed
*/
image_url: string | Blob | File;
};
export type AnyLlmVisionOutput = {
/**
* Generated output
*/
output: string;
/**
* Generated reasoning for the final answer
*/
reasoning?: string;
/**
* Whether the output is partial
*/
partial?: boolean;
/**
* Error message if an error occurred
*/
error?: string;
};
export type AudioInput = {
/**
* The URL of the audio file.
*/
audio_url: string | Blob | File;
};
export type AudioOutput = {
/**
* The generated audio.
*/
audio: File;
};
export type AuraFlowInput = {
/**
* The prompt to generate images from
*/
prompt: string;
/**
* The number of images to generate Default value: `1`
*/
num_images?: number;
/**
* The seed to use for generating images
*/
seed?: number;
/**
* Classifier free guidance scale Default value: `3.5`
*/
guidance_scale?: number;
/**
* The number of inference steps to take Default value: `50`
*/
num_inference_steps?: number;
/**
* Whether to perform prompt expansion (recommended) Default value: `true`
*/
expand_prompt?: boolean;
};
export type AuraFlowOutput = {
/**
* The generated images
*/
images: Array<Image>;
/**
* The seed used to generate the images
*/
seed: number;
/**
* The expanded prompt
*/
prompt: string;
};
export type AuraSrInput = {
/**
* URL of the image to upscale.
*/
image_url: string | Blob | File;
/**
* Upscaling factor. More coming soon. Default value: `"4"`
*/
upscaling_factor?: "4";
/**
* Whether to use overlapping tiles for upscaling. Setting this to true helps remove seams but doubles the inference time.
*/
overlapping_tiles?: boolean;
/**
* Checkpoint to use for upscaling. More coming soon. Default value: `"v1"`
*/
checkpoint?: "v1" | "v2";
};
export type AuraSrOutput = {
/**
* Upscaled image
*/
image: Image;
/**
* Timings for each step in the pipeline.
*/
timings: any;
};
export type AutoCaptionInput = {
/**
* URL to the .mp4 video with audio. Only videos of size <100MB are allowed.
*/
video_url: string | Blob | File;
/**
* 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;
/**
* Size of text in generated captions. Default value: `24`
*/
font_size?: number;
/**
* Width of the text strokes in pixels Default value: `1`
*/
stroke_width?: 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;
/**
* 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;
/**
* 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;
};
export type AutoCaptionOutput = {
/**
* URL to the caption .mp4 video.
*/
video_url: string | Blob | File;
};
export type BaseInput = {
/**
* The prompt to generate the video from.
*/
prompt: string;
/**
* The size of the generated video. Default value: `[object Object]`
*/
video_size?: ImageSize | "square_hd" | "square" | "portrait_4_3" | "portrait_16_9" | "landscape_4_3" | "landscape_16_9";
/**
* The negative prompt to generate video from Default value: `""`
*/
negative_prompt?: string;
/**
* The LoRAs to use for the image generation. We currently support one lora. Default value: ``
*/
loras?: Array<LoraWeight>;
/**
* The number of inference steps to perform. Default value: `50`
*/
num_inference_steps?: number;
/**
* The same seed and the same prompt given to the same version of the model
* will output the same video every time.
*/
seed?: 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 video to show you. Default value: `7`
*/
guidance_scale?: number;
/**
* Use RIFE for video interpolation Default value: `true`
*/
use_rife?: boolean;
/**
* The target FPS of the video Default value: `16`
*/
export_fps?: number;
};
export type BatchMoonDreamOutput = {
/**
* URL to the generated captions JSON file containing filename-caption pairs.
*/
captions_file: File;
/**
* List of generated captions
*/
outputs: Array<string>;
};
export type BatchQueryInput = {
/**
* List of image URLs to be processed (maximum 32 images)
*/
images_data_url: string | Blob | File;
/**
* Single prompt to apply to all images
*/
prompt: string;
/**
* Maximum number of tokens to generate Default value: `64`
*/
max_tokens?: number;
};
export type BenV2ImageInput = {
/**
* URL of image to be used for background removal
*/
image_url: string | Blob | File;
/**
* Random seed for reproducible generation.
*/
seed?: number;
};
export type BenV2ImageOutput = {
/**
* The output image after background removal.
*/
image: Image;
/**
* Seed of the generated Image. It will be the same value of the one passed in the
* input or the randomly generated that was used in case none was passed.
*/
seed: number;
};
export type BenV2VideoInput = {
/**
* URL of video to be used for background removal.
*/
video_url: string | Blob | File;
/**
* Random seed for reproducible generation.
*/
seed?: number;
};
export type BenV2VideoOutput = {
/**
* The generated video file.
*/
video: File;
/**
* Seed of the generated Image. It will be the same value of the one passed in the
* input or the randomly generated that was used in case none was passed.
*/
seed: number;
};
export type BGRemoveInput = {
/**
* Input Image to erase from
*/
image_url: string | Blob | File;
/**
* If set to true, the function will wait for the image to be generated and uploaded
* before returning the response. This will increase the latency of the function but
* it allows you to get the image directly in the response without going through the CDN.
*/
sync_mode?: boolean;
};
export type BGRemoveOutput = {
/**
* The generated image
*/
image: Image;
};
export type BGReplaceInput = {
/**
* Input Image to erase from
*/
image_url: string | Blob | File;
/**
* The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. Default value: `""`
*/
ref_image_url?: string | Blob | File;
/**
* The prompt you would like to use to generate images.
*/
prompt?: string;
/**
* The negative prompt you would like to use to generate images. Default value: `""`
*/
negative_prompt?: string;
/**
* Whether to refine prompt Default value: `true`
*/
refine_prompt?: boolean;
/**
* The same seed and the same prompt given to the same version of the model
* will output the same image every time.
*/
seed?: number;
/**
* Whether to use the fast model Default value: `true`
*/
fast?: boolean;
/**
* Number of Images to generate. Default value: `1`
*/
num_images?: number;
/**
* If set to true, the function will wait for the image to be generated and uploaded
* before returning the response. This will increase the latency of the function but
* it allows you to get the image directly in the response without going through the CDN.
*/
sync_mode?: boolean;
};
export type BGReplaceOutput = {
/**
* The generated images
*/
images: Array<Image>;
/**
* Seed value used for generation.
*/
seed: number;
};
export type BirefnetInput = {
/**
* URL of the image to remove background from
*/
image_url: string | Blob | File;
/**
* Model to use for background removal.
* The 'General Use (Light)' model is the original model used in the BiRefNet repository.
* The 'General Use (Heavy)' model is a slower but more accurate model.
* The 'Portrait' model is a model trained specifically for portrait images.
* The 'General Use (Light)' model is recommended for most use cases.
*
* The corresponding models are as follows:
* - 'General Use (Light)': BiRefNet-DIS_ep580.pth
* - 'General Use (Heavy)': BiRefNet-massive-epoch_240.pth
* - 'Portrait': BiRefNet-portrait-TR_P3M_10k-epoch_120.pth Default value: `"General Use (Light)"`
*/
model?: "General Use (Light)" | "General Use (Heavy)" | "Portrait";
/**
* The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images. Default value: `"1024x1024"`
*/
operating_resolution?: "1024x1024" | "2048x2048";
/**
* The format of the output image Default value: `"png"`
*/
output_format?: "webp" | "png";
/**
* Whether to output the mask used to remove the background
*/
output_mask?: boolean;
/**
* Whether to refine the foreground using the estimated mask Default value: `true`
*/
refine_foreground?: boolean;
};
export type BirefnetOutput = {
/**
* Image with background removed
*/
image: Image;
/**
* Mask used to remove the background
*/
mask_image?: Image;
};
export type BirefnetV2Input = {
/**
* URL of the image to remove background from
*/
image_url: string | Blob | File;
/**
* Model to use for background removal.
* The 'General Use (Light)' model is the original model used in the BiRefNet repository.
* The 'General Use (Light)' model is the original model used in the BiRefNet repository but trained with 2K images.
* The 'General Use (Heavy)' model is a slower but more accurate model.
* The 'Matting' model is a model trained specifically for matting images.
* The 'Portrait' model is a model trained specifically for portrait images.
* The 'General Use (Light)' model is recommended for most use cases.
*
* The corresponding models are as follows:
* - 'General Use (Light)': BiRefNet-DIS_ep580.pth
* - 'General Use (Heavy)': BiRefNet-massive-epoch_240.pth
* - 'Portrait': BiRefNet-portrait-TR_P3M_10k-epoch_120.pth Default value: `"General Use (Light)"`
*/
model?: "General Use (Light)" | "General Use (Light 2K)" | "General Use (Heavy)" | "Matting" | "Portrait" | "High Resolutions";
/**
* The resolution to operate on. The higher the resolution, the more accurate the output will be for high res input images. Default value: `"1024x1024"`
*/
operating_resolution?: "1024x1024" | "2048x2048";
/**
* The format of the output image Default value: `"png"`
*/
output_format?: "webp" | "png";
/**
* Whether to output the mask used to remove the background
*/
output_mask?: boolean;
/**
* Whether to refine the foreground using the estimated mask Default value: `true`
*/
refine_foreground?: boolean;
};
export type BirefnetV2Output = {
/**
* Image with background removed
*/
image: Image;
/**
* Mask used to remove the background
*/
mask_image?: Image;
};
export type BlurMaskInput = {
/**
* Input image url.
*/
image_url: string | Blob | File;
/**
* The radius of the Gaussian blur. Default value: `5`
*/
radius?: number;
};
export type BlurMaskOutput = {
/**
* The mask
*/
image: Image;
};
export type BrEngOutput = {
/**
* The generated music
*/
audio: File;
};
export type BriaBackgroundRemoveInput = {
/**
* Input Image to erase from
*/
image_url: string | Blob | File;
/**
* If set to true, the function will wait for the image to be generated and uploaded
* before returning the response. This will increase the latency of the function but
* it allows you to get the image directly in the response without going through the CDN.
*/
sync_mode?: boolean;
};
export type BriaBackgroundRemoveOutput = {
/**
* The generated image
*/
image: Image;
};
export type BriaBackgroundReplaceInput = {
/**
* Input Image to erase from
*/
image_url: string | Blob | File;
/**
* The URL of the reference image to be used for generating the new background. Use "" to leave empty. Either ref_image_url or bg_prompt has to be provided but not both. If both ref_image_url and ref_image_file are provided, ref_image_url will be used. Accepted formats are jpeg, jpg, png, webp. Default value: `""`
*/
ref_image_url?: string | Blob | File;
/**
* The prompt you would like to use to generate images.
*/
prompt?: string;
/**
* The negative prompt you would like to use to generate images. Default value: `""`
*/
negative_prompt?: string;
/**
* Whether to refine prompt Default value: `true`
*/
refine_prompt?: boolean;
/**
* The same seed and the same prompt given to the same version of the model
* will output the same image every time.
*/
seed?: number;
/**
* Whether to use the fast model Default value: `true`
*/
fast?: boolean;
/**
* Number of Images to generate. Default value: `1`
*/
num_images?: number;
/**
* If set to true, the function will wait for the image to be generated and uploaded
* before returning the response. This will increase the latency of the function but
* it allows you to get the image directly in the response without going through the CDN.
*/
sync_mode?: boolean;
};
export type BriaBackgroundReplaceOutput = {
/**
* The generated images
*/
images: Array<Image>;
/**
* Seed value used for generation.
*/
seed: number;
};
export type BriaEraserInput = {
/**
* Input Image to erase from
*/
image_url: string | Blob | File;
/**
* The URL of the binary mask image that represents the area that will be cleaned.
*/
mask_url: string | Blob | File;
/**
* You can use this parameter to specify the type of the input mask from the list. 'manual' opttion should be used in cases in