Skip to content

Commit

Permalink
Fix for issue KoreTeknology#4
Browse files Browse the repository at this point in the history
  • Loading branch information
BastionNtB committed Aug 29, 2024
1 parent cb64097 commit 16a39cb
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions naistyler_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def load_naistyles_csv(naistyles_path: str):
"""
naistyles = {"Error loading naistyles.csv, check the console": ["",""]}
if not os.path.exists(naistyles_path):
print(f"""Error. No naistyles.csv found. Put your naistyles.csv in the custom_nodes/ComfyUI_NAI-mod/CSV directory of ComfyUI. Then press "Refresh".
print(f"""Error. No naistyles.csv found. Put your naistyles.csv in the {naistyles_path} directory of ComfyUI. Then press "Refresh".
Your current root directory is: {folder_paths.base_path}
""")
return naistyles
Expand All @@ -87,7 +87,7 @@ def load_naistyles_csv(naistyles_path: str):
naistyles = [[x.replace('"', '').replace('\n','') for x in re.split(',(?=(?:[^"]*"[^"]*")*[^"]*$)', line)] for line in f.readlines()[1:]]
naistyles = {x[0]: [x[1],x[2]] for x in naistyles}
except Exception as e:
print(f"""Error loading naistyles.csv. Make sure it is in the custom_nodes/ComfyUI_NAI-styler/CSV directory of ComfyUI. Then press "Refresh".
print(f"""Error loading naistyles.csv. Make sure it is in the {naistyles_path} directory of ComfyUI. Then press "Refresh".
Your current root directory is: {folder_paths.base_path}
Error: {e}
""")
Expand All @@ -103,7 +103,7 @@ def load_naifilters_csv(naifilters_path: str):
"""
naifilters = {"Error loading naistyles.csv, check the console": ["",""]}
if not os.path.exists(naifilters_path):
print(f"""Error. No naistyles.csv found. Put your naistyles.csv in the custom_nodes/ComfyUI_NAI-mod/CSV directory of ComfyUI. Then press "Refresh".
print(f"""Error. No naistyles.csv found. Put your naistyles.csv in the {naifilters_path} directory of ComfyUI. Then press "Refresh".
Your current root directory is: {folder_paths.base_path}
""")
return naifilters
Expand All @@ -112,7 +112,7 @@ def load_naifilters_csv(naifilters_path: str):
naifilters = [[x.replace('"', '').replace('\n','') for x in re.split(',(?=(?:[^"]*"[^"]*")*[^"]*$)', line)] for line in f.readlines()[1:]]
naifilters = {x[0]: [x[1],x[2]] for x in naifilters}
except Exception as e:
print(f"""Error loading naistyles.csv. Make sure it is in the custom_nodes/ComfyUI_NAI-styler/CSV directory of ComfyUI. Then press "Refresh".
print(f"""Error loading naistyles.csv. Make sure it is in the {naifilters_path} directory of ComfyUI. Then press "Refresh".
Your current root directory is: {folder_paths.base_path}
Error: {e}
""")
Expand All @@ -128,7 +128,7 @@ def load_naitypes_csv(naitypes_path: str):
"""
naitypes = {"Error loading naistyles.csv, check the console": ["",""]}
if not os.path.exists(naitypes_path):
print(f"""Error. No naistyles.csv found. Put your naistyles.csv in the custom_nodes/ComfyUI_NAI-mod/CSV directory of ComfyUI. Then press "Refresh".
print(f"""Error. No naistyles.csv found. Put your naistyles.csv in the {naitypes_path} directory of ComfyUI. Then press "Refresh".
Your current root directory is: {folder_paths.base_path}
""")
return naitypes
Expand All @@ -137,7 +137,7 @@ def load_naitypes_csv(naitypes_path: str):
naitypes = [[x.replace('"', '').replace('\n','') for x in re.split(',(?=(?:[^"]*"[^"]*")*[^"]*$)', line)] for line in f.readlines()[1:]]
naitypes = {x[0]: [x[1],x[2]] for x in naitypes}
except Exception as e:
print(f"""Error loading naistyles.csv. Make sure it is in the custom_nodes/ComfyUI_NAI-styler/CSV directory of ComfyUI. Then press "Refresh".
print(f"""Error loading naistyles.csv. Make sure it is in the {naitypes_path} directory of ComfyUI. Then press "Refresh".
Your current root directory is: {folder_paths.base_path}
Error: {e}
""")
Expand All @@ -147,9 +147,9 @@ def load_naitypes_csv(naitypes_path: str):

@classmethod
def INPUT_TYPES(cls):
cls.naistyles_csv = cls.load_naistyles_csv(os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-NAI-styler\\CSV\\naifilters.csv"))
cls.naifilters_csv = cls.load_naifilters_csv(os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-NAI-styler\\CSV\\naistyles.csv"))
cls.naitypes_csv = cls.load_naitypes_csv(os.path.join(folder_paths.base_path, "custom_nodes\\ComfyUI-NAI-styler\\CSV\\naitypes.csv"))
cls.naistyles_csv = cls.load_naistyles_csv(os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-NAI-styler/CSV/naifilters.csv"))
cls.naifilters_csv = cls.load_naifilters_csv(os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-NAI-styler/CSV/naistyles.csv"))
cls.naitypes_csv = cls.load_naitypes_csv(os.path.join(folder_paths.base_path, "custom_nodes/ComfyUI-NAI-styler/CSV/naitypes.csv"))
return {
"required": {
#"mute": (["On", "Off"],),
Expand Down

0 comments on commit 16a39cb

Please sign in to comment.