Skip to content

Commit 9d8164e

Browse files
committed
Safety check the Power Lora Loader info lookup, and log if there's an error to help #574
1 parent 4a1ddc3 commit 9d8164e

File tree

3 files changed

+25
-3
lines changed

3 files changed

+25
-3
lines changed

py/server/rgthree_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async def api_print(request):
4040
prefix="Reroute",
4141
color="YELLOW",
4242
id=message_type,
43-
at_most_secs=20 # 5 minutes
43+
at_most_secs=20
4444
)
4545
else:
4646
log("Unknown log type from api", prefix="rgthree-comfy",color ="YELLOW")

py/server/routes_model_info.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import json
33
from aiohttp import web
44

5+
from ..log import log
56
from server import PromptServer
67
import folder_paths
78

@@ -35,8 +36,29 @@ async def api_get_models_list(request):
3536
format_param = get_param(request, 'format')
3637
if format_param == 'details':
3738
response = []
39+
bad_files_first = None
40+
bad_files_num = 0
3841
for file in files:
39-
response.append(get_file_info(file, model_type))
42+
file_info = get_file_info(file, model_type)
43+
# Some folks were seeing null in this list, which is odd since it's coming from ComfyUI files.
44+
# See https://github.com/rgthree/rgthree-comfy/issues/574#issuecomment-3494629132 We'll check
45+
# and log if we haven't found, maybe someone will have more info.
46+
if file_info is not None:
47+
response.append(file_info)
48+
else:
49+
bad_files_num += 1
50+
if not bad_files_first:
51+
bad_files_first = file
52+
if bad_files_first:
53+
log(
54+
f"Couldn't get file info for {bad_files_first}"
55+
f"{f' and {bad_files_num} other {model_type}.' if bad_files_num > 1 else '.'} "
56+
"ComfyUI thinks they exist, but they were not found on the filesystem.",
57+
prefix="Power Lora Loader",
58+
color="YELLOW",
59+
id=f'no_file_details_{model_type}',
60+
at_most_secs=30
61+
)
4062
return web.json_response(response)
4163

4264
return web.json_response(list(files))

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "rgthree-comfy"
33
description = "Making ComfyUI more comfortable."
4-
version = "1.0.2511082223"
4+
version = "1.0.2511091959"
55
license = { file = "LICENSE" }
66
dependencies = []
77

0 commit comments

Comments
 (0)