Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base output path off data path #14446

Merged
merged 3 commits into from
Dec 30, 2023
Merged

Conversation

w-e-w
Copy link
Collaborator

@w-e-w w-e-w commented Dec 27, 2023

Description

alternative implementation of #14443 Added shared.cmd_opts.data_dir prefix to "outputs" and "log" paths.

achieve the same thing with minor differences being

  1. the default path is truncated if it's a child's of CWD
    this has the advantage of making existing config.json more usable if webui is moved
  2. using the path separator of the respective of OS

other minor change

  1. create a path truncate utility function truncate_path()
  2. create a new paths_internal var default_output_dir (I guess this can be reused by extensions)
  3. also use this utility function for def webpath(fn) simplifying it
    (I know I probably shouldn't have bundle this one in this PR)

Implications

this change could potentially have a minor impact on existing users
if the user decides to create a new configuration file and happens to be using --data-dir
but they also wish for some reason the output to be in the webui root
these user will have to set the output to webui root manually

but for existing users that are using existing configuration file there will be no impact, as this only changes the default output path not the current path

Checklist:

utli.truncate_path(target_path, base_path)
return the target_path relative to base_path if target_path is a sub path of base_path else return the absolute path
@w-e-w w-e-w force-pushed the base-output-path-off-data_path branch from 56d805f to 892e703 Compare December 27, 2023 21:52
@AUTOMATIC1111 AUTOMATIC1111 merged commit c9c105c into dev Dec 30, 2023
6 checks passed
@AUTOMATIC1111 AUTOMATIC1111 deleted the base-output-path-off-data_path branch December 30, 2023 11:45
@w-e-w w-e-w mentioned this pull request Feb 17, 2024
This was referenced Mar 18, 2024
@pawel665j pawel665j mentioned this pull request Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants