Text chats and image creation use different model endpoints. In Open WebUI, image generation sends a prompt to a configured image provider and stores the returned picture with the instance.

The Default (Open AI) engine works with an existing OpenAI-compatible image API. The provider must support image generation, the selected image model, and the requested size; a working chat-completion endpoint alone is not enough. Its URL must be reachable from the Open WebUI server or container.

The provider receives image prompts and may charge for each request. A synthetic prompt avoids sending confidential content during the first test, while opening the stored picture checks that the response contains a readable image.

Steps to enable Open WebUI image generation:

The starting point is an administrator session, an existing image provider with its model ID and credentials, and an Open WebUI API key for an account with Image Generation permission. If API-key endpoint restrictions are enabled, the permitted paths must include /api/v1/images/generations and /api/v1/files for the test and image retrieval.
Related: How to enable API keys in Open WebUI

  1. Open the profile menu.

  2. Select Settings.
  3. Select Images under Admin → Tools.

  4. Enable Image Generation.
  5. Select Default (Open AI) as the Image Generation Engine.
  6. Enter the provider's image model ID in Model.

    The model ID belongs to the image provider, such as sd-turbo on a compatible Stable Diffusion endpoint. It is separate from the model selected for text chats.

  7. Enter a size supported by that model in Image Size.

    The 512x512 value shown here is supported by the selected image backend. Other models can require different dimensions.

  8. Enter the reachable provider URL in API Base URL under Create Image.

    A compatible endpoint can use a base URL such as https://llm.example.com/v1. Requests go to that base URL followed by /images/generations. For a standard endpoint, API Version remains empty and Additional Parameters remains {}.

  9. Enter the provider-issued key in API Key under Create Image.

    The provider key authorizes requests that may incur charges. It must remain masked and stay out of shared captures, logs, and repositories.

  10. Click Save to apply the image settings.

    A missing provider key or invalid JSON prevents saving. The Image Edit section controls a separate operation and is not needed for creating an image.

  11. Read the Open WebUI API key into a temporary variable in a Bash terminal.
    $ IFS= read -r -s -p 'Open WebUI API key: ' OPEN_WEBUI_API_KEY

    Shell tracing must be off to avoid logging secrets. This is the Open WebUI account's key, separate from the image provider's key.

  12. Set the base URL of your Open WebUI instance.
    $ OPEN_WEBUI_URL="https://openwebui.example.com"
  13. Send one synthetic image prompt through Open WebUI.
    $ printf 'Authorization: Bearer %s\n' "$OPEN_WEBUI_API_KEY" |
      curl --fail-with-body --silent --show-error \
        -H @- -H 'Content-Type: application/json' \
        "$OPEN_WEBUI_URL/api/v1/images/generations" \
        --data '{"prompt":"A watercolor painting of a red sailboat on a blue lake","n":1}'
    [{"id":"f9d9ae2e-db31-4038-a493-49ae496d2c8a","url":"/api/v1/files/f9d9ae2e-db31-4038-a493-49ae496d2c8a/content","name":"generated-image.png","content_type":"image/png"}]

    The request uses the saved image model and size. The authorization header passes through standard input so the expanded key stays out of curl's process arguments. A 400 response can indicate an unsupported model or size, rejected credentials, or an unreachable provider; 403 can indicate disabled image generation, missing account permission, or an API-key endpoint restriction.

  14. Download the returned file URL as generated-image.png.
    $ printf 'Authorization: Bearer %s\n' "$OPEN_WEBUI_API_KEY" |
      curl --fail-with-body --silent --show-error \
        -H @- "$OPEN_WEBUI_URL/api/v1/files/f9d9ae2e-db31-4038-a493-49ae496d2c8a/content" \
        --output generated-image.png

    The file ID in the URL must match your own generation response. Open WebUI serves images from this endpoint as downloads, even when opened in a signed-in browser.

  15. Open generated-image.png in an image viewer.

    The picture must display rather than an error page or an unreadable file. A stored URL alone does not confirm that the generated image can be viewed.

Share this guide