Return a more specific error when inspect model folder doesn't exist
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user