From b24fd29fac35f45a8291dd303a1a011135764298 Mon Sep 17 00:00:00 2001 From: Alexopus Date: Mon, 21 Jul 2025 16:10:29 +0200 Subject: [PATCH] Use comfy user directory --- .gitignore | 4 +++- __init__.py | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 496bff0..6cfc106 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ __pycache__ -notes/ \ No newline at end of file +notes/ + +.vscode/ diff --git a/__init__.py b/__init__.py index 154e2af..1f9cf43 100644 --- a/__init__.py +++ b/__init__.py @@ -11,7 +11,12 @@ NODE_DISPLAY_NAME_MAPPINGS = {} class NotesManager: def __init__(self): - self.notes_dir = os.path.join(os.path.dirname(__file__), "notes") + user_dir = folder_paths.get_user_directory() + if user_dir and os.path.isdir(user_dir): + self.notes_dir = os.path.join(user_dir, "default", "comfyui-notes-sidebar", "notes") + else: + self.notes_dir = os.path.join(os.path.dirname(__file__), "notes") + os.makedirs(self.notes_dir, exist_ok=True) def get_notes_list(self) -> list[str]: