Working with Gemini in Pixeltable

Use Google Gemini from Pixeltable with a Google AI Studio API key or Vertex AI: generate content, images with Nano Banana and Imagen, and video with Veo.

Providers · Notebook · Updated

Colab runs it in your browser. If it calls a model provider, it asks for that provider's API key in a cell.

What it covers

  • Generate content
  • Generate images with Nano Banana
  • Generate images with Imagen
  • Generate video with Veo
  • Generate video from an existing image

What it uses

Install
terminal
pip install pixeltable google-genai
Environment variables it names
GEMINI_API_KEYGOOGLE_API_KEY
Pixeltable calls
pxt.create_table()add_computed_column()insert()

A look at the code

working-with-gemini.ipynb
from google.genai.types import GenerateContentConfigDict
# Create a table in Pixeltable and pick a model hosted on Google AI Studio with some parameters
t = pxt.create_table('gemini_demo/text', {'input': pxt.String})
config = GenerateContentConfigDict(
max_output_tokens=500, temperature=1.0, top_p=0.95, top_k=40
)
t.add_computed_column(
output=pxtf.gemini.generate_content(
t.input, model='gemini-2.5-flash', config=config
)
)

One cell of the notebook, copied as it is. Open it in Colab for the rest.

Browse all 103