The example in public/scripts.js is used to run https://endless-zoom.vercel.app/, a small web toy that allows you to keep zooming in to a generated image and get more and more detail.
This repo is an example of:
This allows p5.js to interact with a Latent Consistency Model, and to easily swap between the backend being a local copy as described in https://replicate.com/blog/run-latent-consistency-model-on-mac, or a model hosted on replicate
edit public/script.js with your p5.js code and point it to the endpoint of your choice
For local run, install the prototype branch of https://github.com/replicate/latent-consistency-model/tree/prototype
git clone https://github.com/replicate/latent-consistency-model.git
cd latent-consistency-model
git checkout prototype
Make a python environment using e.g. venv, edm or conda and activate it
Install dependencies
pip install -r requirements.txt
Run serve.py
python serve.py
Add your Replicate API token to .env.local
:
REPLICATE_API_TOKEN=<your-token-here>
Install dependencies:
npm install
Run the development server:
npm run dev
Open https://localhost:3000 with your browser.