From bc21c6244917d3dcc48b5600ebf44fbdbf40529a Mon Sep 17 00:00:00 2001 From: beyandbey <231219854+beyandbey@users.noreply.github.com> Date: Tue, 11 Nov 2025 15:13:26 +0100 Subject: [PATCH 1/3] Fix: Detect workspace as default when it matches cwd (#311) - detect WorkspaceType.DEFAULT when run from default directory - use --here to detect as WorkspaceType.CURRENT_DIR instead --- comfy_cli/workspace_manager.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/comfy_cli/workspace_manager.py b/comfy_cli/workspace_manager.py index 3c58272..d2da074 100644 --- a/comfy_cli/workspace_manager.py +++ b/comfy_cli/workspace_manager.py @@ -230,18 +230,22 @@ def get_workspace_path(self) -> tuple[str, WorkspaceType]: WorkspaceType.CURRENT_DIR, ) + # Check for user-set default workspace + default_workspace = self.config_manager.get(constants.CONFIG_KEY_DEFAULT_WORKSPACE) + valid_default_workspace = default_workspace and check_comfy_repo(default_workspace)[0] + # Check the current directory for a ComfyUI if self.use_here is None: current_directory = os.getcwd() found_comfy_repo, comfy_repo = check_comfy_repo(os.path.join(current_directory)) # If it's in a sub dir of the ComfyUI repo, get the repo working dir if found_comfy_repo: - return comfy_repo.working_dir, WorkspaceType.CURRENT_DIR - - # Check for user-set default workspace - default_workspace = self.config_manager.get(constants.CONFIG_KEY_DEFAULT_WORKSPACE) + w_type = WorkspaceType.CURRENT_DIR + if valid_default_workspace and default_workspace == current_directory: + w_type = WorkspaceType.DEFAULT + return comfy_repo.working_dir, w_type - if default_workspace and check_comfy_repo(default_workspace)[0]: + if valid_default_workspace: return default_workspace, WorkspaceType.DEFAULT # Fallback to the most recent workspace if it exists From 68f9a2421facb1a061f5a81ecf5df4e71a07aadc Mon Sep 17 00:00:00 2001 From: beyandbey <231219854+beyandbey@users.noreply.github.com> Date: Tue, 18 Nov 2025 09:22:06 +0100 Subject: [PATCH 2/3] Fix linting --- comfy_cli/workspace_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_cli/workspace_manager.py b/comfy_cli/workspace_manager.py index d2da074..743d631 100644 --- a/comfy_cli/workspace_manager.py +++ b/comfy_cli/workspace_manager.py @@ -232,7 +232,7 @@ def get_workspace_path(self) -> tuple[str, WorkspaceType]: # Check for user-set default workspace default_workspace = self.config_manager.get(constants.CONFIG_KEY_DEFAULT_WORKSPACE) - valid_default_workspace = default_workspace and check_comfy_repo(default_workspace)[0] + valid_default_workspace = default_workspace and check_comfy_repo(default_workspace)[0] # Check the current directory for a ComfyUI if self.use_here is None: From e974103ffee3371753a707f14a89da47bb0cdc82 Mon Sep 17 00:00:00 2001 From: beyandbey <231219854+beyandbey@users.noreply.github.com> Date: Thu, 8 Jan 2026 10:16:07 +0100 Subject: [PATCH 3/3] Change workspace detection to recognize current comfy repo as default --- comfy_cli/workspace_manager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/comfy_cli/workspace_manager.py b/comfy_cli/workspace_manager.py index 743d631..f8aeada 100644 --- a/comfy_cli/workspace_manager.py +++ b/comfy_cli/workspace_manager.py @@ -241,7 +241,7 @@ def get_workspace_path(self) -> tuple[str, WorkspaceType]: # If it's in a sub dir of the ComfyUI repo, get the repo working dir if found_comfy_repo: w_type = WorkspaceType.CURRENT_DIR - if valid_default_workspace and default_workspace == current_directory: + if valid_default_workspace and default_workspace == comfy_repo.working_dir: w_type = WorkspaceType.DEFAULT return comfy_repo.working_dir, w_type