Skip to content

fix: log base directory to startup messages when --base-directory is used#13370

Merged
alexisrolland merged 2 commits into
Comfy-Org:masterfrom
octo-patch:fix/issue-13363-log-base-directory-on-startup
Jun 16, 2026
Merged

fix: log base directory to startup messages when --base-directory is used#13370
alexisrolland merged 2 commits into
Comfy-Org:masterfrom
octo-patch:fix/issue-13363-log-base-directory-on-startup

Conversation

@octo-patch

Copy link
Copy Markdown
Contributor

Fixes #13363

Problem

When --base-directory is passed at startup, ComfyUI logs messages like:

Setting output directory to: ...
Setting input directory to: ...
Setting user directory to: ...

But it never logs a message for the base directory itself, making it hard to confirm that --base-directory was applied correctly.

Solution

Add a Setting base directory to: ... log message in apply_custom_paths(), consistent with how other directory overrides are reported. The folder_paths.base_path value (already computed at import time) is used since it reflects the resolved absolute path.

Testing

Run ComfyUI with --base-directory /some/path and verify the startup output includes:

Setting base directory to: /some/path
@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fa1e48f1-9c9f-415b-864f-2f1d8eda7249

📥 Commits

Reviewing files that changed from the base of the PR and between 31283d2 and 0758c19.

📒 Files selected for processing (1)
  • main.py

📝 Walkthrough

Walkthrough

This pull request adds logging functionality for the --base-directory CLI argument in main.py. When the argument is provided, the code logs the base directory path within the apply_custom_paths() function. The implementation adds 4 lines without modifying existing control flow or path-setting logic, and introduces no changes to public API declarations.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main change: adding a log message for the base directory when --base-directory is used.
Description check ✅ Passed The description clearly explains the problem, solution, and testing steps, all directly related to the changeset.
Linked Issues check ✅ Passed The PR directly addresses issue #13363 by adding the missing base directory log message in apply_custom_paths() using folder_paths.base_path.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to adding a single log message for base directory reporting, which is entirely within the requirements of issue #13363.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@alexisrolland

Copy link
Copy Markdown
Member

I think this should be done folder_paths.py where the argument is used:

# --base-directory - Resets all default paths configured in folder_paths with a new base path
if args.base_directory:
    base_path = os.path.abspath(args.base_directory)
else:
    base_path = os.path.dirname(os.path.realpath(__file__))

models_dir = os.path.join(base_path, "models")

@alexisrolland alexisrolland left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually this is fine, we can't add the log in folder_paths.py because it is imported before the log handler.

I tested this and it's fine.

@alexisrolland alexisrolland merged commit 90eeeb2 into Comfy-Org:master Jun 16, 2026
14 checks passed
zhangp365 pushed a commit to zhangp365/ComfyUI that referenced this pull request Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants