From cbe91251ac39dc2df7993837f6eb89830bfd808c Mon Sep 17 00:00:00 2001 From: Guillaume Mercier Date: Wed, 7 Dec 2022 00:54:16 -0500 Subject: [PATCH] Hypernetwork support (#619) * Update README.md * Update README.md * Make on_sd_start.sh executable * Merge pull request #542 from patriceac/patch-1 Fix restoration of model and VAE * Merge pull request #541 from patriceac/patch-2 Fix restoration of parallel output setting * Hypernetwork support Adds support for hypernetworks. Hypernetworks are stored in /models/hypernetworks * forgot to remove unused code Co-authored-by: cmdr2 --- README.md | 4 + scripts/on_sd_start.bat | 2 + scripts/on_sd_start.sh | 2 + ui/index.html | 6 + ui/media/js/auto-save.js | 2 + ui/media/js/main.js | 37 +++++- ui/sd_internal/__init__.py | 7 ++ ui/sd_internal/hypernetwork.py | 198 +++++++++++++++++++++++++++++++++ ui/sd_internal/runtime.py | 54 +++++++++ ui/sd_internal/task_manager.py | 21 +++- ui/server.py | 20 +++- 11 files changed, 346 insertions(+), 7 deletions(-) create mode 100644 ui/sd_internal/hypernetwork.py diff --git a/README.md b/README.md index 2038c15b..01509a46 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@ [![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! Experimental support for Stable Diffusion 2.0 is available in beta! + ---- ## Step 1: Download the installer @@ -28,7 +30,9 @@ The installer will take care of whatever is needed. A friendly [Discord communit - **No Dependencies or Technical Knowledge Required**: 1-click install for Windows 10/11 and Linux. *No dependencies*, no need for WSL or Docker or Conda or technical setup. Just download and run! - **Clutter-free UI**: a friendly and simple UI, while providing a lot of powerful features - Supports "*Text to Image*" and "*Image to Image*" +- **Stable Diffusion 2.0 support (experimental)** - available in beta channel - **Custom Models**: Use your own `.ckpt` file, by placing it inside the `models/stable-diffusion` folder! +- **Auto scan for malicious models** - uses picklescan to prevent malicious models - **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 - **In-Painting**: Specify areas of your image to paint into diff --git a/scripts/on_sd_start.bat b/scripts/on_sd_start.bat index 99fb74bc..2daa39e2 100644 --- a/scripts/on_sd_start.bat +++ b/scripts/on_sd_start.bat @@ -201,8 +201,10 @@ call WHERE uvicorn > .tmp if not exist "..\models\stable-diffusion" mkdir "..\models\stable-diffusion" if not exist "..\models\vae" mkdir "..\models\vae" +if not exist "..\models\hypernetwork" mkdir "..\models\hypernetwork" echo. > "..\models\stable-diffusion\Put your custom ckpt files here.txt" echo. > "..\models\vae\Put your VAE files here.txt" +echo. > "..\models\hypernetwork\Put your hypernetwork files here.txt" @if exist "sd-v1-4.ckpt" ( for %%I in ("sd-v1-4.ckpt") do if "%%~zI" EQU "4265380512" ( diff --git a/scripts/on_sd_start.sh b/scripts/on_sd_start.sh index 177e4f73..f8f3d560 100755 --- a/scripts/on_sd_start.sh +++ b/scripts/on_sd_start.sh @@ -161,8 +161,10 @@ fi mkdir -p "../models/stable-diffusion" mkdir -p "../models/vae" +mkdir -p "../models/hypernetwork" echo "" > "../models/stable-diffusion/Put your custom ckpt files here.txt" echo "" > "../models/vae/Put your VAE files here.txt" +echo "" > "../models/hypernetwork/Put your hypernetwork files here.txt" if [ -f "sd-v1-4.ckpt" ]; then model_size=`find "sd-v1-4.ckpt" -printf "%s"` diff --git a/ui/index.html b/ui/index.html index 50869fc7..d3fb6da3 100644 --- a/ui/index.html +++ b/ui/index.html @@ -131,6 +131,12 @@ Click to learn more about VAEs + + + +