---
title: "imagine.js — Brad Jasper"
description: "AI image generation behind one function, with local Stable Diffusion or hosted models."
url: https://bradjasper.com/projects/imagine-js/
---

[← Code](https://bradjasper.com/code/)

# imagine.js

Archived · 2024 · JavaScript · AI

Not maintained since 2024.

AI image generation behind one function, with local Stable Diffusion or hosted models.

- [imaginejs.themaximalist.com](https://imaginejs.themaximalist.com/)
- [Source on GitHub](https://github.com/themaximalist/imagine.js)

![imagine.js logo](https://bradjasper.com/_astro/imaginejs.DS6UoFwJ_18W9r5.webp)

`await Imagine("a red rose")` returns an image. The same call worked with a local Stable Diffusion server or with hosted models on Replicate and Stability AI, and it could use a language model to write a better image prompt first.

Part of [ai.js](https://bradjasper.com/projects/ai-js/), which put my AI libraries behind one toolkit.
