A cat image generated with Stable Diffusion
Download

Payments are handled by the Lemonsqueezy platform. Please refer to the terms and privacy policy.

From p5js to StableDiffusion with Replicate API

Updated on Jun 15, 2024

Download the source code example of using p5js and Replicate API to generate images with StableDiffusion models. The last product was about running LCM models locally on Mac but this time, we use Replicate API which opens up a lot more models to choose from and much faster inference speed. The downside is that you will need to pay for the usage. But, Replicate has pretty good introductory free credits so why don’t you give it a try?

The source code included handles API requests so you don’t need to know anything about server-side code, and only need to write p5js code as usual.

Check out the video tutorial first: https://youtu.be/jP9U_Hvcv2w