---
title: "Scribble Diffusion"
description: "Turn your rough sketch into a refined image using AI. Powered by Replicate and ControlNet."
url: "https://vercel.com/templates/next.js/scribble-diffusion"
links:
  repository: "https://github.com/replicate/scribble-diffusion"
  demo: "https://scribblediffusion.com/"
  deploy: "https://vercel.com/new/clone?demo-title=Scribble+Diffusion&demo-description=Turn+your+rough+sketch+into+a+refined+image+using+AI.+Powered+by+Replicate+and+ControlNet.&demo-url=https%3A%2F%2Fscribblediffusion.com%2F&demo-image=%2F%2Fimages.ctfassets.net%2Fe5382hct74si%2F21QBhvRvCXdu6KZQGQ7MMQ%2F11fb6b76593cf66aea0f8a0f9a5c38b6%2FCleanShot_2023-02-16_at_22.53.58.png&project-name=Scribble+Diffusion&repository-name=scribble-diffusion&repository-url=https%3A%2F%2Fgithub.com%2Freplicate%2Fscribble-diffusion&from=templates&skippable-integrations=1&env=REPLICATE_API_TOKEN&envDescription=Find+your+Replicate+API+token+here%3A&envLink=https%3A%2F%2Fwww.replicate.com%2Faccount"
---

# Scribble Diffusion

Turn your rough sketch into a refined image using AI. Powered by Replicate and ControlNet.

# 🖍️ Scribble Diffusion

Try it out at [scribblediffusion.com](https://scribblediffusion.com)

## How it works

This app is powered by:

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

🖍️ [ControlNet](https://replicate.com/jagilley/controlnet-scribble?utm_source=project&utm_campaign=scribblediffusion), an open-source machine learning model that generates images from text and scribbles.

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

⚡️ Next.js [server-side API routes](https://github.com/replicate/scribble-diffusion/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.

## Development

1. Install a recent version of [Node.js](https://nodejs.org/)
1. Copy your [Replicate API token](https://replicate.com/account?utm_source=project&utm_campaign=scribblediffusion) and set it in your environment:
   ```
   echo "REPLICATE_API_TOKEN=<your-token-here>" > .env.local
   ```
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

### [Paint by Text](https://vercel.com/templates/next.js/paint-by-text)

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

### [Inpainter with Stable Diffusion](https://vercel.com/templates/next.js/inpainter-stable-diffusion)

Next.js application for inpainting with Stable Diffusion using the Replicate API.

### [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.
