Repository navigation
Conversation
A local Automatic1111-compatible image server, such as Draw Things, paints the portrait; its URL is a daemon setting in General settings.
…s, and require a model in the probe
|
Hey Vasco, nice work on this one, generating avatars from a description is a great touch. I pushed a few fixes on top (popover close no longer drops a pending result, generator URL keeps its path prefix, probe needs a real model, storage errors keep their cause). Bigger thought though: running Automatic1111 locally and pointing a URL at it feels a bit too nerdy for most owners. Pi already does image generation for us:
Could you rework it that way? Roughly: show Generate only when an image model is available (otherwise a hint to add an image provider in Settings → Providers), call |
Generate uses the first available image model from the providers signed in through Pi, such as OpenRouter, so no local server or URL setting is needed. Without an image model, the popover explains how to add one.
…changes Generate prefers OpenRouter's Gemini 2.5 Flash Image, falling back to the first available image model, and the popover names the model in use. Signing in or out of a provider refreshes whether Generate is available.
|
Thanks, that's a much better fit than a local server. Reworked along your outline in 3b3e331 and 7fb205f: Pi's image models, saved through the avatar store, with the URL setting, probe and HTTP client gone. A few calls I made, happy to change any of them:
One follow-up, not for this PR: I'd still like a free or local route. Pi only has the OpenRouter image API today, so that would mean a local images provider, ideally in pi-ai. Does that sound worth raising there? I haven't run it against a real image model yet, since I have no OpenRouter key here. |
Owners can describe an avatar and have it generated, instead of only uploading an image or picking an orb or emoji. Generation uses Pi's image models through the provider logins Orbs already keeps, so adding an OpenRouter key in Settings, under Providers, is enough. No local server or extra setting is needed.
google/gemini-2.5-flash-image, otherwise the first model frommodels.getAvailableOfType('image').avatars.generatecallsmodels.generateImages()with a portrait prompt and a 180s timeout, takes the first image, and saves it through the existing avatar image store as the usual 512px webp.avatars.generatorreturns the model that will be used, ornull.avatars.generator, so Generate becomes available right away.UPSTREAM_UNAVAILABLE(502) for no image model, a provider error or timeout, or an unusable image. The prompt is never logged.Testing
bun run checkandbun run lintpass.Screenshots
Without an image model (sidebar names are demo text):