stable-diffusion-webui
stable-diffusion-webui copied to clipboard
Base output path off data path
Description
alternative implementation of https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/14443 Added shared.cmd_opts.data_dir prefix to "outputs" and "log" paths.
achieve the same thing with minor differences being
- 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
- using the path separator of the respective of OS
other minor change
- create a path truncate utility function
truncate_path()
- create a new paths_internal var
default_output_dir
(I guess this can be reused by extensions) - 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:
- [x] I have read contributing wiki page
- [x] I have performed a self-review of my own code
- [x] My code follows the style guidelines
- [x] My code passes tests