mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-13 17:58:56 -06:00
[GH-ISSUE #23611] bug: Image generation fails with providers that don't support 'size' parameter (e.g., xAI/grok-imagine-image) #35557
Reference in New Issue
Block a user
Originally created by @agent2x0r on GitHub (Apr 12, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23611
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.12
Ollama Version (if applicable)
No response
Operating System
Debian 12
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
Image generation should work with providers that don't support the
sizeparameter, or thesizeparameter should be optional.Actual Behavior
OpenWebUI always sends the
sizeparameter (either user-provided value or default), causing xAI to reject the request with "Argument not supported: size".Steps to Reproduce
Logs & Screenshots
Apr 12 03:26:52 litellm litellm[40868]: litellm.proxy.proxy_server.image_generation(): Exception occured - litellm.BadRequestError: XaiException - Error code: 400 - {'code': '400', 'error': 'Argument not supported: size'}. Received Model Group=grok-imagine-image
Apr 12 03:26:52 litellm litellm[40868]: Available Model Group Fallbacks=None
Apr 12 03:26:52 litellm litellm[40868]: INFO: 192.168.0.221:38886 - "POST /images/generations HTTP/1.1" 400 Bad Request
Additional Information
Root Cause
In
backend/open_webui/routers/images.py, line 555:This always sends
sizeparameter (either user's value or default config value), even when the provider doesn't support it.Same issue at line 863 for image edit endpoint.
Temporary Fix allowed for successful image generation with xAI provider
Only send
sizewhen user actually provides one:@tjbck commented on GitHub (Apr 13, 2026):
Addressed in dev.