mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-04-20 03:13:30 +00:00
fixed: robust loading comfy.settings.json
(#6383)
https://github.com/comfyanonymous/ComfyUI/issues/6371
This commit is contained in:
parent
4209edf48d
commit
c515bdf371
@ -1,6 +1,7 @@
|
|||||||
import os
|
import os
|
||||||
import json
|
import json
|
||||||
from aiohttp import web
|
from aiohttp import web
|
||||||
|
import logging
|
||||||
|
|
||||||
|
|
||||||
class AppSettings():
|
class AppSettings():
|
||||||
@ -11,8 +12,12 @@ class AppSettings():
|
|||||||
file = self.user_manager.get_request_user_filepath(
|
file = self.user_manager.get_request_user_filepath(
|
||||||
request, "comfy.settings.json")
|
request, "comfy.settings.json")
|
||||||
if os.path.isfile(file):
|
if os.path.isfile(file):
|
||||||
with open(file) as f:
|
try:
|
||||||
return json.load(f)
|
with open(file) as f:
|
||||||
|
return json.load(f)
|
||||||
|
except:
|
||||||
|
logging.error(f"The user settings file is corrupted: {file}")
|
||||||
|
return {}
|
||||||
else:
|
else:
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user