---
title: "Creative Image Generation with Pixeltable's Reve Integration"
date: "2025-12-09"
author: "Pixeltable Team"
tags:
  - Reve
  - Image Generation
  - Image Editing
  - Pixeltable
  - Generative AI
  - Visual AI
  - AI Integration
  - Computed Columns
description: "Learn how to use Pixeltable's Reve integration for AI image creation, editing, and remixing. Build complete visual pipelines that automatically generate and combine images from text prompts."
url: "https://pixeltable.com/blog/reve-image-generation-pixeltable"
---

# Creative Image Generation with Pixeltable's Reve Integration

## Declarative Image Generation with Reve

 
Reve is a powerful image generation API that lets you create images from text, edit existing images, and remix multiple images together. With Pixeltable's Reve integration, you can build complete visual pipelines where computed columns automatically handle image generation as data flows through your tables.

 
This guide walks through the three core Reve functions:

 

 - **reve.create()** - Generate images from text prompts

 - **reve.edit()** - Modify existing images with instructions

 - **reve.remix()** - Combine multiple images into new compositions

 

 
## Getting Started

 
 
First, set up your Reve API key and create a Pixeltable directory:

 
```python

import os
import pixeltable as pxt
from pixeltable.functions import reve

# Set your Reve API key
os.environ['REVE_API_KEY'] = 'your-api-key-here'

# Create a directory for our project
pxt.drop_dir('reve_demo', force=True)
pxt.create_dir('reve_demo')
 
```

 
## Creating Images with reve.create()

 
 
The `reve.create()` function generates images from text prompts. Let's build a table that automatically generates scene images:

 
```python

import pixeltable as pxt
from pixeltable.functions import reve

# Create a table with prompt and source image columns
scenes = pxt.create_table('reve_demo.solarpunk_scenes', {
 'prompt': pxt.String,
 'source_image': pxt.Image
})

# Add a computed column that generates images from prompts
scenes.add_computed_column(
 new_image=reve.create(
 scenes.prompt,
 aspect_ratio='16:9'
 )
)

# You can also generate square images
scenes.add_computed_column(
 new_image_sq=reve.create(
 scenes.prompt,
 aspect_ratio='1:1'
 )
)

# Insert a prompt - image generation happens automatically!
scenes.insert([{
 'prompt': 'Create a scene of lush solarpunk metropolis in the desert with urban agriculture and an oasis theme.',
 'source_image': 'https://example.com/person.jpg'
}])

# View the generated images
scenes.select(scenes.prompt, scenes.new_image, scenes.new_image_sq).collect()
 
```

 
When you insert a row with a prompt, Pixeltable automatically calls the Reve API and stores the generated image in the computed column.

 
## Editing Images with reve.edit()

 
 
The `reve.edit()` function modifies existing images based on instructions. This is perfect for removing backgrounds, changing styles, or transforming subjects:

 
```python

# Add a computed column that edits the source image
scenes.add_computed_column(
 edited_subject=reve.edit(
 scenes.source_image,
 'Isolate the subject (person) of this image from the background. '
 'Center the person and remove any objects in the foreground. '
 'Give this image a warm "golden hour" treatment.',
 aspect_ratio='1:1',
 )
)

# The edit happens automatically when you have a source_image
scenes.select(scenes.source_image, scenes.edited_subject).collect()
 
```

 
Notice how the edit instructions are passed directly to `reve.edit()`. Pixeltable handles the API calls and caching automatically.

 
## Remixing Images with reve.remix()

 
 
The most powerful feature is `reve.remix()`, which combines multiple images into new compositions. You reference images in the prompt using `<img>N</img>` placeholders:

 
```python

# Remix the edited subject into the generated scene
scenes.add_computed_column(
 solarpunk_remix=reve.remix(
 'Place the person in <img>0</img> in the foreground of the scene from <img>1</img>. '
 'Make the background clear and detailed so it feels like a complete "day in the life" in solarpunk city scene.',
 images=[scenes.edited_subject, scenes.new_image],
 aspect_ratio='16:9',
 )
)

# View the final remixed composition
scenes.select(scenes.solarpunk_remix).collect()
 
```

 
The `images` parameter is a list of image columns. In the prompt:

 

 - `<img>0</img>` refers to `images[0]` (edited_subject)

 - `<img>1</img>` refers to `images[1]` (new_image)

 

 
## Complete Pipeline: Scene Generation

 
 
