Skip to main content

Overview

FalImageGenService provides high-speed image generation capabilities using fal’s optimized Stable Diffusion XL models. It supports various image sizes, formats, and generation parameters with a focus on fast inference and low-latency image creation.

Fal Image Gen API Reference

Pipecat’s API methods for fal image generation integration

Example Implementation

Browse examples using fal image generation

fal Documentation

Official fal API documentation and model guides

fal Platform

Access fast SDXL models and manage API keys

Installation

To use fal image generation services, install the required dependencies:

Prerequisites

fal Account Setup

Before using fal image generation services, you need:
  1. fal Account: Sign up at fal Platform
  2. API Key: Generate an API key from your account dashboard
  3. Model Selection: Choose from available fast SDXL models
  4. HTTP Session: Configure aiohttp session for image downloading

Required Environment Variables

  • FAL_KEY: Your fal API key for authentication

Configuration

InputParams
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=FalImageGenService.Settings(...) instead.
aiohttp.ClientSession
required
HTTP client session for downloading generated images.
str
default:"None"
deprecated
Deprecated since 0.0.105, removed in 2.0.0. Use settings=FalImageGenService.Settings(model=...) instead.
str
default:"None"
Optional API key for fal. If provided, sets the FAL_KEY environment variable.
FalImageGenService.Settings
default:"None"
Runtime-configurable generation settings. See Settings below.

Settings

Runtime-configurable settings passed via the settings constructor argument using FalImageGenService.Settings(...). See Service Settings for details.

Usage

Basic Setup

With Custom Settings

Notes

  • Environment variable: If the key constructor parameter is provided, it sets the FAL_KEY environment variable automatically.
  • HTTP session required: You must provide an aiohttp.ClientSession for downloading the generated images from fal’s URLs.
  • Image size presets: The image_size parameter accepts string presets (e.g., "square_hd", "landscape_16_9") or a dictionary with explicit width and height values.