Overview
ReplicateImageGenService generates images from text prompts using models
hosted on Replicate, such as
black-forest-labs/flux-schnell. Any text-to-image model available on Replicate
can be used by setting the model parameter.
Source Repository
Source code, examples, and issues for the Replicate integration
PyPI Package
The
pipecat-replicate package on PyPIReplicate Models
Browse text-to-image models available on Replicate
API Tokens
Create and manage your Replicate API tokens
Installation
This is a community-maintained package distributed separately frompipecat-ai:
Prerequisites
Replicate Account Setup
Before using the Replicate image generation service, you need:- Replicate Account: Sign up at Replicate
- API Token: Create a token from your account settings
Required Environment Variables
REPLICATE_API_TOKEN: Your Replicate API token for authentication
Configuration
HTTP client session used for Replicate API requests and image downloads.
Replicate API token. Falls back to the
REPLICATE_API_TOKEN environment
variable if not provided.Runtime-configurable generation settings. See Settings below.
Base URL for the Replicate API.
Sync wait duration passed in the Replicate
Prefer header.How often to poll Replicate for prediction status.
Maximum number of polling attempts before giving up.
Settings
Runtime-configurable settings passed via thesettings constructor argument
using ReplicateImageGenService.Settings(...).
| Parameter | Type | Default | Description |
|---|---|---|---|
model | str | "black-forest-labs/flux-schnell" | Replicate model identifier. Use owner/name, or owner/name:version. |
aspect_ratio | str | "1:1" | Aspect ratio for generated images. |
num_outputs | int | 1 | Number of images to generate (1–4). |
num_inference_steps | int | 4 | Number of denoising steps. |
seed | int | None | Random seed for reproducible generation. None uses a random seed. |
output_format | str | "webp" | Output image format. |
output_quality | int | 80 | Output quality (0–100). |
disable_safety_checker | bool | False | Whether to disable the model safety checker. |
go_fast | bool | True | Use the model’s faster generation mode. |
megapixels | str | "1" | Approximate megapixel count for generated images. |
Available parameters and defaults are defined by the integration and the
selected Replicate model. See the source
repository for the
authoritative, up-to-date list.