diff --git a/docs/features/CLI.md b/docs/features/CLI.md index a54522f6a0..a0410692dd 100644 --- a/docs/features/CLI.md +++ b/docs/features/CLI.md @@ -136,7 +136,7 @@ mixture of both using any of the accepted command switch formats: # InvokeAI initialization file # This is the InvokeAI initialization file, which contains command-line default values. # Feel free to edit. If anything goes wrong, you can re-initialize this file by deleting - # or renaming it and then running configure_invokeai.py again. + # or renaming it and then running invokeai-configure again. # The --root option below points to the folder in which InvokeAI stores its models, configs and outputs. --root="/Users/mauwii/invokeai" diff --git a/docs/features/CONCEPTS.md b/docs/features/CONCEPTS.md index 440dbb12d8..7bf39c8b84 100644 --- a/docs/features/CONCEPTS.md +++ b/docs/features/CONCEPTS.md @@ -51,7 +51,7 @@ You can also combine styles and concepts: If you used an installer to install InvokeAI, you may have already set a HuggingFace token. If you skipped this step, you can: - - run the InvokeAI configuration script again (if you used a manual installer): `scripts/configure_invokeai.py` + - run the InvokeAI configuration script again (if you used a manual installer): `invokeai-configure` - set one of the `HUGGINGFACE_TOKEN` or `HUGGING_FACE_HUB_TOKEN` environment variables to contain your token Finally, if you already used any HuggingFace library on your computer, you might already have a token diff --git a/docs/features/OUTPAINTING.md b/docs/features/OUTPAINTING.md index 40c224791f..ff9322bc1e 100644 --- a/docs/features/OUTPAINTING.md +++ b/docs/features/OUTPAINTING.md @@ -120,7 +120,7 @@ A number of caveats: (`--iterations`) argument. 3. Your results will be _much_ better if you use the `inpaint-1.5` model - released by runwayML and installed by default by `scripts/configure_invokeai.py`. + released by runwayML and installed by default by `invokeai-configure`. This model was trained specifically to harmoniously fill in image gaps. The standard model will work as well, but you may notice color discontinuities at the border. diff --git a/docs/features/POSTPROCESS.md b/docs/features/POSTPROCESS.md index 8f4604060b..c0233951da 100644 --- a/docs/features/POSTPROCESS.md +++ b/docs/features/POSTPROCESS.md @@ -28,11 +28,11 @@ should "just work" without further intervention. Simply pass the `--upscale` the popup in the Web GUI. **GFPGAN** requires a series of downloadable model files to work. These are -loaded when you run `scripts/configure_invokeai.py`. If GFPAN is failing with an +loaded when you run `invokeai-configure`. If GFPAN is failing with an error, please run the following from the InvokeAI directory: ```bash -python scripts/configure_invokeai.py +invokeai-configure ``` If you do not run this script in advance, the GFPGAN module will attempt to @@ -106,7 +106,7 @@ This repo also allows you to perform face restoration using [CodeFormer](https://github.com/sczhou/CodeFormer). In order to setup CodeFormer to work, you need to download the models like with -GFPGAN. You can do this either by running `configure_invokeai.py` or by manually +GFPGAN. You can do this either by running `invokeai-configure` or by manually downloading the [model file](https://github.com/sczhou/CodeFormer/releases/download/v0.1.0/codeformer.pth) and saving it to `ldm/invoke/restoration/codeformer/weights` folder. diff --git a/docs/installation/010_INSTALL_AUTOMATED.md b/docs/installation/010_INSTALL_AUTOMATED.md index 8007c59b6d..9ded32e50d 100644 --- a/docs/installation/010_INSTALL_AUTOMATED.md +++ b/docs/installation/010_INSTALL_AUTOMATED.md @@ -177,8 +177,7 @@ version of InvokeAI with the option to upgrade to experimental versions later. minutes and nothing is happening, you can interrupt the script with ^C. You may restart it and it will pick up where it left off. -10. After installation completes, the installer will launch a script called - `configure_invokeai.py`, which will guide you through the first-time process +10. After installation completes, the installer will launch the configuration script, which will guide you through the first-time process of selecting one or more Stable Diffusion model weights files, downloading and configuring them. We provide a list of popular models that InvokeAI performs well with. However, you can add more weight files later on using @@ -227,7 +226,7 @@ version of InvokeAI with the option to upgrade to experimental versions later. `invokeai\invokeai.init`. It contains a variety of examples that you can follow to add and modify launch options. -!!! warning "The `invokeai` directory contains the `invoke` application, its +!!! warning "The `invokeai` directory contains the `invokeai` application, its configuration files, the model weight files, and outputs of image generation. Once InvokeAI is installed, do not move or remove this directory." @@ -253,18 +252,18 @@ will bring InvokeAI up to date with the latest libraries. ### Corrupted configuration file -Everything seems to install ok, but `invoke` complains of a corrupted +Everything seems to install ok, but `invokeai` complains of a corrupted configuration file and goes back into the configuration process (asking you to download models, etc), but this doesn't fix the problem. This issue is often caused by a misconfigured configuration directive in the `invokeai\invokeai.init` initialization file that contains startup settings. The easiest way to fix the problem is to move the file out of the way and re-run -`configure_invokeai.py`. Enter the developer's console (option 3 of the launcher +`invokeai-configure`. Enter the developer's console (option 3 of the launcher script) and run this command: ```cmd -configure_invokeai.py --root=. +invokeai-configure --root=. ``` Note the dot (.) after `--root`. It is part of the command. @@ -289,15 +288,15 @@ hours, and often much sooner. This distribution is changing rapidly, and we add new features on a daily basis. To update to the latest released version (recommended), run the `update.sh` (Linux/Mac) or `update.bat` (Windows) scripts. This will fetch the latest -release and re-run the `configure_invokeai` script to download any updated +release and re-run the `invokeai-configure` script to download any updated models files that may be needed. You can also use this to add additional models that you did not select at installation time. You can now close the developer console and run `invoke` as before. If you get complaints about missing models, then you may need to do the additional step of -running `configure_invokeai.py`. This happens relatively infrequently. To do +running `invokeai-configure`. This happens relatively infrequently. To do this, simply open up the developer's console again and type -`python scripts/configure_invokeai.py`. +`invokeai-configure`. You may also use the `update` script to install any selected version of InvokeAI. From https://github.com/invoke-ai/InvokeAI, navigate to the zip file diff --git a/docs/installation/020_INSTALL_MANUAL.md b/docs/installation/020_INSTALL_MANUAL.md index 1fad83121f..42ca8db0cb 100644 --- a/docs/installation/020_INSTALL_MANUAL.md +++ b/docs/installation/020_INSTALL_MANUAL.md @@ -135,10 +135,10 @@ manager, please follow these steps: default to `invokeai` in your home directory. ```bash - configure_invokeai --root_dir ~/Programs/invokeai + invokeai-configure --root_dir ~/Programs/invokeai ``` - The script `configure_invokeai.py` will interactively guide you through the + The script `invokeai-configure` will interactively guide you through the process of downloading and installing the weights files needed for InvokeAI. Note that the main Stable Diffusion weights file is protected by a license agreement that you have to agree to. The script will list the steps you need @@ -149,10 +149,10 @@ manager, please follow these steps: If you get an error message about a module not being installed, check that the `invokeai` environment is active and if not, repeat step 5. - Note that `configure_invokeai.py` and `invoke.py` should be installed + Note that `invokeai-configure` and `invoke.py` should be installed under your virtual environment directory and the system should find them on the PATH. If this isn't working on your system, you can call the - scripts directory using `python scripts/configure_invokeai.py` and + scripts directory using `python scripts/invokeai-configure` and `python scripts/invoke.py`. !!! tip @@ -353,10 +353,10 @@ manager, please follow these steps: default to `invokeai` in your home directory. ```bash - python scripts/configure_invokeai.py --root_dir ~/Programs/invokeai + python scripts/invokeai-configure --root_dir ~/Programs/invokeai ``` - The script `configure_invokeai.py` will interactively guide you through the + The script `invokeai-configure` will interactively guide you through the process of downloading and installing the weights files needed for InvokeAI. Note that the main Stable Diffusion weights file is protected by a license agreement that you have to agree to. The script will list the steps you need @@ -367,7 +367,7 @@ manager, please follow these steps: If you get an error message about a module not being installed, check that the `invokeai` environment is active and if not, repeat step 5. - Note that `configure_invokeai.py` and `invoke.py` should be + Note that `invokeai-configure` and `invoke.py` should be installed under your conda directory and the system should find them automatically on the PATH. If this isn't working on your system, you can call the scripts directory using `python @@ -468,7 +468,7 @@ greatest version, launch the Anaconda window, enter `InvokeAI` and type: ```bash git pull conda env update -python scripts/configure_invokeai.py --skip-sd-weights #optional +python scripts/invokeai-configure --skip-sd-weights #optional ``` This will bring your local copy into sync with the remote one. The last step may @@ -518,7 +518,7 @@ brew install llvm If brew config has Clang installed, update to the latest llvm and try creating the environment again. -#### `configure_invokeai.py` or `invoke.py` crashes at an early stage +#### `invokeai-configure` or `invoke.py` crashes at an early stage This is usually due to an incomplete or corrupted Conda install. Make sure you have linked to the correct environment file and run `conda update` again. diff --git a/docs/installation/050_INSTALLING_MODELS.md b/docs/installation/050_INSTALLING_MODELS.md index e4365e25ad..4c27b342f1 100644 --- a/docs/installation/050_INSTALLING_MODELS.md +++ b/docs/installation/050_INSTALLING_MODELS.md @@ -56,7 +56,7 @@ unofficial Stable Diffusion models and where they can be obtained. There are three ways to install weights files: -1. During InvokeAI installation, the `configure_invokeai.py` script can download +1. During InvokeAI installation, the `invokeai-configure` script can download them for you. 2. You can use the command-line interface (CLI) to import, configure and modify @@ -65,13 +65,13 @@ There are three ways to install weights files: 3. You can download the files manually and add the appropriate entries to `models.yaml`. -### Installation via `configure_invokeai.py` +### Installation via `invokeai-configure` -This is the most automatic way. Run `scripts/configure_invokeai.py` from the +This is the most automatic way. Run `invokeai-configure` from the console. It will ask you to select which models to download and lead you through the steps of setting up a Hugging Face account if you haven't done so already. -To start, run `python scripts/configure_invokeai.py` from within the InvokeAI: +To start, run `invokeai-configure` from within the InvokeAI: directory !!! example "" @@ -244,7 +244,7 @@ arabian-nights-1.0: | arabian-nights-1.0 | This is the name of the model that you will refer to from within the CLI and the WebGUI when you need to load and use the model. | | description | Any description that you want to add to the model to remind you what it is. | | weights | Relative path to the .ckpt weights file for this model. | -| config | This is the confusingly-named configuration file for the model itself. Use `./configs/stable-diffusion/v1-inference.yaml` unless the model happens to need a custom configuration, in which case the place you downloaded it from will tell you what to use instead. For example, the runwayML custom inpainting model requires the file `configs/stable-diffusion/v1-inpainting-inference.yaml`. This is already inclued in the InvokeAI distribution and is configured automatically for you by the `configure_invokeai.py` script. | +| config | This is the confusingly-named configuration file for the model itself. Use `./configs/stable-diffusion/v1-inference.yaml` unless the model happens to need a custom configuration, in which case the place you downloaded it from will tell you what to use instead. For example, the runwayML custom inpainting model requires the file `configs/stable-diffusion/v1-inpainting-inference.yaml`. This is already inclued in the InvokeAI distribution and is configured automatically for you by the `invokeai-configure` script. | | vae | If you want to add a VAE file to the model, then enter its path here. | | width, height | This is the width and height of the images used to train the model. Currently they are always 512 and 512. | diff --git a/installer/templates/invoke.bat.in b/installer/templates/invoke.bat.in index 6e5dfa2a55..b69b9b7433 100644 --- a/installer/templates/invoke.bat.in +++ b/installer/templates/invoke.bat.in @@ -28,8 +28,8 @@ IF /I "%restore%" == "1" ( echo Starting model merging script.. python .venv\Scripts\merge_models --gui %* ) ELSE IF /I "%restore%" == "5" ( - echo Running configure_invokeai.py... - python .venv\Scripts\configure_invokeai %* + echo Running invokeai-configure... + python .venv\Scripts\invokeai-configure %* ) ELSE IF /I "%restore%" == "6" ( echo Developer Console echo Python command is: diff --git a/installer/templates/update.bat.in b/installer/templates/update.bat.in index 517b12686e..00caa2d9b7 100644 --- a/installer/templates/update.bat.in +++ b/installer/templates/update.bat.in @@ -24,7 +24,7 @@ if "%arg%" neq "" ( set INVOKE_AI_SRC="https://github.com/invoke-ai/InvokeAI/archive/!INVOKE_AI_VERSION!.zip" set INVOKE_AI_DEP=https://raw.githubusercontent.com/invoke-ai/InvokeAI/!INVOKE_AI_VERSION!/environments-and-requirements/requirements-base.txt set INVOKE_AI_MODELS=https://raw.githubusercontent.com/invoke-ai/InvokeAI/$INVOKE_AI_VERSION/configs/INITIAL_MODELS.yaml - + call curl -I "%INVOKE_AI_DEP%" -fs >.tmp.out if %errorlevel% neq 0 ( echo '!INVOKE_AI_VERSION!' is not a known branch name or tag. Please check the version and try again. @@ -57,7 +57,7 @@ if %errorlevel% neq 0 ( exit /b ) -@rem call .venv\Scripts\python .venv\Scripts\configure_invokeai.py --root=. +@rem call .venv\Scripts\invokeai-configure --root=. @rem if %errorlevel% neq 0 ( @rem echo Configuration InvokeAI failed. See https://invoke-ai.github.io/InvokeAI/installation/INSTALL_AUTOMATED/#troubleshooting for suggestions. @@ -70,4 +70,3 @@ echo InvokeAI has been updated to '%INVOKE_AI_VERSION%' echo "Press any key to continue" pause endlocal - diff --git a/installer/templates/update.sh.in b/installer/templates/update.sh.in index 876ffc6bb3..f69a324575 100644 --- a/installer/templates/update.sh.in +++ b/installer/templates/update.sh.in @@ -15,7 +15,7 @@ if [ $# -ge 1 ] && [ "${1:0:2}" == "-h" ]; then fi INVOKE_AI_VERSION=${1:-latest} - + INVOKE_AI_SRC="https://github.com/invoke-ai/InvokeAI/archive/$INVOKE_AI_VERSION.zip" INVOKE_AI_DEP=https://raw.githubusercontent.com/invoke-ai/InvokeAI/$INVOKE_AI_VERSION/environments-and-requirements/requirements-base.txt INVOKE_AI_MODELS=https://raw.githubusercontent.com/invoke-ai/InvokeAI/$INVOKE_AI_VERSION/configs/INITIAL_MODELS.yaml @@ -56,6 +56,3 @@ _err_exit $? "The pip program failed to install InvokeAI's requirements." _err_exit $? "The pip program failed to install InvokeAI." echo InvokeAI updated to \'$INVOKE_AI_VERSION\' - -# ./.venv/bin/python .venv/bin/configure_invokeai.py --root . -# _err_exit $? "The configure script failed to run successfully." diff --git a/ldm/invoke/CLI.py b/ldm/invoke/CLI.py index 5c95aa80b7..bd661c0a3c 100644 --- a/ldm/invoke/CLI.py +++ b/ldm/invoke/CLI.py @@ -1103,11 +1103,11 @@ def write_commands(opt, file_path:str, outfilepath:str): def report_model_error(opt:Namespace, e:Exception): print(f'** An error occurred while attempting to initialize the model: "{str(e)}"') print('** This can be caused by a missing or corrupted models file, and can sometimes be fixed by (re)installing the models.') - response = input('Do you want to run configure_invokeai.py to select and/or reinstall models? [y] ') + response = input('Do you want to run invokeai-configure script to select and/or reinstall models? [y] ') if response.startswith(('n','N')): return - print('configure_invokeai is launching....\n') + print('invokeai-configure is launching....\n') # Match arguments that were set on the CLI # only the arguments accepted by the configuration script are parsed @@ -1115,7 +1115,7 @@ def report_model_error(opt:Namespace, e:Exception): config = ["--config", opt.conf] if opt.conf is not None else [] yes_to_all = os.environ.get('INVOKE_MODEL_RECONFIGURE') previous_args = sys.argv - sys.argv = [ 'configure_invokeai' ] + sys.argv = [ 'invokeai-configure' ] sys.argv.extend(root_dir) sys.argv.extend(config) if yes_to_all is not None: diff --git a/ldm/invoke/config/configure_invokeai.py b/ldm/invoke/config/configure_invokeai.py index 47c9f61d27..990b4e05ee 100755 --- a/ldm/invoke/config/configure_invokeai.py +++ b/ldm/invoke/config/configure_invokeai.py @@ -752,7 +752,7 @@ def initialize_rootdir(root:str,yes_to_all:bool=False): f.write(f'''# InvokeAI initialization file # This is the InvokeAI initialization file, which contains command-line default values. # Feel free to edit. If anything goes wrong, you can re-initialize this file by deleting -# or renaming it and then running configure_invokeai.py again. +# or renaming it and then running invokeai-configure again. # the --outdir option controls the default location of image files. --outdir="{outputs}"