paths_internal.py 1.0 KB

12345678910111213141516171819202122
  1. """this module defines internal paths used by program and is safe to import before dependencies are installed in launch.py"""
  2. import argparse
  3. import os
  4. script_path = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
  5. sd_configs_path = os.path.join(script_path, "configs")
  6. sd_default_config = os.path.join(sd_configs_path, "v1-inference.yaml")
  7. sd_model_file = os.path.join(script_path, 'model.ckpt')
  8. default_sd_model_file = sd_model_file
  9. # Parse the --data-dir flag first so we can use it as a base for our other argument default values
  10. parser_pre = argparse.ArgumentParser(add_help=False)
  11. parser_pre.add_argument("--data-dir", type=str, default=os.path.dirname(os.path.dirname(os.path.realpath(__file__))), help="base path where all user data is stored",)
  12. cmd_opts_pre = parser_pre.parse_known_args()[0]
  13. data_path = cmd_opts_pre.data_dir
  14. models_path = os.path.join(data_path, "models")
  15. extensions_dir = os.path.join(data_path, "extensions")
  16. extensions_builtin_dir = os.path.join(script_path, "extensions-builtin")