Package Exports
- @themaximalist/imagine.js
- @themaximalist/imagine.js/src/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@themaximalist/imagine.js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Imagine.js

Imagine.js
is an AI image generator library. It works with local models like Automatic1111 and remote models like Replicate and Stability.
await Imagine("a red rose"); // Buffer(...)
Features
- Easy to use
- Works with local Stable Diffusion models
- Works with any remote models on Replicate or Stability AI
- Same interface for all services (
a1111
,replicate
,stability
) - MIT license
Install
For local models, ensure a Automatic1111 instance is running.
For remote models, make sure you have REPLICATE_API_KEY
or STABILITY_API_KEY
set in your environment variables.
npm install @themaximalist/llm.js
export STABILITY_API_KEY=...
export REPLICATE_API_KEY=...
Prompt
Call Imagine.js
to generate an image with your prompt.
const Imagine = require("@themaximalist/imagine.js");
const buffer = await Imagine("a red rose"); // Buffer(...)
fs.writeFileSync("rose.png", buffer);
Services
Specify a different service, a1111
, replicate
or stability
.
await Imagine("a red rose"); // defaults to a1111
await Imagine("a red rose", { service: "replicate"} );
await Imagine("a red rose", { service: "stability"} );
Projects
Imagine.js
is currently used in the following projects:
Author
License
MIT