Skip to main content
The source-fidelity code uses gpt-image-1. Replace it with gpt-image-2 before running the example.
selector_media_pipeline.py

Run the Example

1

Set up your virtual environment

2

Install dependencies

3

Export environment variables

4

Authenticate with Google Cloud

Sign in with Application Default Credentials:
5

Update the image model

When saving the code, replace gpt-image-1 with gpt-image-2.
6

Run the example

Save the code above as selector_media_pipeline.py, then run:
Full source: cookbook/04_workflows/05_conditional_branching/selector_media_pipeline.py