Here's a complete pipeline that creates a scene, edits a subject, and remixes them together:

 
```python

import pixeltable as pxt
from pixeltable.functions import reve
import os

os.environ['REVE_API_KEY'] = 'your-api-key'

# Setup
pxt.drop_dir('creative_studio', force=True)
pxt.create_dir('creative_studio')

# Create the base table
studio = pxt.create_table('creative_studio.projects', {
 'scene_prompt': pxt.String,
 'subject_image': pxt.Image
})

# Step 1: Generate the background scene
studio.add_computed_column(
 background=reve.create(
 studio.scene_prompt,
 aspect_ratio='16:9'
 )
)

# Step 2: Edit the subject (isolate and enhance)
studio.add_computed_column(
 prepared_subject=reve.edit(
 studio.subject_image,
 'Isolate the main subject from the background. '
 'Center them and apply professional lighting.',
 aspect_ratio='1:1'
 )
)

# Step 3: Remix subject into scene
studio.add_computed_column(
 final_composition=reve.remix(
 'Place the subject from <img>0</img> naturally into the scene from <img>1</img>. '
 'Make them look like they belong there with proper lighting and scale.',
 images=[studio.prepared_subject, studio.background],
 aspect_ratio='16:9'
 )
)

# Insert projects - all three stages run automatically!
studio.insert([
 {
 'scene_prompt': 'A futuristic solarpunk city with vertical gardens and clean energy',
 'subject_image': 'https://example.com/person1.jpg'
 },
 {
 'scene_prompt': 'An indoor tennis court inside a lush greenhouse with bougainvillea',
 'subject_image': 'https://example.com/person2.jpg'
 }
])

# View the complete pipeline output
studio.select(
 studio.background,
 studio.prepared_subject,
 studio.final_composition
).collect()
 
```

 
## Incremental Updates

 
 
One of Pixeltable's key advantages is incremental computation. When you insert a new row, only that row's images are generated, while existing rows are untouched:

 
```python

# Insert a new project
studio.insert([{
 'scene_prompt': 'A cozy cafe with warm lighting and plants',
 'subject_image': 'https://example.com/person3.jpg'
}])

# Pixeltable automatically:
# 1. Generates the new background
# 2. Edits the new subject
# 3. Creates the new remix
# 4. Leaves existing rows unchanged (no redundant API calls!)
 
```

 
## Aspect Ratio Options

 
 
Reve supports various aspect ratios for different use cases:

 
```python

# Landscape (16:9) - great for scenes and backgrounds
scenes.add_computed_column(
 landscape=reve.create(scenes.prompt, aspect_ratio='16:9')
)

# Square (1:1) - perfect for portraits and social media
scenes.add_computed_column(
 square=reve.create(scenes.prompt, aspect_ratio='1:1')
)

# Portrait (9:16) - ideal for mobile and stories
scenes.add_computed_column(
 portrait=reve.create(scenes.prompt, aspect_ratio='9:16')
)
 
```

 
## Quick Reference

 
 
| Function | Input | Purpose |
| --- | --- | --- |
| reve.create(prompt, aspect_ratio) | Text prompt | Generate new images from text |
| reve.edit(image, instructions, aspect_ratio) | Image + instructions | Modify existing images |
| reve.remix(prompt, images, aspect_ratio) | Prompt + multiple images | Combine images into new compositions |

 
## Why Use Pixeltable for Image Generation?

 
 

 - **Declarative pipelines** - Define your workflow once, insert data, images generate automatically

 - **Incremental updates** - Only new rows trigger API calls, saving costs

 - **Automatic storage** - Generated images are stored and versioned

 - **Chained operations** - Output of one column feeds into another seamlessly

 - **Built-in caching** - Identical prompts don't trigger duplicate API calls

 

 
## Conclusion

 
 
Pixeltable's Reve integration makes it easy to build sophisticated image generation pipelines. By combining `reve.create()`, `reve.edit()`, and `reve.remix()` in computed columns, you can automate complex visual workflows, from generating backgrounds to editing subjects to creating final compositions.

 
The declarative approach means you focus on *what* you want to create, not *how* to orchestrate API calls, handle storage, or manage incremental updates.

 
## Resources

 

 - [Working with Reve in Pixeltable](https://docs.pixeltable.com/howto/providers/working-with-reve)

 - [Pixeltable Reve Functions Reference](https://docs.pixeltable.com/sdk/latest/reve)

 - [Reve API Documentation](https://api.reve.com/console/docs)

 - [Working with Gemini (Image & Video Generation)](/blog/working-with-gemini)

 - [Pixeltable on GitHub](https://github.com/pixeltable/pixeltable)