Skip to main content

generate

Function generate 

Source
pub async fn generate(host: &impl ImageHost, body: Value) -> MediaResponse
Expand description

Text-to-image dispatch: validate prompt, default a single-image count, then route to the Gateway (cloud provider selected) or the local sd-server engine. This is the reusable image-gen entry; Core’s POST /api/images/generate handler is a thin wrapper over it, injecting ImageHost.