imgen

Generate AI images up to 4K from text or other images directly in the command line.

Generate AI images up to 4K from text or other images directly in the command line.

The gist

imgen is a command-line interface (CLI) by developer lawrencewzen for AI image generation. It solves the problem of needing to create or modify images without leaving the terminal by leveraging an existing paid ChatGPT account. The tool requires zero extra configuration beyond a local Codex CLI login, providing a direct way to generate visual assets from text or existing images.

What it does

  • Generates images from text prompts.
  • Modifies existing images using text-based instructions.
  • Produces images with transparent backgrounds, suitable for stickers or icons.
  • Supports high resolutions up to 4K (3840x2160).
  • Saves generated images directly to local files.
  • Integrates as a native AI skill in tools like Claude Code, Codex, and Gemini CLI.

How it works

imgen is installed via a script for macOS, Linux, or Windows. Users interact with it through the terminal, providing a prompt and optional flags for input images, output path, size, and quality. It authenticates by reusing the local login state from the Codex CLI, eliminating the need for a separate API key. The tool outputs a PNG image file directly to the user's disk. It is open-source under the MIT license.

Best for

This tool is ideal for developers and command-line power users who want to generate or edit images quickly without switching to a web or GUI application.

Watch out for

The tool requires a paid ChatGPT subscription and an existing installation of the Codex CLI to function. Windows support is currently limited to 64-bit systems.