Safety check the Power Lora Loader info lookup, and log if there's an error to help #574

This commit is contained in:
rgthree
2025-11-09 19:59:33 -05:00
parent 4a1ddc3262
commit 9d8164edfc
3 changed files with 25 additions and 3 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ async def api_print(request):
prefix="Reroute",
color="YELLOW",
id=message_type,
at_most_secs=20 # 5 minutes
at_most_secs=20
)
else:
log("Unknown log type from api", prefix="rgthree-comfy",color ="YELLOW")
+23 -1
View File
@@ -2,6 +2,7 @@ import os
import json
from aiohttp import web
from ..log import log
from server import PromptServer
import folder_paths
@@ -35,8 +36,29 @@ async def api_get_models_list(request):
format_param = get_param(request, 'format')
if format_param == 'details':
response = []
bad_files_first = None
bad_files_num = 0
for file in files:
response.append(get_file_info(file, model_type))
file_info = get_file_info(file, model_type)
# Some folks were seeing null in this list, which is odd since it's coming from ComfyUI files.
# See https://github.com/rgthree/rgthree-comfy/issues/574#issuecomment-3494629132 We'll check
# and log if we haven't found, maybe someone will have more info.
if file_info is not None:
response.append(file_info)
else:
bad_files_num += 1
if not bad_files_first:
bad_files_first = file
if bad_files_first:
log(
f"Couldn't get file info for {bad_files_first}"
f"{f' and {bad_files_num} other {model_type}.' if bad_files_num > 1 else '.'} "
"ComfyUI thinks they exist, but they were not found on the filesystem.",
prefix="Power Lora Loader",
color="YELLOW",
id=f'no_file_details_{model_type}',
at_most_secs=30
)
return web.json_response(response)
return web.json_response(list(files))
+1 -1
View File
@@ -1,7 +1,7 @@
[project]
name = "rgthree-comfy"
description = "Making ComfyUI more comfortable."
version = "1.0.2511082223"
version = "1.0.2511091959"
license = { file = "LICENSE" }
dependencies = []