imgenv0.3.1

Overview

What imgen does, what it needs, and how this documentation is organised.

imgen is a command-line tool that generates images through the Replicate API. You pass a prompt, it creates a prediction, waits for the result and saves the image to disk. A JSON prompt file runs many jobs in one go.

What it does

  • Works with any Replicate model that takes a prompt and returns an image URL. The default is black-forest-labs/flux-1.1-pro.
  • Reads each model’s input schema from the API and decides how to send the requested size: exact pixels, the closest allowed aspect ratio, or plain width and height.
  • Saves PNG or WebP. Models with server-side format selection deliver WebP directly; for all others imgen converts locally.
  • Retries rate-limited requests and gives up on a single image after 120 seconds.

What it needs

A Replicate account and an API token in REPLICATE_API_TOKEN. Replicate bills each prediction to that account. imgen talks only to the Replicate API and downloads the image from the URL the API returns.

How the docs are organised

Edit this page on GitHub · Docs for v0.3.1