This commit is contained in:
Will 2026-08-16 03:59:08 +01:00 committed by GitHub
commit 2b20e601d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -377,6 +377,10 @@ class PromptServer():
type_dir = folder_paths.get_temp_directory()
elif dir_type == "output":
type_dir = folder_paths.get_output_directory()
else:
# Unrecognised type: signal "no directory" instead of falling
# through to an unbound `type_dir` (UnboundLocalError -> 500).
return None, dir_type
return type_dir, dir_type
@ -401,6 +405,8 @@ class PromptServer():
image_upload_type = post.get("type")
upload_dir, image_upload_type = get_dir_by_type(image_upload_type)
if upload_dir is None:
return web.Response(status=400)
if image and image.file:
filename = image.filename