CH·02CLI reference

gpu image

Generate image(s) from a text prompt

Generate image(s) from a text prompt

Synopsis

Generate one or more images from a text prompt using a serverless image model. The request is synchronous: the image bytes come back base64-encoded and are written to disk. With --n>1 the CLI writes out.png, out-2.png, … alongside the base path. Requires a key with the serverless:write scope.

Only file output is produced — --output json emits the raw result object (base64 included) for scripting; --output table prints the image count and the saved file paths.

gpu image <prompt> [flags]

Examples

# Generate a single image to out.png
gpu image "a watercolor fox in a misty forest" --model gpuai/flux.1-schnell

# Custom output path and size
gpu image "neon city skyline at night" --model gpuai/flux.1-schnell \
  --size 1024x1024 --out skyline.png

# Generate 3 images (skyline.png, skyline-2.png, skyline-3.png)
gpu image "abstract gradient wallpaper" --model gpuai/flux.1-schnell --n 3 --out skyline.png

Options

  -h, --help           help for image
      --model string   Image model id (e.g., gpuai/flux.1-schnell) — required
      --n int          Number of images to generate (default 1)
      --out string     Output file path (base path when --n>1) (default "out.png")
      --size string    Image size as WxH (e.g., 1024x1024)

Options inherited from parent commands

      --api-base string   API base URL (override with GPUAI_API_BASE env) (default "https://api.gpu.ai/v1")
      --debug             Enable debug logging to stderr
  -o, --output string     Output format: table|json (default table on TTY, json otherwise)

SEE ALSO

  • gpu - GPU.ai command-line interface

← The gpu CLI