From 0b42e45f8d3bc4c3ac6cbd795e6c15dca15c9c3a Mon Sep 17 00:00:00 2001 From: Vladimir Mandic Date: Thu, 13 Apr 2023 12:00:50 -0400 Subject: [PATCH] update install notes --- README.md | 48 ++++++++++++++++++++++++++++++++++-------------- TODO.md | 1 - launch.py | 1 + setup.py | 7 ++++++- 4 files changed, 41 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 1fbb7d6ca..51295ec42 100644 --- a/README.md +++ b/README.md @@ -21,11 +21,10 @@ If you are looking an amazing simple-to-use Stable Diffusion tool, I'd suggest [ - New logger - New error and exception handlers -- Built-in performance profiler -- Updated **Python** libraries to latest known compatible versions - e.g. `accelerate`, `transformers`, `numpy`, etc. +- Built-in performance profiler +- Enhanced environment tuning +- Updated libraries to latest known compatible versions - Includes opinionated **System** and **Options** configuration - e.g. `samplers`, `upscalers`, etc. - Does not rely on `Accelerate` as it only affects distributed systems - Optimized startup Gradio web server will be initialized much earlier which model load is done in the background @@ -34,6 +33,8 @@ If you are looking an amazing simple-to-use Stable Diffusion tool, I'd suggest [ e.g. `/train`, `/outputs/*`, `/models/*`, etc. - Enhanced training templates - Built-in `LoRA`, `LyCORIS`, `Custom Diffusion`, `Dreambooth` training +- Majority of settings configurable via UI without the need for command line flags + e.g, cross-optimization methods, system folders, etc. ### User Interface @@ -44,10 +45,12 @@ If you are looking an amazing simple-to-use Stable Diffusion tool, I'd suggest [ - Optimized for `Torch` 2.0 - Runs with `SDP` memory attention enabled by default if supported by system +- Auto-adjust parameters when running on **CPU** or **CUDA** + *Note:* AMD and M1 platforms are supported, but without out-of-the-box optimizations ### Removed -- Drops compatibility with older versions of `python` and requires **3.9** +- Drops compatibility with older versions of `python` and requires **3.9** or **3.10** - Drops localizations - Drops automated tests @@ -78,8 +81,10 @@ Fork adds extra functionality: ## Install 1. Install first: -`Python`, `Git` -2. Clone repository +**Python** & **Git** +2. If you have nVidia GPU, install nVidia CUDA toolkit: + +3. Clone repository `git clone https://github.com/vladmandic/automatic` ## Run @@ -87,22 +92,37 @@ Fork adds extra functionality: Run desired startup script to install dependencies and extensions and start server: - `webui.bat` and `webui.sh`: - Platform specific wrapper scripts that starts `launch.py` in Python virtual environment - *Note*: Server can run without virtual environment, but it is recommended to use it + Platform specific wrapper scripts For Windows, Linux and OSX + Starts `launch.py` in a Python virtual environment (venv) + *Note*: Server can run without virtual environment, but it is recommended to use it to avoid library version conflicts with other applications **If you're unsure which launcher to use, this is the one you want** - `launch.py`: Main startup script - Can be used directly to start server in manually activated `venv` or to run it without `venv` - Run `python launch.py --help` for available options + Can be used directly to start server in a manually activated `venv` or to run server without `venv` - `setup.py`: Main installer, used by `launch.py` Can also be used directly to update repository or extensions If running manually, make sure to activate `venv` first (if used) - Run `python setup.py --help` for available options - Setup details are logged to `setup.log` - `webui.py`: Main server script - Run `python webui.py --help` for available options + +Any of the above scripts can be used with `--help` to display detailed usage information and available parameters +For example: +> webui.bat --help + +Full startup sequence is logged in `setup.log`, so if you encounter any issues, please check it first + +## Update + +The launcher can perform automatic update of main repository, requirements, extensions and submodules: + +- Main repository: + Update is *not* performed by default, enable with `--upgrade` flag +- Requirements: + Check is performed on each startup and missing requirements are auto-installed, can be skipped with `--skip-requirements` flag +- Extensions and submodules: + Update is performed on each startup and installer for each extension is started, can be skipped with `--skip-extensions` flag +- All checks can be skipped using `--quick` flag
diff --git a/TODO.md b/TODO.md index 104644418..c1e875542 100644 --- a/TODO.md +++ b/TODO.md @@ -13,7 +13,6 @@ Stuff to be fixed... - Cleanup `ui-config.json` - Investigate integration with `Torch-DirectML` - Set defaults for Apple M1 -- Set defaults for CPU-only - Support mupliple folders for models ## Integration diff --git a/launch.py b/launch.py index 231968751..7260c4d67 100644 --- a/launch.py +++ b/launch.py @@ -14,6 +14,7 @@ except ImportError: commandline_args = os.environ.get('COMMANDLINE_ARGS', "") sys.argv += shlex.split(commandline_args) +setup.parse_args() args, _ = cmd_args.parser.parse_known_args() git = os.environ.get('GIT', "git") index_url = os.environ.get('INDEX_URL', "") diff --git a/setup.py b/setup.py index 674ffc6f7..2b2bcaa07 100644 --- a/setup.py +++ b/setup.py @@ -278,6 +278,8 @@ def install_submodules(): # install requirements def install_requirements(): + if args.skip_requirements: + return log.info('Installing requirements') f = open('requirements.txt', 'r') lines = [line.strip() for line in f.readlines() if line.strip() != ''] @@ -338,10 +340,13 @@ def check_timestamp(): def parse_args(): # command line args # parser = argparse.ArgumentParser(description = 'Setup for SD WebUI') + if vars(parser)['_option_string_actions'].get('--debug', None) is not None: + return parser.add_argument('--debug', default = False, action='store_true', help = "Run installer with debug logging, default: %(default)s") parser.add_argument('--quick', default = False, action='store_true', help = "Skip installing if setup.log is newer than repo timestamp, default: %(default)s") parser.add_argument('--upgrade', default = False, action='store_true', help = "Upgrade main repository to latest version, default: %(default)s") parser.add_argument('--noupdate', default = False, action='store_true', help = "Skip update extensions and submodules, default: %(default)s") + parser.add_argument('--skip-requirements', default = False, action='store_true', help = "Skips checking and installing requirements, default: %(default)s") parser.add_argument('--skip-extensions', default = False, action='store_true', help = "Skips running individual extension installers, default: %(default)s") global args args = parser.parse_args() @@ -350,7 +355,6 @@ def parse_args(): # entry method when used as module def run_setup(quick = False): setup_logging() - parse_args() check_python() if (quick or args.quick) and check_timestamp(): log.info('Attempting quick setup') @@ -367,6 +371,7 @@ def run_setup(quick = False): if __name__ == "__main__": + parse_args() run_setup() set_environment() check_torch()