Skip to content

radekBednarik/gpt-image-model-cli-generator

Repository files navigation

simple CLI client for generating and storing images generated by gpt-image-1 model

Pre-conditions

  • Node.js LTS
  • git
  • pnpm

Installation

  • clone repo:
git clone git@github.com:radekBednarik/gpt-image-model-cli-generator.git
  • run command in the root of the project:
pnpm install
  • create .env file in the root of the project and add your own OpenAI API key:
API_KEY=your_openai_api_key

Be aware, that for gpt-image-1 model you need to verify yourself via openai platform. You will need to provide some form of valid credentials and provide your photos.

OpenAI is using Persona for this.

And of course, you will pay for the usage of the API, so prepare your card :)

Run

pnpm go

Compilation to executable

If you have bun installed, you can easily compile the code to standalone application.

I have tested this on macOS/Linux.

bun install
pnpm build

Then just run it:

./gptcli

You can move the executable to have it wherever you want. When you run it, do not forget to prepend ENV variable with your API key, like this:

API_KEY=your_openai_api_key ./gptcli

Downloaded images

  • these are stored in ./downloaded_images/ relative to current working directory by default but you can override that.

Tested on

  • Linux Ubuntu LTS
  • MacOS Sequoia

About

CLI client for generating and storing gpt generated images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published