Run FAL Model

Action ID: fal_run_model

Description

Run any model on FAL.ai with your API key. This node allows you to execute machine learning models for image generation, video processing, and other AI tasks with optional streaming support.

Provider

FAL

Connection

Name
Description
Required
Category

FAL Connection

The FAL connection to use for the model.

fal

Input Parameters

Name
Type
Required
Default
Description

model

string

-

The FAL model to run (format: 'owner/model_name'). Example: 'fal-ai/fast-sdxl'

input_params

object

-

The input parameters for the model. These vary depending on the model you're using. Check the model's documentation for details.

image_input

string

-

-

Optional image input for models that require an image. This will be added to the input parameters with the key 'image'.

use_streaming

boolean

-

false

Whether to use streaming for models that support it. This allows receiving partial results as they become available.

View JSON Schema
{
  "description": "Run FAL Model node input.",
  "properties": {
    "model": {
      "title": "Model",
      "type": "string",
      "description": "The FAL model to run (format: 'owner/model_name'). Example: 'fal-ai/fast-sdxl'"
    },
    "input_params": {
      "title": "Input Parameters",
      "type": "object",
      "description": "The input parameters for the model. These vary depending on the model you're using. Check the model's documentation for details."
    },
    "image_input": {
      "default": null,
      "title": "Image Input",
      "type": "string",
      "description": "Optional image input for models that require an image. This will be added to the input parameters with the key 'image'."
    },
    "use_streaming": {
      "default": false,
      "title": "Use Streaming",
      "type": "boolean",
      "description": "Whether to use streaming for models that support it. This allows receiving partial results as they become available."
    }
  },
  "required": [
    "model",
    "input_params"
  ],
  "title": "FalRunModelInput",
  "type": "object"
}

Output Parameters

Name
Type
Description

result

any

The output from the FAL model. This can be text, URLs to generated images, or other data depending on the model.

View JSON Schema
{
  "description": "Output from a FAL model.",
  "properties": {
    "result": {
      "title": "Result",
      "description": "The output from the FAL model. This can be text, URLs to generated images, or other data depending on the model."
    }
  },
  "required": [
    "result"
  ],
  "title": "FalModelOutput",
  "type": "object"
}

How It Works

This node sends a request to FAL.ai's API to run a specified machine learning model with your input parameters. FAL.ai executes the model on their optimized infrastructure and returns the results. For models that support streaming, you can enable streaming to receive partial results as they become available, making the interaction more interactive. The output is returned to the next node in your workflow.

Usage Examples

Example 1: Image Generation

Input:

model: "fal-ai/fast-sdxl"
input_params: {
  "prompt": "A beautiful sunset over mountains",
  "negative_prompt": "blurry",
  "num_inference_steps": 20,
  "guidance_scale": 7.5
}
use_streaming: false

Output:

result: {
  "images": [
    {
      "url": "https://fal.media/files/output_123.jpg"
    }
  ]
}

Example 2: Image Processing with Streaming

Input:

model: "fal-ai/image-to-text"
image_input: "https://example.com/photo.jpg"
input_params: {
  "max_tokens": 100
}
use_streaming: true

Output:

result: "A woman standing on a beach with clear blue water in the background, wearing a red sundress..."

Example 3: Video Generation

Input:

model: "fal-ai/stable-video"
input_params: {
  "prompt": "A robot walking through a futuristic city",
  "duration": 4,
  "fps": 24
}

Output:

result: {
  "video": {
    "url": "https://fal.media/files/video_456.mp4"
  }
}

Common Use Cases

  • Image Generation: Generate images using fast and efficient models like SDXL

  • Image Processing: Upscale, enhance, or transform existing images

  • Video Generation: Create videos from text prompts or images

  • Text Extraction: Extract text from images using OCR models

  • Image Analysis: Analyze images and generate descriptions or metadata

  • Real-time Processing: Use streaming for interactive, low-latency AI processing

  • Content Creation: Generate marketing materials, thumbnails, and visual content

Error Handling

Error Type
Cause
Solution

Invalid Model

Model identifier doesn't exist or is malformed

Verify model name on FAL.ai's model repository

Missing Input Parameters

Required parameters for the model are not provided

Check the model's documentation for required inputs

Invalid Image URL

Image URL is not publicly accessible

Ensure URLs are publicly accessible and use http:// or https://

Streaming Not Supported

Model doesn't support streaming but streaming is enabled

Disable streaming or use a model that supports it

Timeout

Model execution takes longer than expected

Check FAL.ai status page or try again later

Rate Limit

Too many concurrent requests to FAL.ai

Implement request queuing or contact FAL.ai support

Notes

  • Model Format: Use the owner/model_name format to reference models. You can browse available models on FAL.ai's model repository. Most models start with the owner prefix, typically 'fal-ai/'.

  • Input Parameters: The input_params object structure depends on the specific model. Refer to the model's documentation on FAL to understand what parameters it accepts and their expected formats.

  • Image URLs: URLs provided in image_input or within input_params should be publicly accessible. The model needs to download them.

  • Streaming Support: Some FAL models support streaming, which returns partial results as they become available. Enable use_streaming to use this feature if supported by the model.

  • Output Format: Model outputs vary by model type. Image models return URLs, video models return video files, and text models return text. Check the specific model's documentation for output format details.

  • Performance: FAL models are optimized for performance. Some models run very quickly, while others may take longer depending on complexity and load.

  • Cost: FAL.ai charges per model execution. Check their pricing page to understand costs for different models.

Last updated

Was this helpful?