### Install and Configure Node.js Client Source: https://fal.ai/models/bytedance/seedance-2.0/fast/reference-to-video Installation and environment setup for the Node.js client. ```bash npm install @fal-ai/client export FAL_KEY="YOUR_API_KEY" ``` -------------------------------- ### Install Fal Client and Set API Key Source: https://fal.ai/models/bytedance/seedance-2.0/fast/image-to-video Required setup for Python and Node.js environments. ```bash pip install fal-client export FAL_KEY="YOUR_API_KEY" ``` ```bash npm install @fal-ai/client export FAL_KEY="YOUR_API_KEY" ``` -------------------------------- ### Python Quick Start Source: https://fal.ai/models/fal-ai/kling/v1-5/kolors-virtual-try-on Installation, authentication, and usage of the Kling Kolors Virtual Try-On model in Python. ```bash pip install fal-client ``` ```bash export FAL_KEY="YOUR_API_KEY" ``` ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/kling/v1-5/kolors-virtual-try-on", arguments={ "human_image_url": "https://example.com/person.jpg", "garment_image_url": "https://example.com/shirt.jpg" }, with_logs=True, on_queue_update=on_queue_update, ) print(result["image"]["url"]) # output image URL ``` -------------------------------- ### Node.js Quick Start Source: https://fal.ai/models/fal-ai/kling/v1-5/kolors-virtual-try-on Installation, authentication, and usage of the Kling Kolors Virtual Try-On model in Node.js. ```bash npm install --save @fal-ai/client ``` ```bash export FAL_KEY="YOUR_API_KEY" ``` ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/kling/v1-5/kolors-virtual-try-on", { input: { human_image_url: "https://example.com/person.jpg", garment_image_url: "https://example.com/shirt.jpg" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data.image.url); // output image URL ``` -------------------------------- ### Install SDK Source: https://fal.ai/models/fal-ai/flux-lora Placeholder for SDK installation instructions. ```bash ``` -------------------------------- ### Install Client Library Source: https://fal.ai/models/fal-ai/minimax/hailuo-02/standard/image-to-video Placeholder for the installation command for the fal client library. ```bash bash ``` -------------------------------- ### Install fal-ai client Source: https://fal.ai/models/alibaba/happy-horse/text-to-video Install the required client library for JavaScript or Python. ```bash npm install @fal-ai/client ``` ```bash pip install fal-client ``` -------------------------------- ### Install Python Client Source: https://fal.ai/models/bria/fibo/generate/llms.txt Command to install the required fal-client package. ```bash pip install fal-client ``` -------------------------------- ### Full Configuration Example Source: https://fal.ai/models/fal-ai/ltx-2.3-quality/extend-video/llms.txt Comprehensive example demonstrating all available parameters for fine-tuning the video extension process. ```json { "prompt": "Continue the scene naturally, maintaining the same style and motion.", "video_url": "https://v3b.fal.media/files/b/0a8824b1/sdm0KfmenrlywesfzY1Y1_if6euPp1.mp4", "extend_direction": "forward", "num_frames": 121, "num_context_frames": 25, "end_image_strength": 1, "resolution": "auto", "match_input_fps": true, "frames_per_second": 24, "video_strength": 1, "num_inference_steps": 15, "guidance_scale": 1, "generate_audio": true, "negative_prompt": "color distortion, overexposure, static, blurry details, subtitles, style, artwork, painting, frame, still, dim overall tone, worst quality, low quality, JPEG compression artifacts, ugly, mutilated, extra fingers, poorly drawn hands, poorly drawn face, deformed, disfigured, malformed limbs, fused fingers, motionless frame, cluttered background, three legs, crowded background, walking backwards", "enable_prompt_expansion": true, "enable_safety_checker": true, "video_quality": "high", "video_write_mode": "balanced" } ``` -------------------------------- ### Full Example Source: https://fal.ai/models/fal-ai/bria/background/replace/llms.txt A comprehensive example showing all optional parameters including 'ref_image_url', 'prompt', 'refine_prompt', 'fast', and 'num_images'. ```json { "image_url": "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_fg.jpg", "ref_image_url": "https://storage.googleapis.com/falserverless/bria/bria_bg_replace_bg.jpg", "prompt": "Man leaning against a wall", "refine_prompt": true, "fast": true, "num_images": 1 } ``` -------------------------------- ### Generate Video with Start and End Frames in Python Source: https://fal.ai/models/fal-ai/seedance-2/fast/image-to-video?share=9aab0ffe-ba2e-42ed-b6cd-aef6841e9c82 Specify both start and end images to guide the video generation process. ```python result = fal_client.subscribe( "bytedance/seedance-2.0/fast/image-to-video", arguments={ "prompt": "The sun sets behind the mountains, sky shifting from gold to deep purple.", "image_url": "https://your-host.com/golden-hour.jpg", "end_image_url": "https://your-host.com/twilight.jpg", "duration": "8", "aspect_ratio": "16:9", }, ) ``` -------------------------------- ### JavaScript Client Usage Source: https://fal.ai/models/bria/video/background-removal/realtime/llms.txt Example of using the @fal-ai/client JavaScript library for real-time background removal. Install with 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("bria/video/background-removal/realtime", { input: {}, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### Installation and Configuration Source: https://fal.ai/models/fal-ai/kling-video/o3/standard/image-to-video Commands to install the required client library and set the API key environment variable. ```bash npm install --save @fal-ai/client ``` ```bash export FAL_KEY="YOUR_API_KEY" ``` -------------------------------- ### Python Client Usage Source: https://fal.ai/models/bria/video/background-removal/realtime/llms.txt Example of using the fal-client Python library to subscribe to real-time background removal updates. Install with 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "bria/video/background-removal/realtime", arguments={}, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Python Client Usage Example Source: https://fal.ai/models/fal-ai/veo3.1/llms.txt Example of how to use the Veo 3.1 API with the Python client library, including installation instructions and code for making a request. ```APIDOC ## Python Client Example Ensure you have the Python client installed: ```bash pip install fal-client ``` Then use the API client to make requests: ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/veo3.1", arguments={ "prompt": "Two person street interview in New York City. Sample Dialogue: Host: \"Did you hear the news?\" Person: \"Yes! Veo 3.1 is now available on fal. If you want to see it, go check their website.\"" }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` ``` -------------------------------- ### Python Client Request Source: https://fal.ai/models/fal-ai/trellis-2/llms.txt Example of using the fal-client Python library to subscribe to model updates and stream logs. Install the client using 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/trellis-2", arguments={ "image_url": "https://v3b.fal.media/files/b/0a86b60d/xkpao5B0uxmH0tmJm0HVL_2fe35ce1-fe44-475b-b582-6846a149537c.png" }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Full API Input Example Source: https://fal.ai/models/fal-ai/kling-video/o3/pro/reference-to-video/llms.txt A comprehensive example showing how to define prompts, elements with reference images, and video configuration settings. ```json { "prompt": "@Element1 and @Element2 enters the scene from two sides. Elephant starts to play with the ball", "multi_prompt": null, "start_image_url": "https://v3b.fal.media/files/b/0a8d1b38/myilPNN_WYdJCmpTy4Sjr_6XNBi9Mm.png", "elements": [ { "frontal_image_url": "https://v3b.fal.media/files/b/0a8d1b2e/yiHiZP1Now0V5JC5_OClE_PaKOtOGJ.png", "reference_image_urls": [ "https://v3b.fal.media/files/b/0a8d1b1a/eZfSbcQ58EzD_l2SEbevg_F3U9GMLK.png" ] }, { "frontal_image_url": "https://v3b.fal.media/files/b/0a8d1b19/_eIj7GjmI5zgQkMN936YJ_2f3hZ7Xb.png", "reference_image_urls": [ "https://v3b.fal.media/files/b/0a8d1b3c/_ZE2iIjkb-Eun3WXXGP4x_TSG1ELBo.png" ] } ], "duration": "8", "shot_type": "customize", "aspect_ratio": "16:9" } ``` -------------------------------- ### Hunyuan World API Request with Python Client Source: https://fal.ai/models/fal-ai/hunyuan_world/image-to-world/llms.txt Example of using the fal-client Python library to generate a 3D world from an image. Install with 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/hunyuan_world/image-to-world", arguments={ "image_url": "https://v3.fal.media/files/penguin/_4oXlxt85dr0WY2o0I894_output.png", "labels_fg1": "tree, grass, sky", "labels_fg2": "mountain, water", "classes": "nature, landscape" }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Full Configuration Example for Nano Banana 2 Edit Source: https://fal.ai/models/fal-ai/nano-banana-2/edit/llms.txt A comprehensive example demonstrating all available parameters for the edit model. ```json { "prompt": "make a photo of the man driving the car down the california coastline", "num_images": 1, "aspect_ratio": "auto", "output_format": "png", "safety_tolerance": "4", "image_urls": [ "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input.png", "https://storage.googleapis.com/falserverless/example_inputs/nano-banana-edit-input-2.png" ], "resolution": "1K", "video_url": "https://storage.googleapis.com/falserverless/web-examples/wan/t2v.mp4", "audio_url": "https://storage.googleapis.com/falserverless/example_inputs/reference_audio.wav", "pdf_url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf", "limit_generations": true } ``` -------------------------------- ### Full Input Configuration Example Source: https://fal.ai/models/tripo3d/h3.1/multiview-to-3d/llms.txt Comprehensive JSON payload demonstrating optional parameters like texture, PBR, and quality settings. ```json { "image_urls": [ "https://v3b.fal.media/files/b/zebra/3osHJDI8IZ2wl6sGtEUeB_image.png", "https://v3b.fal.media/files/b/zebra/3osHJDI8IZ2wl6sGtEUeB_image.png" ], "texture": true, "pbr": true, "texture_quality": "standard", "geometry_quality": "standard", "texture_alignment": "original_image", "orientation": "default" } ``` -------------------------------- ### Python Client for Music Generation Source: https://fal.ai/models/cassetteai/music-generator/llms.txt Example Python code using the fal-client library to generate music. Ensure the client is installed via 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "CassetteAI/music-generator", arguments={ "prompt": "Smooth chill hip-hop beat with mellow piano melodies, deep bass, and soft drums, perfect for a night drive. Key: D Minor, Tempo: 90 BPM.", "duration": 50 }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Python Client Usage Source: https://fal.ai/models/mirelo-ai/sfx-v1/video-to-audio/llms.txt Example Python code using the fal-client library to subscribe to the Mirelo SFX model. Ensure the client is installed via 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "mirelo-ai/sfx-v1/video-to-audio", arguments={ "video_url": "https://di3otfzjg1gxa.cloudfront.net/input_example.mp4" }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Install the @fal-ai/client package Source: https://fal.ai/models/alibaba/happy-horse/v1.1/image-to-video/api Install the required client library using your preferred package manager. ```bash npm install --save @fal-ai/client ``` -------------------------------- ### Full Input Parameters Example (JSON) Source: https://fal.ai/models/bria/video/background-removal/realtime/llms.txt A comprehensive JSON example demonstrating how to set background blur strength, color, and type. ```json { "blur_strength": 50, "background_color": "Black", "background_type": "color" } ``` -------------------------------- ### Qwen Image Trainer Python Client Usage Source: https://fal.ai/models/fal-ai/qwen-image-trainer/llms.txt Python code example using the fal-client library to subscribe to the Qwen Image Trainer. Install with 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/qwen-image-trainer", arguments={ "image_data_url": "" }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Input Parameters Example Source: https://fal.ai/models/fal-ai/z-image/turbo/tiling/api A sample JSON payload demonstrating the configuration of prompt, tiling, and generation settings. ```json { "prompt": "A hyper-realistic, high-resolution 4k texture of an ancient weathered brick wall heavily overgrown with lush green moss and soft lichens. The bricks are aged, featuring deep earthy tones, natural cracks, and gritty textures. Vibrant emerald moss fills the mortar lines and spills over the rough surfaces of the stones. Uniform, flat cinematic lighting ensures no harsh shadows, highlighting the intricate organic details and damp stone surfaces. The composition is a perfectly balanced overhead view, showcasing a rich tapestry of botanical growth and masonry craftsmanship with professional clarity and hyper-detailed grit.", "image_size": "square_hd", "num_inference_steps": 8, "num_images": 1, "enable_safety_checker": true, "output_format": "png", "acceleration": "regular", "strength": 0.6, "tile_size": 128, "tile_stride": 64, "tiling_mode": "both" } ``` -------------------------------- ### Hunyuan World API Request with JavaScript Client Source: https://fal.ai/models/fal-ai/hunyuan_world/image-to-world/llms.txt Example of using the @fal-ai/client JavaScript library to generate a 3D world. Install with 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/hunyuan_world/image-to-world", { input: { image_url: "https://v3.fal.media/files/penguin/_4oXlxt85dr0WY2o0I894_output.png", labels_fg1: "tree, grass, sky", labels_fg2: "mountain, water", classes: "nature, landscape" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### JavaScript Client for Music Generation Source: https://fal.ai/models/cassetteai/music-generator/llms.txt Example JavaScript code using the @fal-ai/client library to generate music. Ensure the client is installed via 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("CassetteAI/music-generator", { input: { prompt: "Smooth chill hip-hop beat with mellow piano melodies, deep bass, and soft drums, perfect for a night drive. Key: D Minor, Tempo: 90 BPM.", duration: 50 }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### JavaScript Client Usage Source: https://fal.ai/models/mirelo-ai/sfx-v1/video-to-audio/llms.txt Example JavaScript code using the @fal-ai/client library to subscribe to the Mirelo SFX model. Ensure the client is installed via 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("mirelo-ai/sfx-v1/video-to-audio", { input: { video_url: "https://di3otfzjg1gxa.cloudfront.net/input_example.mp4" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### Qwen Image Trainer JavaScript Client Usage Source: https://fal.ai/models/fal-ai/qwen-image-trainer/llms.txt JavaScript code example using the @fal-ai/client library to subscribe to the Qwen Image Trainer. Install with 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/qwen-image-trainer", { input: { image_data_url: "" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### Python Client for Minimax Music 2.5 Source: https://fal.ai/models/fal-ai/minimax-music/v2.5/llms.txt Example Python code using the fal-client library to generate music with Minimax Music 2.5. Install the client using 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/minimax-music/v2.5", arguments={ "prompt": "Indie folk, melancholic, introspective, longing, solitary walk, coffee shop" }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Example input configuration Source: https://fal.ai/models/fal-ai/z-image/turbo/api A sample JSON object demonstrating the required and optional input parameters for the model. ```json { "prompt": "A hyper-realistic, close-up portrait of a tribal elder from the Omo Valley, painted with intricate white chalk patterns and adorned with a headdress made of dried flowers, seed pods, and rusted bottle caps. The focus is razor-sharp on the texture of the skin, showing every pore, wrinkle, and scar that tells a story of survival. The background is a blurred, smoky hut interior, with the warm glow of a cooking fire reflecting in the subject's dark, soulful eyes. Shot on a Leica M6 with Kodak Portra 400 film grain aesthetic.", "image_size": "landscape_4_3", "num_inference_steps": 8, "num_images": 1, "enable_safety_checker": true, "output_format": "png", "acceleration": "regular" } ``` -------------------------------- ### Python Client Usage Source: https://fal.ai/models/fal-ai/inworld-tts/llms.txt Example of using the fal-client Python library to subscribe to TTS model updates and receive audio results. Ensure the client is installed via 'pip install fal-client'. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/inworld-tts", arguments={ "text": "Hello! This is a demo of Inworld's TTS." }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Wan 2.7 Image-to-Video Full Input Example Source: https://fal.ai/models/fal-ai/wan/v2.7/image-to-video/llms.txt A comprehensive example demonstrating all available input parameters for the Wan 2.7 image-to-video model. ```json { "prompt": "The massive humpback whale glides slowly through the deep blue water. It turns gracefully, its huge pectoral fin sweeping through the water like a wing. Sunbeams penetrate from above, illuminating the whale's textured skin. Small fish scatter. Awe-inspiring scale and grace.", "image_url": "https://v3b.fal.media/files/b/0a9413bb/qH6QY4JRzWxHOFKtCe70S_uPDJyzKZ.png", "resolution": "1080p", "duration": 5, "negative_prompt": "low resolution, errors, worst quality, low quality, incomplete, extra fingers, bad proportions, blurry, distorted", "enable_prompt_expansion": true, "enable_safety_checker": true } ``` -------------------------------- ### Queue API Initialization in Python Source: https://fal.ai/models/alibaba/happy-horse/reference-to-video Initial setup for using the fal_client library in Python. ```python import fal_client ``` -------------------------------- ### Qwen Image Trainer Input Schema (Full Example) Source: https://fal.ai/models/fal-ai/qwen-image-trainer/llms.txt Example JSON showing all optional parameters for the Qwen Image Trainer API, including steps and learning rate. ```json { "image_data_url": "", "steps": 1000, "learning_rate": 0.0005 } ``` -------------------------------- ### JavaScript Client for Minimax Music 2.5 Source: https://fal.ai/models/fal-ai/minimax-music/v2.5/llms.txt Example JavaScript code using the @fal-ai/client library to generate music with Minimax Music 2.5. Install the client using 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/minimax-music/v2.5", { input: { prompt: "Indie folk, melancholic, introspective, longing, solitary walk, coffee shop" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### Full Input Example Source: https://fal.ai/models/fal-ai/kling-video/v3/standard/text-to-video/llms.txt A complete JSON payload demonstrating all available configuration options for video generation. ```json { "prompt": "Cinematic drone shot flying through ancient stone ruins covered in moss and vines at golden hour. Camera starts low, rises through crumbling archways, revealing a vast misty valley beyond. Volumetric light rays pierce through gaps in the stone. Epic scale, photorealistic, 8K quality.", "duration": "5", "multi_prompt": null, "generate_audio": true, "shot_type": "customize", "aspect_ratio": "16:9", "negative_prompt": "blur, distort, and low quality", "cfg_scale": 0.5 } ``` -------------------------------- ### Python Client Usage Example Source: https://fal.ai/models/alibaba/happy-horse/text-to-video/llms.txt Shows how to use the fal-client Python library to subscribe to the text-to-video model, providing prompt arguments and handling real-time log updates. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "alibaba/happy-horse/text-to-video", arguments={ "prompt": "A little girl walking on the road at sunset, cinematic lighting, smooth camera movement." }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### JavaScript Client Usage Source: https://fal.ai/models/fal-ai/minimax/hailuo-02/standard/image-to-video/llms.txt Example JavaScript code using the @fal-ai/client library to subscribe to image-to-video generation updates and receive results. Ensure the client is installed via 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/minimax/hailuo-02/standard/image-to-video", { input: { prompt: "Man walked into winter cave with polar bear", image_url: "https://storage.googleapis.com/falserverless/model_tests/minimax/1749891352437225630-389852416840474630_1749891352.png" }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### JavaScript Client Usage with Logs Source: https://fal.ai/models/fal-ai/heygen/avatar5/digital-twin/llms.txt Provides an example of using the @fal-ai/client JavaScript library to make requests and handle real-time updates and logs. Install the client using 'npm install --save @fal-ai/client'. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/heygen/avatar5/digital-twin", { input: {}, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ``` -------------------------------- ### Recommended Training Configuration Source: https://fal.ai/models/ideogram/v4/trainer Initial configuration settings for starting a training job. Adjust steps and learning rate based on output quality. ```json { "images_data_url": "https://your-host/dataset.zip", "steps": 1000, "resolution": "auto", "learning_rate": 0.0001, "default_caption": "a photo of sks subject", "output_lora_format": "fal" } ``` -------------------------------- ### Image Description Prompt Example Source: https://fal.ai/models/nvidia/nemotron-3-nano-omni/vision/examples A sample prompt structure used to guide the model in describing a stylized portrait. ```text This is a highly stylized, close-up portrait of a person featuring elaborate and surreal body art. **Face and Makeup:** The person's face is the central focus, covered in intricate, colorful patterns that resemble a mix of tribal art, paisley, and organic textures. * **Colors:** The ``` -------------------------------- ### Install and use Python client Source: https://fal.ai/models/bytedance/seedream/v5/lite/text-to-image/llms.txt Install the fal-client package and use the subscribe method to handle asynchronous image generation with log streaming. ```bash pip install fal-client ``` ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "bytedance/seedream/v5/lite/text-to-image", arguments={ "prompt": "Realistic DSLR photograph of anthropomorphic Penkingese dog enjoying a bowl of ramen on the Great Wall of China with the words \"Seedream 5.0 Lite available on fal\" visible at the top." }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Python Client for MiniMax Speech 2.6 Turbo Source: https://fal.ai/models/fal-ai/minimax/speech-2.6-turbo/llms.txt Example Python code using the fal-client library to generate speech. Install the client with 'pip install fal-client'. The on_queue_update function handles log messages during processing. ```python import fal_client def on_queue_update(update): if isinstance(update, fal_client.InProgress): for log in update.logs: print(log["message"]) result = fal_client.subscribe( "fal-ai/minimax/speech-2.6-turbo", arguments={ "prompt": "Hello world! Welcome MiniMax's new text to speech model <#0.1#> Speech 2.6 Turbo, now available on Fal!" }, with_logs=True, on_queue_update=on_queue_update, ) print(result) ``` -------------------------------- ### Full Example for Prompt to Audio Source: https://fal.ai/models/fal-ai/ace-step/prompt-to-audio/llms.txt This JSON snippet demonstrates all available parameters for generating audio, including prompt, instrumental flag, duration, steps, scheduler, guidance types, and various scale and interval settings. ```json { "prompt": "A lofi hiphop song with a chill vibe about a sunny day on the boardwalk.", "instrumental": false, "duration": 60, "number_of_steps": 27, "scheduler": "euler", "guidance_type": "apg", "granularity_scale": 10, "guidance_interval": 0.5, "guidance_interval_decay": 0, "guidance_scale": 15, "minimum_guidance_scale": 3, "tag_guidance_scale": 5, "lyric_guidance_scale": 1.5 } ``` -------------------------------- ### Generate Video with MiniMax using JavaScript Client Source: https://fal.ai/models/fal-ai/minimax/video-01-live/llms.txt This JavaScript example uses the @fal-ai/client library to generate a video. Install the client with 'npm install --save @fal-ai/client'. It demonstrates handling logs and processing the final result. ```javascript import { fal } from "@fal-ai/client"; const result = await fal.subscribe("fal-ai/minimax/video-01-live", { input: { prompt: "A rugged middle-aged man with wheat-colored skin and a full beard streaked with gray stands in the harsh sunlight of a desert outpost. His curly hair is windswept, and sweat drips down the bridge of his slightly crooked nose. His faded utility jacket and weathered boots are caked in dust, while his sharp, watchful eyes scan the horizon." }, logs: true, onQueueUpdate: (update) => { if (update.status === "IN_PROGRESS") { update.logs.map((log) => log.message).forEach(console.log); } }, }); console.log(result.data); console.log(result.requestId); ```