Skip to main content
image_generation_model.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Use the stable image model

Before running the source-fidelity code, change gemini-3-pro-image-preview to gemini-3-pro-image. The preview model has been shut down.
5

Run the example

Save the code above as image_generation_model.py, then run:
Full source: cookbook/05_agent_os/interfaces/whatsapp/image_generation_model.py