Skip to main content
Trinity
Guides/Agent Avatars

Agent Avatars

AI-generated avatars for agents using reference images, emotion variants, and default generation.

Trinity Platform Demo — avatar generation

May 2026

Features

•Reference Image — Upload a reference image and the avatar is generated in that style.
•Variation Regeneration — Generate new variations from an existing avatar.
•Emotion Variants — The Agent Detail page cycles through emotion-based avatar variants every 30 seconds.
•Default Avatar Generation — The Generate Default Avatars button in Settings (admin) generates robot/android-style avatars for all agents without a custom avatar.
•Bundled Default Avatars — The first-run templates (scout, sage, scribe) ship an avatar.webp beside their template.yaml, installed at creation as the agent's default avatar — so a fresh install shows faces rather than initials before any image-generation key exists. Any local: template that declares an avatar_prompt can bundle an avatar.webp or avatar.png (up to 2 MB) the same way. It counts as a default avatar, so Generate Default Avatars replaces it once a key is configured; a missing or unreadable image falls back to the prompt-only seed. An agent seeded from a GitHub template (such as the bundled Cornelius) still shows initials until a key exists.
•WebP Conversion — Avatars are converted to WebP via Pillow for optimization.
•Stable Emotion Cache Keys — Emotion variants use stable cache keys to avoid redundant generation.
•Dark Mode Compatible — Avatar styling adapts to dark mode.
•Dashboard Timeline — Avatars display in Dashboard Timeline tiles at large size with a border ring.

Generation Failures

When avatar generation fails, the Generatedialog shows an actionable reason instead of a generic "Failed to generate avatar." Each failure is classified so you know whether to fix configuration, change the prompt, or just retry:

ReasonMeaningWhat to do
not_configuredNo image-generation API key is setAdd a Gemini key in Settings → Integrations (Platform Keys)
invalid_inputThe reference image or prompt was rejectedAdjust the prompt or upload a different reference image
safety_filterThe upstream model blocked the request on safety groundsReword the identity prompt
rate_limitedThe image provider is throttling requestsWait and retry
timeoutThe request timed out (e.g. a gateway 504)Retry; if persistent, check provider status
upstream_error / unknownAn unexpected provider or network errorRetry; check the platform logs if it recurs

API Endpoints

EndpointMethodDescription
/api/agents/{name}/avatarGETServe the agent's current avatar (no auth — avatars are public assets)
/api/agents/{name}/avatar/referenceGETServe the reference image the avatar was generated from (no auth)
/api/agents/{name}/avatar/identityGETThe agent's identity prompt
/api/agents/{name}/avatar/emotionsGETWhich emotion variants exist, and their version
/api/agents/{name}/avatar/emotion/{emotion}GETServe one emotion variant (no auth)
/api/agents/{name}/avatar/generatePOSTGenerate a new avatar (optionally from a reference image / identity prompt)
/api/agents/{name}/avatar/regeneratePOSTGenerate a fresh variation from the existing avatar
/api/agents/{name}/avatarDELETERemove the agent's custom avatar
/api/agents/avatars/generate-defaultsPOSTAdmin — generate default avatars for all agents without one