HttpImageGen.h header

#include <ew/app/HttpImageGen.h>

Namespace ew::app

Functions

AiImageResult ew::app::generateImage(const AiSettings &settings, const QString &prompt, const QString &size={})

Generates an image for prompt (optional size like "1024x1024") via the configured image endpoint (see AiSettings), reusing the chat API key, and returns the image bytes – downloading them when the provider returns a URL rather than inline base64 – or an error. Self-contained and blocking (a private network manager plus local event loops), so it is safe to call off the GUI thread. Returns an error without touching the network when image generation is not configured or the prompt is empty. Provider-agnostic: any OpenAI-compatible images/generations endpoint.