npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

imagen-generator-ai-flux

v1.0.0

Published

Interactive CLI to generate AI images using Replicate API and FLUX models

Readme

AI Image Generator (Replicate + FLUX)

Interactive terminal app to generate photorealistic images using the Replicate API and FLUX models.

Developed by Omar Fuentes — website: omarfuentes.com

Features

  • Interactive CLI
  • FLUX models
  • Persistent session (keeps selected model, output folder and format during the session)
  • Custom output folder
  • PNG/JPG output
  • Automatic filename normalization

Requirements

  • Node.js 16+
  • A Replicate account
  • A Replicate API token

Installation

npm install

Install from npm

Global install:

npm install -g imagen-generator-ai-flux

Run:

ai-image-gen

Configuration (Replicate token)

This project reads the token from REPLICATE_API_TOKEN.

Option A: Use a .env / .ENV file (recommended)

Create a file called .env (or .ENV) in the project root:

REPLICATE_API_TOKEN=r8_your_replicate_token_here

Option B: Set the environment variable

PowerShell (Windows):

$env:REPLICATE_API_TOKEN="r8_your_replicate_token_here"

CMD (Windows):

set REPLICATE_API_TOKEN=r8_your_replicate_token_here

macOS / Linux (bash/zsh):

export REPLICATE_API_TOKEN="r8_your_replicate_token_here"

Usage

Run the generator:

node image-generator.js

Or:

npm start

Workflow

  1. Choose a FLUX model.
  2. Enter a descriptive prompt.
  3. Choose an output folder (it will be created if it doesn’t exist).
  4. Choose the image format (PNG/JPG).
  5. Name your image (it will be normalized automatically).

Prompt tips

Good prompts are visual and specific. Examples:

"A sunset at the beach, orange and purple sky, waves breaking on the shore, professional photography, ultra-detailed"

"Portrait of a woman with long red hair and green eyes, natural lighting, shallow depth of field, cinematic look"

"Futuristic city street with tall buildings, blue and pink neon lights, wet ground reflecting the lights, cyberpunk style"

Avoid vague prompts like:

"a plane"
"person"
"city"

Project structure

.
├── image-generator.js
├── package.json
└── README.md

Customization

Change available models

Edit FLUX_MODELS inside image-generator.js.

Adjust generation parameters

Edit the input object passed to replicate.run() inside generateImage().

Troubleshooting

REPLICATE_API_TOKEN is not configured

  • Ensure REPLICATE_API_TOKEN is set in the same terminal where you run the script, or create a .env/.ENV file.
  • Verify the token is correct and active in your Replicate account.

Download errors

  • Check your internet connection.
  • Ensure you have write permissions to the selected output folder.

Replicate API errors

  • Confirm you have available credits / billing set up.
  • Make sure the selected model exists and is available.

Security

Do not commit your token to GitHub.

License

MIT