---
title: "Paint by Text"
description: "Edit your photos by chatting with a generative AI model (InstructPix2Pix), powered by Replicate."
url: "https://vercel.com/templates/next.js/paint-by-text"
links:
  repository: "https://github.com/replicate/paint-by-text"
  demo: "https://paintbytext.chat/"
  deploy: "https://vercel.com/new/clone?demo-title=Paint+by+Text&demo-description=Edit+your+photos+by+chatting+with+a+generative+AI+model+%28InstructPix2Pix%29%2C+powered+by+Replicate.&demo-url=https%3A%2F%2Fpaintbytext.chat%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F4MJWAAgQaFRRb0vVgTg4XL%2F4ef163972253a781ebf9596e60837885%2Fpaintbytext.png&project-name=Paint+by+Text&repository-name=paint-by-text&repository-url=https%3A%2F%2Fgithub.com%2Freplicate%2Fpaint-by-text&from=templates&skippable-integrations=1&env=REPLICATE_API_TOKEN&envDescription=Get+your+Replicate+API+token%3A&envLink=https%3A%2F%2Freplicate.com%2Faccount"
---

# Paint by Text

Edit your photos by chatting with a generative AI model (InstructPix2Pix), powered by Replicate.

# 👩‍🎨 Paint by Text

Modify images by chatting with a generative AI model.

Try it out at [paintbytext.chat](http://paintbytext.chat)

## How it works

This app is powered by:

🚀 [Replicate](https://replicate.com/?utm_source=project&utm_campaign=paintbytext), a platform for running machine learning models in the cloud.

🎨 [Kontext](https://replicate.com/black-forest-labs/flux-kontext-pro?utm_source=project&utm_campaign=paintbytext), an open-source machine learning model that edits images using text.

▲ [Vercel](https://vercel.com/), a platform for running web apps.

⚡️ Next.js [server-side API routes](https://github.com/replicate/paint-by-text/tree/main/pages/api), for talking to the Replicate API.

👀 Next.js React components, for the browser UI.

🍃 [Tailwind CSS](https://tailwindcss.com/), for styles.


## Usage

1. Open the app in your browser.
1. When prompted, enter your [Replicate API token](https://replicate.com/account/api-tokens?new-token-name=paint-by-text-kontext).
1. You can generate a free token at the link above (requires a Replicate account).
1. Your token is stored securely in your browser and used only for your requests.

## Development

1. Install a recent version of [Node.js](https://nodejs.org/)
1. Install dependencies and run the server:
    ```
    npm install
    npm run dev
    ```
1. Open [localhost:3000](http://localhost:3000) in your browser. That's it!

## Related Templates

### [AI Twitter Bio Generator](https://vercel.com/templates/next.js/twitter-bio)

Generate your Twitter bio with OpenAI GPT-3 API (text-davinci-003) and Vercel Edge Functions with streaming.

### [AI Photo Restorer](https://vercel.com/templates/next.js/ai-photo-restorer)

An AI Face Photo Restorer built on Next.js and Replicate.

### [Extrapolate – AI Aging App](https://vercel.com/templates/next.js/extrapolate)

Age transformation AI app powered by Next.js, Replicate, Upstash, and Cloudflare R2 + Workers.

---

## Additional documentation

The [Vercel Knowledge Base](https://vercel.com/kb) contains guides and answers to common questions about Vercel, including deployment, framework configuration, domains, caching, and troubleshooting.
