There are two shapes of provider here, because waking a serverless worker per request and renting a whole instance that stays up need different lifecycles.
Serverless wakes a worker on the first generate and talks directly to its SwarmUI over HTTP: GetNewSession, ListModels, SelectModel, GenerateText2Image, GenerateText2ImageWS. This deliberately does not reuse SwarmUI's built in SwarmSwarmBackend, which assumes the remote is reachable at startup and whose idle pings would keep a pay per second worker billing the whole time it is attached.
Instance rental is the opposite shape. Once a pod is running it stays up until you stop it, so there is no reason to reimplement the remote protocol. The backend drives the provider API to get a pod running with SwarmUI on it, then attaches an OwnerBoundSwarmBackend to its URL as a child and steps out of the way. That child does everything from there: sessions, model listing, generation, websockets, previews.
Permissions are use_runpod_serverless, use_runpod_pods, use_vastai, use_vastai_instances and cloudbackends_status. Every action is reachable over the plain API, and the start and stop calls have websocket variants that stream progress lines while a cold instance boots.
Comments
No comments yet. Start the conversation.
Join the conversation
Sign in to share your thoughts