https://github.com/spyna/aimage
a node cli to generate images using open ai
https://github.com/spyna/aimage
ai cli dall-e image-generation nodejs openai openai-api
Last synced: about 2 months ago
JSON representation
a node cli to generate images using open ai
- Host: GitHub
- URL: https://github.com/spyna/aimage
- Owner: Spyna
- License: mit
- Created: 2024-06-17T15:41:42.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-23T09:27:59.000Z (almost 2 years ago)
- Last Synced: 2025-04-03T21:06:32.619Z (about 1 year ago)
- Topics: ai, cli, dall-e, image-generation, nodejs, openai, openai-api
- Language: TypeScript
- Homepage:
- Size: 55.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Node CLI for Creating Images Using OpenAI API DALL-E
Welcome to the Node CLI project for creating images using the OpenAI API DALL-E. This project allows users to generate images via a command-line interface by leveraging OpenAI's DALL-E model.
## Table of Contents
- [Usage](#usage)
- [Configuration](#configuration)
- [Contributing](#contributing)
- [Development](#development)
- [License](#license)
## Usage
### Linux/macOS
To create an image, use the following command:
```bash
export OPENAI_API_KEY=your-openai-api-key
npx aimage --prompt "A description of the image you want to generate"
```
### Windows
For Windows, use the set command to set the environment variable:
```bash
set OPENAI_API_KEY=your-openai-api-key
npx aimage --prompt "A description of the image you want to generate"
```
## Configuration
Ensure you set the environment variable `OPENAI_API_KEY` with your OpenAI API key.
### Parameters
```shell
Usage: aimage [options]
Options:
-V, --version output the version number
-s, --size Size of the image to generate: 256x256 | 512x512 | 1024x1024 | 1792x1024 | 1024x1792 (default: "1024x1024")
-m, --model The model to use: dall-e-3 / dall-e-2 (default: "dall-e-3")
--f, --folder Saves the generated image in the specified folder (default: "./images")
-h, --help output usage information
```
## Contributing
We welcome contributions! Please follow these steps to contribute:
* Fork the repository.
* Create a new branch (`git checkout -b feature/your-feature-name`).
* Commit your changes (`git commit -m 'Add some feature'`).
* Push to the branch (`git push origin feature/your-feature-name`).
* Open a pull request.
Please ensure your code adheres to our coding standards and passes all tests.
## Development
```
yarn dev
```
```
node dist/index.js
```