Skip to main content
Trinity
Guides/Agent Avatars

Agent Avatars

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

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 — Admin button in Settings generates robot/android-style avatars for all agents without a custom avatar.
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 GEMINI_API_KEY in Settings → AI 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
/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