Skip to content

Images and Speech

AIA can turn a prompt into an image instead of text, and it can read chat replies out loud.

Generating images with --paint

Add --paint and AIA sends each prompt to an image model instead of a chat model:

aia --paint logo_idea
echo "A lighthouse on a rocky coast at dusk, oil painting" > ~/.prompts/lighthouse.md
aia --paint lighthouse

By default the image is saved next to your output file with a .png extension. The default output file is temp.md, so the image lands in temp.png:

Image saved to: temp.png

Choose the file with -o:

aia --paint -o images/lighthouse.md lighthouse    # writes images/lighthouse.png

With --no-output nothing is saved. AIA prints the image URL the provider returned instead, or (image returned no URL) if the provider sent the image data directly. Keep an output file when you use a model that returns image data rather than a URL.

Everything you know about prompts still applies: parameters, directives, ERB and shell, and pipelines (each prompt in a pipeline makes its own image). --paint applies to prompts you run from the command line, not to chat sessions.

Image options

Option Config key Default Meaning
--im, --image-model MODEL image.model gpt-image-1 The image model
--is, --image-size SIZE image.size 1024x1024 Image dimensions
--iq, --image-quality QUALITY image.quality standard Quality setting
--style, --image-style STYLE image.style vivid Style setting
aia --paint --im gpt-image-1 --is 1536x1024 --iq hd --style natural lighthouse

Which sizes, qualities and styles are accepted depends on the model and provider. Check the provider's documentation. To find image-capable models:

aia --available-models text_to_image
Available LLMs for text_to_image:

- gpt-image-1 (azure) text,image to image
...

text_to_image matches models that take text and return an image. Add a provider name to narrow it: --available-models text_to_image,openai.

Hearing replies with --speak

--speak reads replies aloud: every reply in a chat, including replies from crewmates you address with @name, the reply to a one-shot prompt, and each step of a pipeline:

aia --chat --speak
aia --chat --speak --voice Samantha
aia --speak daily_briefing

Images from --paint aren't spoken.

The default: macOS say

By default AIA speaks with the macOS say command. --voice picks one of its voices; run say -v '?' to list them. Config keys: flags.speak, audio.voice.

Using your own text-to-speech command

To use a cloud voice or another text-to-speech engine, point --speak-command at your own script:

aia --chat --speak --speak-command ~/bin/tts.sh

AIA runs the command with two arguments: the text to speak, and the path of an .mp3 file to write. When the command has written that file, AIA plays it with audio.player. If you haven't set one, AIA uses the first of afplay (built into macOS), mpv, ffplay and mpg123 that it finds on your PATH, and warns if it finds none. For example:

#!/usr/bin/env bash
# ~/bin/tts.sh TEXT OUTPUT_FILE
text="$1"; out="$2"
curl -s https://api.openai.com/v1/audio/speech \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d "$(jq -n --arg t "$text" --arg m "${SPEECH_MODEL:-tts-1}" \
        '{model:$m, voice:"alloy", input:$t}')" \
  -o "$out"

--speech-model (--sm) is handed to your command as the SPEECH_MODEL environment variable. AIA doesn't use it any other way. The config key for the command is audio.speak_command (default say).

To choose the player yourself, set audio.player in your config file or AIA_AUDIO__PLAYER in the environment. The value is a command line; AIA adds the file path at the end:

audio:
  speak_command: ~/bin/tts.sh
  player: mpv --no-video --really-quiet

Speaking a single line: /say

In a chat, /say speaks the text you give it using the macOS say command and your --voice. Nothing is sent to the model:

> /say The build is finished.

Transcription model

--transcription-model (--tm, config audio.transcription_model) sets the default model RubyLLM uses for speech-to-text. AIA itself doesn't take voice input. The setting is there for tools that transcribe audio.

See also