This commit is contained in:
Timothy Jaeryang Baek committed 2026-06-29 05:47:21 -05:00
1 parent ee5de69e37
commit 0883638027
7 files changed
+86 -43

No files matched your search

+11 -4
View File
@@ -31,7 +31,6 @@ from open_webui.retrieval.web.utils import get_ssrf_safe_session, validate_url
from open_webui.routers.files import get_file_content_by_id, upload_file_handler
from open_webui.utils.access_control import has_permission
from open_webui.utils.auth import get_admin_user, get_verified_user
from open_webui.utils.errors import error_detail
from open_webui.utils.headers import include_user_info_headers
from open_webui.utils.images.comfyui import (
ComfyUICreateImageForm,
@@ -170,7 +169,7 @@ async def get_image_model(request):
log.exception(f'Failed to get default model from automatic1111: {e}')
raise HTTPException(
status_code=400,
detail=error_detail(e, 'Failed to connect to the image generation engine'),
detail=ERROR_MESSAGES.DEFAULT(e, 'Failed to connect to the image generation engine'),
)
@@ -389,7 +388,10 @@ async def get_models(request: Request, user=Depends(get_verified_user)):
)
except Exception as e:
log.exception(f'Failed to list image generation models: {e}')
raise HTTPException(status_code=400, detail=error_detail(e, 'Failed to retrieve image generation models'))
raise HTTPException(
status_code=400,
detail=ERROR_MESSAGES.DEFAULT(e, 'Failed to retrieve image generation models'),
)
class CreateImageForm(BaseModel):
@@ -905,8 +907,13 @@ async def image_edits(
elif isinstance(form_data.image, list):
# Load all images in parallel for better performance
form_data.image = list(await asyncio.gather(*[load_url_image(img) for img in form_data.image]))
except HTTPException:
raise
except Exception as e:
raise HTTPException(status_code=400, detail=error_detail(e, 'Error loading image'))
raise HTTPException(
status_code=400,
detail=ERROR_MESSAGES.DEFAULT(e, 'Error loading image'),
)
def get_image_file_item(base64_string, param_name='image'):
data = base64_string