Image Generation
Rayu-CLI ships a built-in GenerateImage tool that lets the agent create and
edit images from a text prompt, using either NVIDIA's free hosted image models
or Google Imagen 4 on Vertex AI. The agent uses it automatically when it
needs an image (for example, generating assets for a frontend it is building) or
when you ask for one.
Requirements
Either backend enables the tool:
- NVIDIA — reuses the
nvidiaAPI key from~/.rayu/providers.json, or theNVIDIA_API_KEYenvironment variable. Run/connectand pick NVIDIA, or setNVIDIA_API_KEY. - Google Vertex AI (Imagen 4) — uses a configured Gemini / Vertex AI
provider (OAuth / ADC). Run
/connect→ Google Gemini — Vertex AI, or have Application Default Credentials +GOOGLE_CLOUD_PROJECTset. See Providers.
The tool is hidden when neither backend is configured. When both are available,
selecting an imagen-* model routes to Vertex; otherwise NVIDIA is used (Vertex
is used automatically when it is the only configured backend).
What it does
- Calls the NVIDIA genai endpoint (
https://ai.api.nvidia.com/v1/genai/<model>). - Saves the PNG to disk (default
./generated-image-<timestamp>.png, always inside the working directory) so generated assets can be referenced from code. - Returns the image inline so the model can see the result.
- Displays it in your terminal: native inline image on iTerm2/WezTerm, or truecolor ANSI half-blocks on any 24-bit/256-color terminal (xterm-256color, Kitty, Ghostty, most Linux terminals). Falls back to printing the path.
Parameters
Models
The model list is not built into the CLI. It comes from the Rayu media-model
catalog at runtime (GET /v1/models?media=image on the gateway, backed by the
admin-managed media_models table), so a model added in the dashboard shows up in
/model_image_generation without a CLI update. Run
/model_image_generation to see exactly what your account can use.
When you are signed out (or USE_RAYU_OAUTH=false), the CLI falls back to a
built-in list so BYOK image generation keeps working offline with your own key.
The shipped catalog defaults are:
Vertex AI (Imagen)
Available when a Gemini / Vertex AI provider is configured.
Video generation (GenerateVideo)
The companion GenerateVideo tool generates short videos from a text prompt. It
is enabled by NVIDIA/fal.ai keys or by a Gemini / Vertex AI provider. On Vertex
it uses Veo 3.1 (veo-3.1-generate-001, veo-3.1-fast-generate-001)
via the long-running prediction API (Rayu polls until the video is ready, then
saves the MP4 inside the working directory).
