From 616e3a2f829f7c5432c033eb1d1b7ca42325551c Mon Sep 17 00:00:00 2001 From: Anonymous <> Date: Fri, 28 Jul 2023 16:31:59 +0100 Subject: [PATCH] Add installation guide --- src/gui/options/options.js | 4 +- .../stableDiffusionInstallationGuide.js | 59 +++++++++++++++++++ 2 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 src/gui/options/stableDiffusionInstallationGuide.js diff --git a/src/gui/options/options.js b/src/gui/options/options.js index e67062537a7..6318ebdb0c5 100644 --- a/src/gui/options/options.js +++ b/src/gui/options/options.js @@ -1225,7 +1225,8 @@ App.UI.artOptions = function() { } else if (V.imageChoice === 2) { option.addComment("This art development is dead since vanilla. Since it is not embedded, requires a separate art pack to be downloaded."); } else if (V.imageChoice === 6) { - options.addComment("This is highly experimental. If you're reading this, tell me to replace it with instructions on how to set up Stable Diffusion."); + options.addComment("This is highly experimental. Please follow the setup instructions below."); + options.addCustom(App.UI.DOM.stableDiffusionInstallationGuide("Stable Diffusion Installation Guide")); options.addOption("API URL", "aiApiUrl").showTextBox().addComment("The URL of the Automatic 1111 Stable Diffusion API."); } @@ -1240,7 +1241,6 @@ App.UI.artOptions = function() { } } - el.append(options.render()); return el; }; diff --git a/src/gui/options/stableDiffusionInstallationGuide.js b/src/gui/options/stableDiffusionInstallationGuide.js new file mode 100644 index 00000000000..867ad2b8ebd --- /dev/null +++ b/src/gui/options/stableDiffusionInstallationGuide.js @@ -0,0 +1,59 @@ +const html = ` +<h1>What is Stable Diffusion and Automatic1111's Stable Diffusion WebUI?</h1> +Stable Diffusion is an AI model for generating images given a text prompt. Automatic1111's Stable Diffusion WebUI is a web interface for running Stable Diffusion. It is the easiest way to run Stable Diffusion on your computer, and provides an API that we can use to integrate Stable Diffusion into other applications. + +<h1>Steps</h1> +<ol> + <li>Install Automatic1111's Stable Diffusion WebUI</li> + <li>Download the relevant models</li> + <li>Place the models in their corresponding directories</li> + <li>Configure Automatic1111's Stable Diffusion WebUI</li> + <li>Running the WebUI</li> + <li>Confirm successful setup</li> +</ol> + +<h2>2. Install Automatic1111's Stable Diffusion WebUI</h2> +<p>Before we start, you need to install the Stable Diffusion WebUI. To do this, follow the detailed instructions for installation on Windows, Linux, and Mac on the <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui#installation-and-running">Stable Diffusion WebUI GitHub page</a>.</p> + +<h2>3. Download the relevant models</h2> +<p>You will now need to download the following models:</p> +<ul> + <li><a href="https://civitai.com/models/43331?modelVersionId=94640">MajicMix v6</a></li> + <li><a href="https://civitai.com/models/48139?modelVersionId=63006">LowRA v2</a></li> + <li><a href="https://civitai.com/models/33208?modelVersionId=112969">Film Velvia v3</a></li> +</ul> + +<h2>4. Place the models in their corresponding directories</h2> +<p>Next, you need to place the models in the appropriate directories in the Stable Diffusion WebUI:</p> +<ul> + <li>Place MajicMix v6 in <code>stable-diffusion-webui/models/Stable-diffusion</code></li> + <li>Place LowRA v2 and Film Velvia v3 in <code>stable-diffusion-webui/models/Lora</code></li> +</ul> + +<h2>5. Configure Automatic1111's Stable Diffusion WebUI</h2> +<p>To prepare the WebUI for running, you need to modify the <code>COMMANDLINE_ARGS</code> line in either <code>webui-user.sh</code> (if you're using Linux/Mac) or <code>webui-user.bat</code> (if you're using Windows) to include the following:</p> +<p>Linux/Mac:</p> +<pre><code>export COMMANDLINE_ARGS="--medvram --no-half-vae --listen --port=7860 --api --cors-allow-origins *"</code></pre> +<p>Windows:</p> +<pre><code>set COMMANDLINE_ARGS=--medvram --no-half-vae --listen --port=7860 --api --cors-allow-origins *</code></pre> + +<h2>6. Running the WebUI</h2> +<p>Now you can run the WebUI by executing either <code>webui.sh</code> (Linux/Mac) or <code>webui.bat</code> (Windows). Note that the WebUI server needs to be running the whole time you're using it.</p> + +<h2>7. Check it works</h2> +<p>At this point, if you go to a slave's detail page their image should load after a short (<30 seconds) delay. If it doesn't seem to be working, have a look at the terminal window running Automatic1111's Stable Diffusion WebUI to see if there are any errors.</p> +`; + +/** + * Generates a link which shows a Stable Diffusion installation guide. + * @param {string} [text] link text to use + * @returns {HTMLElement} link + */ +App.UI.DOM.stableDiffusionInstallationGuide = function(text) { + return App.UI.DOM.link(text ? text : "Stable Diffusion Installation Guide", () => { + Dialog.setup("Stable Diffusion Installation Guide"); + const content = document.createElement("div").innerHTML = html; + Dialog.append(content); + Dialog.open(); + }); +}; -- GitLab