carllapierre/diffusion-canvas

A simple react app with a canvas to draw an image. Real time image-to-image inference using Stable Diffusion XL Turbo and Modal

26

stars

10

commits

JavaScript

primary language

Mar 8, 2024

updated

canvas
modal
react
sdxl
sdxl-turbo

README

Demo

Diffusion Canvas

SDXL Turbo, and TripoSR, Modal powered realtime image to 3d generation via canvas drawings.

Local Developement

File structure

  • frontend - React frontend
  • turbo.py - Serverless FastAPI endpoint for served by Modal for SDXL Turbo
  • tripo.py - Serverless FastAPI endpoint for served by Modal for TripoSR

Requirements

  1. Install modal and set up locally
pip install modal
modal setup
  1. Have npm installed

Launch

Serve modal endpoints and save endpoints outputs for frontend .env

modal serve turbo.py
modal serve tripo.py

Copy the endpoints from the serve output. cd into the frontend directory and make a copy of .env example:

cp example.env .env

Setup endpoints from serve output in .env file and run the app.

npm install
npm run start

Note: The first request will always take a few seconds due to cold starts.

Contributors

carllapierre

10 commits

carllapierre/diffusion-canvas

A simple react app with a canvas to draw an image. Real time image-to-image inference using Stable Diffusion XL Turbo and Modal

26

stars

10

commits

JavaScript

primary language

Mar 8, 2024

updated

canvas
modal
react
sdxl
sdxl-turbo

README

Demo

Diffusion Canvas

SDXL Turbo, and TripoSR, Modal powered realtime image to 3d generation via canvas drawings.

Local Developement

File structure

  • frontend - React frontend
  • turbo.py - Serverless FastAPI endpoint for served by Modal for SDXL Turbo
  • tripo.py - Serverless FastAPI endpoint for served by Modal for TripoSR

Requirements

  1. Install modal and set up locally
pip install modal
modal setup
  1. Have npm installed

Launch

Serve modal endpoints and save endpoints outputs for frontend .env

modal serve turbo.py
modal serve tripo.py

Copy the endpoints from the serve output. cd into the frontend directory and make a copy of .env example:

cp example.env .env

Setup endpoints from serve output in .env file and run the app.

npm install
npm run start

Note: The first request will always take a few seconds due to cold starts.

Contributors

carllapierre

10 commits

Languages

JavaScript

56.9%

Python

31.5%

HTML

9.6%

CSS

2.0%