Fix: Detect workspace as default when it matches cwd (#311)#338
Open
beyandbey wants to merge 3 commits intoComfy-Org:mainfrom
Open
Fix: Detect workspace as default when it matches cwd (#311)#338beyandbey wants to merge 3 commits intoComfy-Org:mainfrom
beyandbey wants to merge 3 commits intoComfy-Org:mainfrom
Conversation
- detect WorkspaceType.DEFAULT when run from default directory - use --here to detect as WorkspaceType.CURRENT_DIR instead
Codecov Report❌ Patch coverage is
@@ Coverage Diff @@
## main #338 +/- ##
==========================================
- Coverage 52.18% 52.15% -0.04%
==========================================
Files 32 32
Lines 3516 3520 +4
==========================================
+ Hits 1835 1836 +1
- Misses 1681 1684 +3
🚀 New features to boost your workflow:
|
bigcat88
reviewed
Jan 7, 2026
comfy_cli/workspace_manager.py
Outdated
| # 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: |
Contributor
There was a problem hiding this comment.
Should it be like this?
if valid_default_workspace and default_workspace == comfy_repo.working_dir:
w_type = WorkspaceType.DEFAULT
If a user is in a subdirectory of ComfyUI (e.g., /home/user/ComfyUI/custom_nodes/MyNode):
- current_directory = /home/user/ComfyUI/custom_nodes/MyNode
- comfy_repo.working_dir = /home/user/ComfyUI
- default_workspace = /home/user/ComfyUI
The comparison default_workspace == current_directory would fail even though the user is inside their default workspace.
Author
There was a problem hiding this comment.
Your're right, good point! Changing the comparison to default_workspace == comfy_repo.working_dir does recognize it properly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #311
comfy launchused to detect Workspace.CURRENT_DIR when launched from within the directory marked as default.This lead to some unexpected behavior, i.e. not being able to apply default launch extras.
When working from within the default workspace, I'd assume the user wants to apply default settings as well. Hence following changes:
This makes working within the default workspace more convenient, whilst preserving the possibility to opt-out of default behavior.