---
title: "Transform images with AI-powered editing"
description: "You have a batch of images that need AI-powered transformations—like turning photos into paintings, adding stylistic effects, or modifying content based on text prompts."
url: "https://www.pixeltable.com/notebooks/img-image-to-image"
updated: "2026-04-10"
---

# Transform images with AI-powered editing

You have a batch of images that need AI-powered transformations—like turning photos into paintings, adding stylistic effects, or modifying content based on text prompts.

- **Type:** Notebook
- **Group:** Images

## How it works

You can iterate on transformations before adding them to your table. Use .select() with .collect() to preview results on sample images—nothing is stored in your table. If you want to collect only the first few rows, use .head(n) instead of .collect(). Once you're satisfied, use .add_computed_column() to apply the transformation to all images in your table.

For more on this workflow, see Get fast feedback on transformations.

## What it covers

- Transform images using text prompts with Hugging Face Stable Diffusion models
- Control transformation strength and quality settings
- Process batches of images automatically

## What it uses

- **Install:** `pip install pixeltable torch transformers diffusers accelerate`
- **Pixeltable calls:** `huggingface.image_to_image()`, `pxt.create_table()`, `insert()`, `add_computed_column()`

## A look at the code

```python
# Save as computed column
t.add_computed_column(
    transformed=image_to_image(
        t.image,
        t.prompt,
        model_id='stable-diffusion-v1-5/stable-diffusion-v1-5',
        model_kwargs={
            'strength': 0.5,
            'num_inference_steps': 25,
            'negative_prompt': t.negative_prompt,
        },
    )
)
```

## Open it

- **Open in Colab:** https://colab.research.google.com/github/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/images/img-image-to-image.ipynb
- **Docs page:** https://docs.pixeltable.com/howto/cookbooks/images/img-image-to-image
- **Source on GitHub:** https://github.com/pixeltable/pixeltable/blob/release/docs/release/howto/cookbooks/images/img-image-to-image.ipynb
