This simple demo shows you how to use the Ideogram V2 inpainting model on Replicate using Node.js.
Inpainting is like an AI-powered erasing and painting tool. You can use it to remove unwanted objects from an image, or change parts of an image to create something new.
To inpaint an image, you need:
- A starting image that you want to change. (See duck.jpg)
- A mask image that describes which parts of the image you want to inpaint. Black areas are inpainted and white areas are left unchanged. (See mask.png)
- A text prompt that describes the changes you want to see.
To run this demo, you'll need to have Node.js installed.
Create a Replicate API token and add it to your environment variables:
export REPLICATE_API_TOKEN=r8_...
Then, install the dependencies and run the script:
npm install
node index.js
This will:
- Run the model with Replicate's cloud API
- Save the output image to
output.png
- Open the output image in your default image viewer
- replicate.com/ideogram-ai/ideogram-v2-turbo - Turbo version of the model
- replicate.com/ideogram-ai/ideogram-v2 - Full version of the model
- Ideogram v2 inpainting on Replicate - blog post announcing Ideogram v2 inpainting on Replicate
- Replicate Playground - Web-based tool for inpainting images right on replicate.com
- Inpainter.app - Open-source Next.js app for inpainting images
- Outpainter.app - Open-source Nuxt.js app for extending images beyond their original canvas
- Inpainting with Stable Diffusion - an older guide, but still useful.