diff --git a/README.md b/README.md index cf88a8e5..d493be61 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Discord Server](https://img.shields.io/discord/1014774730907209781?label=Discord)](https://discord.com/invite/u9yhsFmEkB) (for support, and development discussion) | [Troubleshooting guide for common problems](Troubleshooting.md) -️🔥🎉 **New!** Live Preview, More Samplers, In-Painting, Face Correction (GFPGAN) and Upscaling (RealESRGAN) have been added! +️🔥🎉 **New!** Task Queue, Negative Prompt, Live Preview, More Samplers, In-Painting, Face Correction (GFPGAN) and Upscaling (RealESRGAN) have been added! This distribution currently uses Stable Diffusion 1.4. Once the model for 1.5 becomes publicly available, the model in this distribution will be updated. @@ -17,6 +17,8 @@ This distribution currently uses Stable Diffusion 1.4. Once the model for 1.5 be - **Face Correction (GFPGAN) and Upscaling (RealESRGAN)** - **In-Painting** - **Live Preview**: See the image as the AI is drawing it +- **Task Queue**: Queue up all your ideas, without waiting for the current task to finish +- **Negative Prompt**: Specify aspects of the image to *remove*. - **Lots of Samplers:** ddim, plms, heun, euler, euler_a, dpm2, dpm2_a, lms - **Image Modifiers**: A library of *modifier tags* like *"Realistic"*, *"Pencil Sketch"*, *"ArtStation"* etc. Experiment with various styles quickly. - **New UI**: with cleaner design @@ -40,7 +42,7 @@ This distribution currently uses Stable Diffusion 1.4. Once the model for 1.5 be You do not need anything else. You do not need WSL, Docker or Conda. The installer will take care of it. # Installation -1. **Download** [for Windows](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.05/stable-diffusion-ui-win64.zip) or [for Linux](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.05/stable-diffusion-ui-linux.tar.xz). +1. **Download** [for Windows](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.16/stable-diffusion-ui-win64.zip) or [for Linux](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.16/stable-diffusion-ui-linux.tar.xz). 2. **Extract**: - For Windows: After unzipping the file, please move the `stable-diffusion-ui` folder to your `C:` (or any drive like D:, at the top root level), e.g. `C:\stable-diffusion-ui`. This will avoid a common problem with Windows (file path length limits). @@ -77,12 +79,17 @@ You can use Face Correction or Upscaling to improve the image further. ## Problems? Troubleshooting Please try the common [troubleshooting](Troubleshooting.md) steps. If that doesn't fix it, please ask on the [discord server](https://discord.com/invite/u9yhsFmEkB), or [file an issue](https://github.com/cmdr2/stable-diffusion-ui/issues). -# Advanced Settings -You can also set the configuration like `seed`, `width`, `height`, `num_outputs`, `num_inference_steps` and `guidance_scale` using the 'show' button next to 'Advanced settings'. +# Image Settings +You can also set the configuration like `seed`, `width`, `height`, `num_outputs`, `num_inference_steps` and `guidance_scale` using the 'show' button next to 'Image settings'. Use the same `seed` number to get the same image for a certain prompt. This is useful for refining a prompt without losing the basic image design. Enable the `random images` checkbox to get random images. ![Screenshot of advanced settings](media/config-v6.jpg?raw=true) + +# System Settings +The system settings are reachable via the cogwheel symbol on the top right. It can be used to configure whether all generated images should +saved be automically, or to tune the Stable Diffusion image generation. + ![Screenshot of advanced settings](media/system-settings-v2.jpg?raw=true) # Image Modifiers diff --git a/Troubleshooting.md b/Troubleshooting.md index cab1783e..1955a424 100644 --- a/Troubleshooting.md +++ b/Troubleshooting.md @@ -9,6 +9,11 @@ Additionally, a common reason for this error is that you're using an initial ima Also try generating smaller sized images. +## basicsr module not found +For Windows: Please download and extract basicsr from [here](https://github.com/cmdr2/stable-diffusion-ui/releases/download/v2.16/basicsr-win64.zip), and place the `basicsr` folder inside the `stable-diffusion-ui\stable-diffusion\env\lib\site-packages` folder. Then run the `Start Stable Diffusion UI.cmd` file again. + +For Linux: Please contact on the [discord server](https://discord.com/invite/u9yhsFmEkB). + ## No ldm found, or antlr4 or any other missing module, or ClobberError: This transaction has incompatible packages due to a shared path On Windows, please ensure that you had placed the `stable-diffusion-ui` folder after unzipping to the root of C: or D: (or any drive). For e.g. `C:\stable-diffusion-ui`. **Note:** This has to be done **before** you start the installation process. If you have already installed (and are facing this error), please delete the installed folder, and start fresh by unzipping and placing the folder at the top of your drive. @@ -44,3 +49,27 @@ After this, you can access the server at `http://localhost:1337` (where 1337 is Please ensure that you have an NVIDIA GPU and the latest [NVIDIA driver](http://www.nvidia.com/Download/index.aspx), and that you've installed [nvidia-container-toolkit](https://stackoverflow.com/a/58432877). Also, if you are using WSL (Windows), please ensure you have the latest WSL kernel by running `wsl --shutdown` and then `wsl --update`. (Thanks [AndrWeisR](https://github.com/AndrWeisR)) + +# For support queries +## Entering a conda environment in an existing installation +This will give you an activated conda environment in the terminal, so you can run commands and force-install any packages, if required. + +Users don't need to have the Anaconda Prompt installed to do this anymore, since the installer bundles a portable version of conda inside it. Just follow these steps. + +**Windows:** +1. Open the terminal: Press Win+R, type "cmd", and press "Run" +2. Type `cd C:\stable-diffusion-ui` and press enter (or wherever you've installed it) +3. Type `installer\Scripts\activate.bat` and press enter +4. Type `cd stable-diffusion` and press enter +5. Type `conda activate .\env` and press enter +6. Type `python --version` and press enter. You should see 3.8.5. + +**Windows:** +1. Open the terminal +2. Type `cd /path/to/stable-diffusion-ui` and press enter +3. Type `installer/bin/activate` and press enter +4. Type `cd stable-diffusion` and press enter +5. Type `conda activate ./env` and press enter +6. Type `python --version` and press enter. You should see 3.8.5. + +This will give you an activated conda environment. To confirm, type `python --version` and press enter. You should see 3.8.5. diff --git a/build.bat b/build.bat index d1bcaab7..96232c0a 100644 --- a/build.bat +++ b/build.bat @@ -8,6 +8,8 @@ set /p answer=Are you a developer of this project (Y/N)? if /i "%answer:~,1%" NEQ "Y" exit /b +@set PYTHONNOUSERSITE=1 + @mkdir dist\stable-diffusion-ui @echo "Downloading components for the installer.." @@ -15,11 +17,6 @@ if /i "%answer:~,1%" NEQ "Y" exit /b @call conda env create --prefix installer -f environment.yaml @call conda activate .\installer -@echo "Setting up startup scripts.." - -@mkdir installer\etc\conda\activate.d -@copy scripts\post_activate.bat installer\etc\conda\activate.d\ - @echo "Creating a distributable package.." @call conda install -c conda-forge -y conda-pack @@ -37,6 +34,7 @@ if /i "%answer:~,1%" NEQ "Y" exit /b @copy ..\..\LICENSE . @copy "..\..\CreativeML Open RAIL-M License" . @copy "..\..\How to install and run.txt" . +@echo. > scripts\install_status.txt @echo "Build ready. Zip the 'dist\stable-diffusion-ui' folder." diff --git a/build.sh b/build.sh index 04579d1f..577dcb8b 100755 --- a/build.sh +++ b/build.sh @@ -11,6 +11,8 @@ case $yn in * ) exit;; esac +export PYTHONNOUSERSITE=1 + mkdir -p dist/stable-diffusion-ui echo "Downloading components for the installer.." @@ -38,6 +40,7 @@ cp ../../scripts/start.sh . cp ../../LICENSE . cp "../../CreativeML Open RAIL-M License" . cp "../../How to install and run.txt" . +echo "" > scripts/install_status.txt chmod u+x start.sh diff --git a/scripts/Start Stable Diffusion UI.cmd b/scripts/Start Stable Diffusion UI.cmd index 4f67c7bf..8563f6b3 100644 --- a/scripts/Start Stable Diffusion UI.cmd +++ b/scripts/Start Stable Diffusion UI.cmd @@ -1 +1,19 @@ -installer\Scripts\activate.bat +@echo off + +@REM Delete the post-activate hook from the old installer +if exist "installer\etc\conda\activate.d\post_activate.bat" ( + echo. > installer\etc\conda\activate.d\post_activate.bat +) + +@call installer\Scripts\activate.bat + +@call conda-unpack + +@call conda --version +@call git --version + +@cd installer + +@call ..\scripts\on_env_start.bat + +@pause diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index b8ef042b..34ccdf83 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -165,13 +165,13 @@ call WHERE uvicorn > .tmp @if exist "sd-v1-4.ckpt" ( for %%I in ("sd-v1-4.ckpt") do if "%%~zI" EQU "4265380512" ( - echo "Data files (weights) necessary for Stable Diffusion were already downloaded" + echo "Data files (weights) necessary for Stable Diffusion were already downloaded. Using the HuggingFace 4 GB Model." ) else ( for %%J in ("sd-v1-4.ckpt") do if "%%~zJ" EQU "7703807346" ( - echo "Data files (weights) necessary for Stable Diffusion were already downloaded" + echo "Data files (weights) necessary for Stable Diffusion were already downloaded. Using the HuggingFace 7 GB Model." ) else ( for %%K in ("sd-v1-4.ckpt") do if "%%~zK" EQU "7703810927" ( - echo "Data files (weights) necessary for Stable Diffusion were already downloaded" + echo "Data files (weights) necessary for Stable Diffusion were already downloaded. Using the Waifu Model." ) else ( echo. & echo "The model file present at %cd%\sd-v1-4.ckpt is invalid. It is only %%~zK bytes in size. Re-downloading.." & echo. del "sd-v1-4.ckpt" diff --git a/scripts/start.sh b/scripts/start.sh index d6c75ad8..e077593a 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -4,4 +4,7 @@ source installer/bin/activate conda-unpack +conda --version +git --version + scripts/on_env_start.sh diff --git a/ui/index.html b/ui/index.html index f8e5f6ec..93423eb6 100644 --- a/ui/index.html +++ b/ui/index.html @@ -8,7 +8,7 @@ - + @@ -19,7 +19,7 @@