mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2026-07-07 07:01:46 +08:00
Update folder_paths.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
a2b56d8c1f
commit
3c3d7feefe
@ -30,14 +30,13 @@ def valid_path(saved_path,description = "Instance Folder"):
|
|||||||
return redirects[description]
|
return redirects[description]
|
||||||
print(f"\n[!] ALERT: {description} not found at: {saved_path}")
|
print(f"\n[!] ALERT: {description} not found at: {saved_path}")
|
||||||
new_path= input(f"Please paste the updated absolute path for '{description}': ").strip()
|
new_path= input(f"Please paste the updated absolute path for '{description}': ").strip()
|
||||||
try:
|
redirects = {}
|
||||||
redirects = {}
|
if os.path.exists(redirect_path):
|
||||||
if os.path.exists(redirects):
|
with open(redirect_path, "r") as f:
|
||||||
with open(redirects, "r") as f: redirects = json.load(f)
|
redirects = json.load(f)
|
||||||
redirects[description] = new_path
|
redirects[description] = new_path
|
||||||
with open(redirects, "w") as f: json.dump(redirects, f, indent=4)
|
with open(redirect_path, "w") as f:
|
||||||
except Exception:
|
json.dump(redirects, f, indent=4)
|
||||||
pass
|
|
||||||
|
|
||||||
return new_path
|
return new_path
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user