Return a more specific error when inspect model folder doesn't exist

This commit is contained in:
Acly
2024-12-07 19:49:00 +01:00
parent 50d3479fba
commit fe39d22eb9
2 changed files with 8 additions and 4 deletions
+3 -3
View File
@@ -13,9 +13,9 @@ Provides nodes and API geared towards using ComfyUI as a backend for external to
## <a id="images" href="#toc">Sending and receiving images</a>
ComfyUI exchanges images via the filesystem. This requires a
multi-step process (upload images, prompt, download images), is rather
inefficient, and invites a whole class of potential issues. It's also unclear
at which point those images will get cleaned up if ComfyUI is used
multi-step process (upload images, prompt, download images), which
invites a whole class of potential issues you might not want to deal with.
It's also unclear at which point those images will get cleaned up if ComfyUI is used
via external tools.
### Load Image (Base64)
+5 -1
View File
@@ -139,10 +139,14 @@ def inspect_diffusion_model(filename: str, model_type: str, is_checkpoint: bool)
def inspect_models(model_type: str):
try:
try:
files = folder_paths.get_filename_list(model_type)
except KeyError:
return {"error": f"Model folder not found: {model_type}"}
is_checkpoint = model_type == "checkpoints"
info = {
filename: inspect_diffusion_model(filename, model_type, is_checkpoint)
for filename in folder_paths.get_filename_list(model_type)
for filename in files
}
return web.json_response(info)
except Exception as e: