Image

class pipecat.services.fal.image.FalImageGenService(*, params, aiohttp_session, model='fal-ai/fast-sdxl', key=None, **kwargs)[source]

Bases: ImageGenService

Parameters:
  • params (InputParams)

  • aiohttp_session (ClientSession)

  • model (str)

  • key (str | None)

class InputParams(*, seed=None, num_inference_steps=8, num_images=1, image_size='square_hd', expand_prompt=False, enable_safety_checker=True, format='png')[source]

Bases: BaseModel

Parameters:
  • seed (int | None)

  • num_inference_steps (int)

  • num_images (int)

  • image_size (str | Dict[str, int])

  • expand_prompt (bool)

  • enable_safety_checker (bool)

  • format (str)

seed: int | None
num_inference_steps: int
num_images: int
image_size: str | Dict[str, int]
expand_prompt: bool
enable_safety_checker: bool
format: str
model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

async run_image_gen(prompt)[source]

Generate an image from a text prompt.

This method must be implemented by subclasses to provide actual image generation functionality using their specific AI service.

Parameters:

prompt (str) – The text prompt to generate an image from.

Yields:

Frame

Frames containing the generated image (typically ImageRawFrame

or URLImageRawFrame).

Return type:

AsyncGenerator[Frame, None]