> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zocomputer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Generate image

> Generate an image following the provided prompt using an AI image generation model.

{/* Tool: generate_image */}

AI image generation on Zo Computer is powered by Google [Nano Banana](https://deepmind.google/models/gemini-image/flash/) or OpenAI [GPT Image 2](https://openai.com/index/introducing-chatgpt-images-2-0/). The default is set per-user in AI settings.

## Parameters

<ParamField path="prompt" type="string" required={true}>
  A description of the desired image. Be specific, precise, and detailed. Use advanced AI image generation prompting techniques to produce visually compelling results.
</ParamField>

<ParamField path="file_stem" type="string" required={true}>
  The base name for the output files (e.g., "myimg" will create "myimg\_1.png", "myimg\_2.png", etc.).
</ParamField>

<ParamField path="n" type="number" default={1}>
  The number of images to generate (between 1 and 10). Defaults to 1.
</ParamField>

<ParamField path="output_dir" type="string" default={""}>
  The directory where the generated images will be saved. Defaults to /home/workspace/Images.
</ParamField>

<ParamField path="aspect_ratio" type="string" default={"1:1"}>
  The desired image aspect ratio, e.g. "16:9", "1:1", "3:4".
</ParamField>

<ParamField path="provider" type="string" default={""}>
  Which model to use. Defaults to "" (empty), which routes through the user's configured default image provider in AI settings. Pass "google" (Nano Banana — fast and cheap) or "openai" (GPT Image 2 — \~3× more expensive but better prompt adherence and legible rendered text) to override on this call only; use the override when the user explicitly asks for a specific provider or a level of quality only one of them satisfies.
</ParamField>
