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 🙏

© 2024 – Pkg Stats / Ryan Hefner

imagegen-cli

v1.0.0

Published

The Image Generator CLI is a command-line tool that allows users to generate AI-powered images by providing prompts. This tool supports saving API keys, generating images, and storing them locally. This project makes use of together ai API. it uses free f

Downloads

14

Readme

Image Generator CLI Documentation

The Image Generator CLI is a command-line tool that allows users to generate AI-powered images by providing prompts. This tool supports saving API keys, generating images, and storing them locally. This project makes use of together ai API. it uses free flux model from together ai to generate free images.


Installation

Prerequisites

  1. If you already have Node.js installed:

    • Ensure npm is available by running:
      node -v
      npm -v
    • Then follow the Installation with Node.js section below.
  2. If Node.js is not installed:

    • You can download a node js and run it.

Installation with Node.js

  1. Clone or Download the Repository:

    git clone https://github.com/your-username/image-generator-cli.git
    cd image-generator-cli
  2. Install the CLI Globally:

    npm install -g .
  3. Verify Installation:

    imagegen --help

Usage

1. Set Your API Key

Before generating images, save your API key. This is a one-time setup.

imagegen set-api-key YOUR_API_KEY
  • Replace YOUR_API_KEY with your actual API key, that you got from together.ai.
  • The key is stored securely in your home directory in a configuration file.

2. Generate an Image

Basic Usage

Provide a prompt for image generation:

imagegen generate -p "A futuristic cityscape at sunset"

Save Images to a Custom Directory

Specify a custom directory to save the image:

imagegen generate -p "A vibrant rainforest" -d ./my-images
  • Default directory: ./PIctures.

Commands

1. set-api-key

Stores your API key locally.

Syntax:

imagegen set-api-key <apiKey>

Example:

imagegen set-api-key sk-123abc456def

2. generate

Generates an image based on the provided prompt.

Syntax:

imagegen generate [options]

Options:

| Option | Description | Default | |--------------------|-----------------------------------------------------|----------------------| | -p, --prompt | The text prompt for image generation | None (required) | | -d, --directory | Directory to save the generated image | ./generated-images |

Examples:

  • Generate an image with a specific prompt:
    imagegen generate -p "A scenic mountain view"
  • Generate an image and save it to a custom directory:
    imagegen generate -p "A bustling futuristic city" -d ./my-outputs

Features

  1. API Key Management:

    • Stores API keys securely in a configuration file.
  2. Image Generation:

    • Supports customizable prompts to generate AI-powered images.
  3. Customizable Output:

    • Save images to any directory or use the default directory.

FAQ

Q1: Where is my API key stored?

Your API key is stored in a configuration file located at:

  • Windows: C:\Users\<username>\.image-generator-config.json
  • macOS/Linux: ~/.image-generator-config.json


Q2: What happens if I don't specify a prompt?

The generate command will fail because a prompt is required. Always include a prompt using -p or --prompt.


Contributing

Contributions are welcome! Feel free to fork the repository, make changes, and submit a pull request.


License

This project is licensed under the MIT License. See the LICENSE file for details.