Fal.ai Operator
The fal.ai operator provides a direct interface to fal.ai’s powerful image and video generation models, allowing you to create, transform, and enhance visual content using state-of-the-art AI like FLUX, Stable Diffusion, and more.
A key feature of this operator is its ability to dynamically generate parameters. When you select an Endpoint ID
, the operator fetches the corresponding API schema from fal.ai and automatically creates the necessary input parameters for that specific model on the ‘API Parameters’ page. This ensures the interface always matches the requirements of the chosen AI service, whether it’s for text-to-image, image-to-image, or video generation.
Agent Tool Integration
Section titled “Agent Tool Integration”This operator exposes 1 tool that allow Agent and Gemini Live LOPs to generate images and videos using fal.ai's AI models with dynamically filtered parameters based on the selected endpoint and parameter filter settings.
Use the Tool Debugger operator to inspect exact tool definitions, schemas, and parameters.
The fal.ai operator exposes a fal_ai_generate
tool that allows AI agents to generate content using any configured fal.ai endpoint. The operator dynamically filters which parameters are exposed to agents based on the “GetTool Par Filter” setting, providing flexible control over agent access to model parameters.
Requirements
Section titled “Requirements”To use the fal.ai operator, you need the fal-client
Python package.
- Install Dependencies: If you see errors or the operator doesn’t function, click the
Install Dependencies
pulse parameter on the ‘API’ page to install the required Python packages using the project’spython_manager
.
Finding API Endpoint IDs & Pricing
Section titled “Finding API Endpoint IDs & Pricing”Discovering Available Endpoints
Section titled “Discovering Available Endpoints”To find the correct endpoint ID for your desired AI model, you have several options:
- Official fal.ai Website: Visit fal.ai and browse the model gallery
- Model Gallery: Navigate to fal.ai/models to explore available models
- Documentation: Check docs.fal.ai for comprehensive API documentation
Getting Endpoint IDs
Section titled “Getting Endpoint IDs”Once you’ve found a model you want to use:
- Log into your fal.ai account and navigate to the desired model page
- Look for the API tab or documentation section on the model page
- Copy the endpoint ID - it typically follows the format
fal-ai/model-name
(e.g.,fal-ai/flux-dev
,fal-ai/kling-video/v2/master/image-to-video
) - Paste the endpoint ID into the
Endpoint ID
parameter in the fal.ai operator
Understanding Pricing & Costs
Section titled “Understanding Pricing & Costs”Important: fal.ai pricing is based on the models used within workflows, not per workflow. Costs vary significantly depending on the type of content generated.
Pricing Structure
Section titled “Pricing Structure”- Image Models: Typically charged per megapixel (e.g., ~$0.003-$0.05 per megapixel)
- Video Models: Usually charged per video second or per video (e.g., ~$0.095-$0.5+ per video/second)
- Complex Workflows: May use multiple models, with total cost being the sum of each model’s pricing
Common Model Pricing Examples
Section titled “Common Model Pricing Examples”Popular Image Models:
- FLUX.1 [schnell]: ~$0.003 per megapixel (fastest, lowest cost)
- FLUX.1 [dev]: ~$0.025 per megapixel (balanced quality/cost)
- FLUX.1 [pro]: ~$0.05 per megapixel (highest quality)
Popular Video Models:
- Kling v1.6: ~$0.095 per video second
- Kling 2.1 Master: ~$0.28 per video second
- MiniMax Video-01 Live: ~$0.5 per video
- Wan-2.1 Pro: ~$0.4 per video
Cost Management Tips
Section titled “Cost Management Tips”- Monitor Usage: Regularly check your fal.ai dashboard for credit consumption
- Start Small: Test with lower-cost models like FLUX.1 [schnell] before using expensive video models
- Video Workflows: Be especially cautious with video generation - costs can add up quickly
- Check Model Pages: Visit individual model pages for the most current pricing information
- Set Budgets: Consider setting usage alerts or budgets in your fal.ai account settings
Credit System
Section titled “Credit System”- Pre-purchase Required: You must buy credits in advance before using any models
- Credit Expiration: Credits expire after 365 days (or 90 days for promotional credits)
- No Refunds: Credits are non-refundable and non-transferable
For the most current and detailed pricing information, always refer to:
- Main Pricing Page: fal.ai/pricing
- Individual Model Pages: Each model page shows specific pricing details
- Support: Contact support@fal.ai for pricing on unlisted models
Input/Output
Section titled “Input/Output”Inputs
Section titled “Inputs”This operator does not use standard wire inputs. Instead, it uses TOPs connected directly to its parameters for image-based models.
- Dynamic TOP Inputs: For models that require image inputs (e.g., image-to-image, inpainting), the operator will dynamically create
TOP
type parameters on the ‘API Parameters’ page. You can connect any TOP (like aMovie File In
orRamp
) to these parameters. The operator automatically converts the texture data to the required format for the API.
Outputs
Section titled “Outputs”- out1 (TOP): The generated image or video output as a texture. When
Auto Save
is enabled, this TOP displays the most recently saved local file. - out2 (Text DAT): Contains the full, formatted JSON response from the fal.ai API call.
- out3 (Table DAT): A log of all executions, showing timestamps, status, duration, and results.
Parameters
Section titled “Parameters”op('fal_ai').par.Status
Str - Default:
"" (Empty String)
op('fal_ai').par.Active
Toggle - Default:
Off
op('fal_ai').par.Execute
Pulse - Default:
None
op('fal_ai').par.Apiparfilter
Str - Default:
prompt
Dynamic API Parameters (Example)
Section titled “Dynamic API Parameters (Example)”The following parameters are examples of what appears in the API Parameters section after selecting an endpoint like fal-ai/flux/dev
. These parameters are automatically generated from the fal.ai API schema:
op('fal_ai').par.Dynprompt
Str - Default:
"" (Empty String)
op('fal_ai').par.Dynnuminfsteps
Int - Default:
28
op('fal_ai').par.Dynseed
Int - Default:
0
op('fal_ai').par.Dynguidance
Float - Default:
3.5
op('fal_ai').par.Dynenablesafetychecker
Toggle - Default:
true
Note: The exact parameters depend on the selected endpoint. Image-to-image models will include additional parameters for input images, while other models may have different parameter sets entirely.
op('fal_ai').par.Apikey
Str - Default:
"" (Empty String)
op('fal_ai').par.Refreshendpoint
Pulse - Default:
None
op('fal_ai').par.Discoverendpoints
Pulse - Default:
None
op('fal_ai').par.Installdependencies
Pulse - Default:
None
op('fal_ai').par.Enableexecution
Toggle - Default:
On
op('fal_ai').par.Autosave
Toggle - Default:
Off
op('fal_ai').par.Savepath
Str - Default:
project.folder + "/fal_ai_images/"
op('fal_ai').par.Savequality
Float - Default:
0.9
- Range:
- 0 to 1
op('fal_ai').par.Savenamingpattern
Str - Default:
fal_ai_{timestamp}_{endpoint}
op('fal_ai').par.Savebase64injson
Toggle - Default:
Off
Usage Examples
Section titled “Usage Examples”1. Generating an Image from a Text Prompt
Section titled “1. Generating an Image from a Text Prompt”- Create a
fal.ai
operator. - On the API page, select an image generation
Endpoint ID
, likefal-ai/flux/dev
. - Go to the API Parameters page. Wait a moment for the dynamic parameters to appear.
- Find the
Dynprompt
parameter and enter your desired text (e.g., “A futuristic city at sunset, cyberpunk style”). - Click the
Execute / Call
pulse. - The generated image appears in the out1 TOP.
2. Using a TOP for Image-to-Image
Section titled “2. Using a TOP for Image-to-Image”- Select an
Endpoint ID
that supports image inputs, such asfal-ai/flux/dev/image-to-image
. - On the API Parameters page, a new TOP parameter (e.g.,
Dyninputimage
) will appear. - Connect an image TOP (e.g., a
Movie File In
TOP) to this new parameter. - Adjust other parameters like
Dynprompt
to guide the transformation. - Click
Execute / Call
. The transformed image will appear in the out1 TOP.
3. Generating a Video
Section titled “3. Generating a Video”- Select a video generation
Endpoint ID
. - Configure the dynamic parameters (e.g., text prompt, seed).
- Enable
Auto Save
on the Auto Save page to automatically save the resulting video file. - Click
Execute / Call
. - The operator will download the generated video and the out1 TOP will display it once saved. The local file path will appear in the internal
resultsTable
.
GetTool Parameter Filtering
Section titled “GetTool Parameter Filtering”The fal.ai operator uses sophisticated parameter filtering to control which dynamically generated parameters are exposed to AI agents through the GetTool system. This filtering is controlled by the GetTool Par Filter parameter and supports advanced pattern matching:
Pattern Matching Syntax
Section titled “Pattern Matching Syntax”The parameter filter uses Unix shell-style wildcards with the following features:
*
- Matches any number of characters (including none)?
- Matches exactly one character^pattern
- Excludes parameters matching the pattern (negation)- Multiple patterns - Separate with spaces for OR logic
Filter Examples
Section titled “Filter Examples”Filter Pattern | Description | Matches |
---|---|---|
* | All parameters | prompt, seed, guidance, image_size, etc. |
prompt | Exact match | prompt only |
*prompt* | Contains “prompt” | prompt, negative_prompt, style_prompt |
seed guidance | Multiple specific | seed OR guidance |
*size* | Contains “size” | image_size, canvas_size, output_size |
* ^seed | All except seed | All parameters except those matching “seed” |
*prompt ^negative* | Prompts but not negative | prompt, style_prompt (but not negative_prompt) |
Workflow Integration
Section titled “Workflow Integration”This filtering system allows you to:
- Control Agent Access - Limit which parameters agents can modify
- Simplify Tool Interface - Expose only relevant parameters to reduce complexity
- Maintain Security - Hide sensitive parameters from agent control
- Optimize Performance - Reduce tool schema size for faster agent processing
The default filter prompt
exposes only prompt-related parameters, providing a safe starting point for agent integration.
Technical Notes
Section titled “Technical Notes”- API Keys: The operator securely manages your API key. You can enter it once in the
Apikey
parameter, and it will be stored for future use, preferably in the centralChatTD
KeyManager if available. - Dynamic Resolution: For image models, the operator can automatically detect the output resolution from the API response and update a
get_output
operator in the network to match, simplifying workflows.