Skip to main content

Image Generation

🎨 Image Generation Troubleshooting​

General Issues​

  • Image Not Generating (asking for an image produces no image, or an error appears in the chat):

    • Check the Images settings in Settings > Admin > Images. Ensure "Image Generation" is toggled ON.
    • Ensure the Image toggle is on in the Integrations menu of the message input. Nothing image-related happens without it, in any function calling mode.
    • Ensure the model has the Image Generation capability in Workspace > Models > Edit, and that your role has the Image Generation feature permission.
    • Verify your API Key and Base URL (for OpenAI, ComfyUI, Automatic1111) are correct.
    • Ensure the selected model is available and loaded in your backend service (e.g., check the ComfyUI or Automatic1111 console for activity).
    • Azure OpenAI: If you see [ERROR: azure-openai error: Unknown parameter: 'response_format'.], ensure you are using API version 2025-04-01-preview or later.
  • "Image unavailable" in place of a picture (a small dashed box with a photo icon where the image used to be):

    • The browser could not load the image from the address stored on the message. This covers any image in a chat, uploaded or generated.
    • The usual cause is that the file behind it is gone, deleted through Settings > Data Controls > Manage Files or wiped along with the data directory. A deleted file cannot be brought back, so the placeholder stays on that message.
    • The placeholder is not clickable, so the full-screen preview does not open on an image that cannot be shown. If the message later points at a different image address, the image is loaded again.
    • If you run more than one replica and the placeholder comes and goes, check that /app/backend/data really is shared between them. See Scaling & HA → Uploaded Files or RAG Knowledge Inaccessible.

ComfyUI Issues​

  • Incompatible Workflow / JSON Errors (you see Invalid workflow or JSON parse errors after uploading a workflow):

    • API Format Required: Open WebUI requires workflows to be in the API Format.
    • In ComfyUI:
      1. Click the "Settings" (gear icon).
      2. Enable "Enable Dev mode Options".
      3. Click "Save (API Format)" in the menu.
    • Do not use the standard "Save" button or standard JSON export.
  • Image Editing / Image Variation Fails (generating from text works, but editing or image-to-image fails silently):

    • If you are using Image Editing or Image+Image generation, your custom workflow must have nodes configured to accept an input image (usually a LoadImage node replaced/linked effectively).
    • Check the default "Image Editing" workflow in the Open WebUI settings for the required node structure to ensure compatibility.
  • Generation/editing fails when ComfyUI is on a private/internal address (e.g. 10.x, 192.168.x, 172.16–31.x, or localhost), often only after the workflow runs:

    • Open WebUI applies SSRF protection to outbound fetches, which previously blocked retrieving the rendered image back from a ComfyUI instance on a private network.
    • Fixed in v0.9.6: image URLs are now trusted when they are same-origin with the admin-configured COMFYUI_BASE_URL (a strict scheme + host + port match, not a string prefix), so a private-network ComfyUI works without weakening SSRF protection globally.
    • Ensure COMFYUI_BASE_URL (and, for image editing, IMAGES_EDIT_COMFYUI_BASE_URL, which is empty by default and is the only origin the edit path trusts) is set to the exact origin ComfyUI serves images from (matching scheme, host, and port). If ComfyUI returns image URLs on a different host/port than COMFYUI_BASE_URL, those fetches are still SSRF-validated and may be blocked. On older versions, upgrade rather than disabling SSRF protection.

Automatic1111 Issues​

  • Connection Refused / "Api Not Found" (Automatic1111 is running, but Open WebUI reports connection errors):

    • Ensure you are running Automatic1111 with the --api flag enabled in your command line arguments.
  • Docker Connectivity (Open WebUI can't reach Automatic1111 on localhost):

    • If Open WebUI is running in Docker and Automatic1111 is on your host machine:
      • Use http://host.docker.internal:7860 as the Base URL.
      • Ensure host.docker.internal is resolvable (added via --add-host=host.docker.internal:host-gateway in your Docker run command).

Environment Variables & Configuration​

For advanced configuration, you can set the following environment variables.

General Image Generation​

  • ENABLE_IMAGE_GENERATION: Set to true to enable image generation.
  • IMAGE_GENERATION_ENGINE: The engine to use (e.g., openai, comfyui, automatic1111, gemini).
  • IMAGE_GENERATION_MODEL: The model ID to use for generation.
  • IMAGE_SIZE: Default image size (e.g., 512x512).

Engine Specifics​

OpenAI / Compatible

  • IMAGES_OPENAI_API_BASE_URL: Base URL for OpenAI-compatible image generation API.
  • IMAGES_OPENAI_API_KEY: API Key for the image generation service.

ComfyUI

  • COMFYUI_BASE_URL: Base URL for your ComfyUI instance.
  • COMFYUI_API_KEY: API Key (if authentication is enabled).
  • COMFYUI_WORKFLOW: Custom workflow JSON (must be API format).

Automatic1111

  • AUTOMATIC1111_BASE_URL: Base URL for your Automatic1111 instance.
  • AUTOMATIC1111_API_AUTH: Authentication credentials (username:password).

Gemini

tip

For a complete list of environment variables and detailed configuration options, please refer to the Environment Configuration Guide.

This content is for informational purposes only and does not constitute a warranty, guarantee, or contractual commitment. Open WebUI is provided "as is." See your license for applicable terms.