提交 edbbb638 编写于 作者: W weixin_44463441

Auto Commit

上级 e56812f9
...@@ -27,3 +27,4 @@ coverage ...@@ -27,3 +27,4 @@ coverage
*.njsproj *.njsproj
*.sln *.sln
*.sw? *.sw?
test
run = "npm i && python3 -m http.server --directory /root/sd-docs/sd/ 8080" run = "npm i && python3 -m http.server --directory /root/sd-docs/sd2/ 8080"
[deployment] [deployment]
build = "npm i && npm run build" build = "npm i && npm run build"
run = "python3 -m http.server --directory /root/sd-docs/sd/ 8080" run = "python3 -m http.server --directory /root/sd-docs/sd2/ 8080"
[env] [env]
PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}" PATH = "/root/${PROJECT_DIR}/.config/npm/node_global/bin:/root/${PROJECT_DIR}/node_modules/.bin:${PATH}"
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>API.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h2>API guide by <a href="https://github.com/Kilvoctu">@Kilvoctu</a></h2>
<ul>
<li>First, of course, is to run web ui with <code>--api</code> commandline argument
<ul>
<li>example in your “webui-user.bat”: <code>set COMMANDLINE_ARGS=--api</code></li>
</ul>
</li>
<li>This enables the api which can be reviewed at <a href="http://127.0.0.1:7860/docs">http://127.0.0.1:7860/docs</a> (or whever the URL is + /docs)
The basic ones I’m interested in are these two. Let’s just focus only on <code>/sdapi/v1/txt2img</code></li>
</ul>
<figure><img src="https://user-images.githubusercontent.com/2993060/198171114-ed1c5edd-76ce-4c34-ad73-04e388423162.png" alt="image"></figure>
<ul>
<li>When you expand that tab, it gives an example of a payload to send to the API. I used this often as reference.</li>
</ul>
<figure><img src="https://user-images.githubusercontent.com/2993060/198171454-5b826ded-5e73-4249-9c0c-a97b32c42569.png" alt="image"></figure>
<hr>
<ul>
<li>So that’s the backend. The API basically says what’s available, what it’s asking for, and where to send it. Now moving onto the frontend, I’ll start with constructing a payload with the parameters I want. An example can be:</li>
</ul>
<pre><code class="language-py">payload = {
<span class="hljs-string">"prompt"</span>: <span class="hljs-string">"maltese puppy"</span>,
<span class="hljs-string">"steps"</span>: <span class="hljs-number">5</span>
}
</code></pre>
<p>I can put in as few or as many parameters as I want in the payload. The API will use the defaults for anything I don’t set.</p>
<ul>
<li>After that, I can send it to the API</li>
</ul>
<pre><code class="language-py">response = requests.post(url=<span class="hljs-string">f'http://127.0.0.1:7860/sdapi/v1/txt2img'</span>, json=payload)
</code></pre>
<p>Again, this URL needs to match the web ui’s URL.
If we execute this code, the web ui will generate an image based on the payload. That’s great, but then what? There is no image anywhere…</p>
<hr>
<ul>
<li>After the backend does its thing, the API sends the response back in a variable that was assigned above: <code>response</code>. The response contains three entries; “images”, “parameters”, and “info”, and I have to find some way to get the information from these entries.</li>
<li>First, I put this line <code>r = response.json()</code> to make it easier to work with the response.</li>
<li>“images” is the generated image, which is what I want mostly. There’s no link or anything; it’s a giant string of random characters, apparently we have to decode it. This is how I do it:</li>
</ul>
<pre><code class="language-py"><span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> r[<span class="hljs-string">'images'</span>]:
image = Image.open(io.BytesIO(base64.b64decode(i.split(<span class="hljs-string">","</span>,<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])))
</code></pre>
<ul>
<li>With that, we have an image in the <code>image</code> variable that we can work with, for example saving it with <code>image.save('output.png')</code>.</li>
<li>“parameters” shows what was sent to the API, which could be useful, but what I want in this case is “info”. I use it to insert metadata into the image, so I can drop it into web ui PNG Info. For that, I can access the <code>/sdapi/v1/png-info</code> API. I’ll need to feed the image I got above into it.</li>
</ul>
<pre><code class="language-py">png_payload = {
<span class="hljs-string">"image"</span>: <span class="hljs-string">"data:image/png;base64,"</span> + i
}
response2 = requests.post(url=<span class="hljs-string">f'http://127.0.0.1:7860/sdapi/v1/png-info'</span>, json=png_payload)
</code></pre>
<p>After that, I can get the information with <code>response2.json().get(&quot;info&quot;)</code></p>
<hr>
<p>A sample code that should work can look like this:</p>
<pre><code class="language-py"><span class="hljs-keyword">import</span> json
<span class="hljs-keyword">import</span> requests
<span class="hljs-keyword">import</span> io
<span class="hljs-keyword">import</span> base64
<span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image, PngImagePlugin
url = <span class="hljs-string">"http://127.0.0.1:7860"</span>
payload = {
<span class="hljs-string">"prompt"</span>: <span class="hljs-string">"puppy dog"</span>,
<span class="hljs-string">"steps"</span>: <span class="hljs-number">5</span>
}
response = requests.post(url=<span class="hljs-string">f'<span class="hljs-subst">{url}</span>/sdapi/v1/txt2img'</span>, json=payload)
r = response.json()
<span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> r[<span class="hljs-string">'images'</span>]:
image = Image.open(io.BytesIO(base64.b64decode(i.split(<span class="hljs-string">","</span>,<span class="hljs-number">1</span>)[<span class="hljs-number">0</span>])))
png_payload = {
<span class="hljs-string">"image"</span>: <span class="hljs-string">"data:image/png;base64,"</span> + i
}
response2 = requests.post(url=<span class="hljs-string">f'<span class="hljs-subst">{url}</span>/sdapi/v1/png-info'</span>, json=png_payload)
pnginfo = PngImagePlugin.PngInfo()
pnginfo.add_text(<span class="hljs-string">"parameters"</span>, response2.json().get(<span class="hljs-string">"info"</span>))
image.save(<span class="hljs-string">'output.png'</span>, pnginfo=pnginfo)
</code></pre>
<ul>
<li>Import the things I need</li>
<li>define the url and the payload to send</li>
<li>send said payload to said url through the API</li>
<li>in a loop grab “images” and decode it</li>
<li>for each image, send it to png info API and get that info back</li>
<li>define a plugin to add png info, then add the png info I defined into it</li>
<li>at the end here, save the image with the png info</li>
</ul>
<hr>
<p>A note on <code>&quot;override_settings&quot;</code>.
The purpose of this endpoint is to override the web ui settings for a single request, such as the CLIP skip. The settings that can be passed into this parameter are visible here at the url’s /docs.</p>
<figure><img src="https://user-images.githubusercontent.com/2993060/202877368-c31a6e9e-0d05-40ec-ade0-49ed2c4be22b.png" alt="image"></figure>
<p>You can expand the tab and the API will provide a list. There are a few ways you can add this value to your payload, but this is how I do it. I’ll demonstrate with “filter_nsfw”, and “CLIP_stop_at_last_layers”.</p>
<pre><code class="language-py">payload = {
<span class="hljs-string">"prompt"</span>: <span class="hljs-string">"cirno"</span>,
<span class="hljs-string">"steps"</span>: <span class="hljs-number">20</span>
}
override_settings = {}
override_settings[<span class="hljs-string">"filter_nsfw"</span>] = true
override_settings[<span class="hljs-string">"CLIP_stop_at_last_layers"</span>] = <span class="hljs-number">2</span>
override_payload = {
<span class="hljs-string">"override_settings"</span>: override_settings
}
payload.update(override_payload)
</code></pre>
<ul>
<li>Have the normal payload</li>
<li>after that, initialize a dictionary (I call it “override_settings”, but maybe not the best name)</li>
<li>then I can add as many key:value pairs as I want to it</li>
<li>make a new payload with just this parameter</li>
<li>update the original payload to add this one to it</li>
</ul>
<p>So in this case, when I send the payload, I should get a “cirno” at 20 steps, with the CLIP skip at 2, as well as the NSFW filter on.</p>
<p>For certain settings or situations, you may want your changes to stay. For that you can post to the <code>/sdapi/v1/options</code> API endpoint
We can use what we learned so far and set up the code easily for this. Here is an example:</p>
<pre><code class="language-py">url = <span class="hljs-string">"http://127.0.0.1:7860"</span>
option_payload = {
<span class="hljs-string">"sd_model_checkpoint"</span>: <span class="hljs-string">"Anything-V3.0-pruned.ckpt [2700c435]"</span>,
<span class="hljs-string">"CLIP_stop_at_last_layers"</span>: <span class="hljs-number">2</span>
}
response = requests.post(url=<span class="hljs-string">f'<span class="hljs-subst">{url}</span>/sdapi/v1/options'</span>, json=option_payload)
</code></pre>
<p>After sending this payload to the API, the model should swap to the one I set and set the CLIP skip to 2. Reiterating, this is different from “override_settings”, because this change will persist, while “override_settings” is for a single request.
Note that if you’re changing the <code>sd_model_checkpoint</code>, the value should be the name of the checkpoint as it appears in the web ui. This can be referenced with this API endpoint (same way we reference “options” API)</p>
<figure><img src="https://user-images.githubusercontent.com/2993060/202928589-114aff91-2777-4269-9492-2eab015c5bca.png" alt="image"></figure>
<p>The “title” (name and hash) is what you want to use.</p>
<hr>
<p>This is as of commit <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/47a44c7e421b98ca07e92dbf88769b04c9e28f86">47a44c7</a></p>
<p>For a more complete implementation of a frontend, my Discord bot is <a href="https://github.com/Kilvoctu/aiyabot">here</a> if anyone wants to look at it as an example. Most of the action happens in <a href="http://stablecog.py">stablecog.py</a>. There are many comments explaining what each code does.</p>
<hr>
<p>This guide can be found in <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/3734">discussions</a> page.</p>
<p>Also, check out this python API client library for webui: <a href="https://github.com/mix1009/sdwebuiapi">https://github.com/mix1009/sdwebuiapi</a>
Using custom scripts/extensions example: <a href="https://github.com/mix1009/sdwebuiapi/commit/fe269dc2d4f8a98e96c63c8a7d3b5f039625bc18">here</a></p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
## API guide by [@Kilvoctu](https://github.com/Kilvoctu)
- First, of course, is to run web ui with `--api` commandline argument
- example in your "webui-user.bat": `set COMMANDLINE_ARGS=--api`
- This enables the api which can be reviewed at http://127.0.0.1:7860/docs (or whever the URL is + /docs)
The basic ones I'm interested in are these two. Let's just focus only on ` /sdapi/v1/txt2img`
![image](https://user-images.githubusercontent.com/2993060/198171114-ed1c5edd-76ce-4c34-ad73-04e388423162.png)
- When you expand that tab, it gives an example of a payload to send to the API. I used this often as reference.
![image](https://user-images.githubusercontent.com/2993060/198171454-5b826ded-5e73-4249-9c0c-a97b32c42569.png)
------
- So that's the backend. The API basically says what's available, what it's asking for, and where to send it. Now moving onto the frontend, I'll start with constructing a payload with the parameters I want. An example can be:
```py
payload = {
"prompt": "maltese puppy",
"steps": 5
}
```
I can put in as few or as many parameters as I want in the payload. The API will use the defaults for anything I don't set.
- After that, I can send it to the API
```py
response = requests.post(url=f'http://127.0.0.1:7860/sdapi/v1/txt2img', json=payload)
```
Again, this URL needs to match the web ui's URL.
If we execute this code, the web ui will generate an image based on the payload. That's great, but then what? There is no image anywhere...
------
- After the backend does its thing, the API sends the response back in a variable that was assigned above: `response`. The response contains three entries; "images", "parameters", and "info", and I have to find some way to get the information from these entries.
- First, I put this line `r = response.json()` to make it easier to work with the response.
- "images" is the generated image, which is what I want mostly. There's no link or anything; it's a giant string of random characters, apparently we have to decode it. This is how I do it:
```py
for i in r['images']:
image = Image.open(io.BytesIO(base64.b64decode(i.split(",",1)[0])))
```
- With that, we have an image in the `image` variable that we can work with, for example saving it with `image.save('output.png')`.
- "parameters" shows what was sent to the API, which could be useful, but what I want in this case is "info". I use it to insert metadata into the image, so I can drop it into web ui PNG Info. For that, I can access the `/sdapi/v1/png-info` API. I'll need to feed the image I got above into it.
```py
png_payload = {
"image": "data:image/png;base64," + i
}
response2 = requests.post(url=f'http://127.0.0.1:7860/sdapi/v1/png-info', json=png_payload)
```
After that, I can get the information with `response2.json().get("info")`
------
A sample code that should work can look like this:
```py
import json
import requests
import io
import base64
from PIL import Image, PngImagePlugin
url = "http://127.0.0.1:7860"
payload = {
"prompt": "puppy dog",
"steps": 5
}
response = requests.post(url=f'{url}/sdapi/v1/txt2img', json=payload)
r = response.json()
for i in r['images']:
image = Image.open(io.BytesIO(base64.b64decode(i.split(",",1)[0])))
png_payload = {
"image": "data:image/png;base64," + i
}
response2 = requests.post(url=f'{url}/sdapi/v1/png-info', json=png_payload)
pnginfo = PngImagePlugin.PngInfo()
pnginfo.add_text("parameters", response2.json().get("info"))
image.save('output.png', pnginfo=pnginfo)
```
- Import the things I need
- define the url and the payload to send
- send said payload to said url through the API
- in a loop grab "images" and decode it
- for each image, send it to png info API and get that info back
- define a plugin to add png info, then add the png info I defined into it
- at the end here, save the image with the png info
-----
A note on `"override_settings"`.
The purpose of this endpoint is to override the web ui settings for a single request, such as the CLIP skip. The settings that can be passed into this parameter are visible here at the url's /docs.
![image](https://user-images.githubusercontent.com/2993060/202877368-c31a6e9e-0d05-40ec-ade0-49ed2c4be22b.png)
You can expand the tab and the API will provide a list. There are a few ways you can add this value to your payload, but this is how I do it. I'll demonstrate with "filter_nsfw", and "CLIP_stop_at_last_layers".
```py
payload = {
"prompt": "cirno",
"steps": 20
}
override_settings = {}
override_settings["filter_nsfw"] = true
override_settings["CLIP_stop_at_last_layers"] = 2
override_payload = {
"override_settings": override_settings
}
payload.update(override_payload)
```
- Have the normal payload
- after that, initialize a dictionary (I call it "override_settings", but maybe not the best name)
- then I can add as many key:value pairs as I want to it
- make a new payload with just this parameter
- update the original payload to add this one to it
So in this case, when I send the payload, I should get a "cirno" at 20 steps, with the CLIP skip at 2, as well as the NSFW filter on.
For certain settings or situations, you may want your changes to stay. For that you can post to the `/sdapi/v1/options` API endpoint
We can use what we learned so far and set up the code easily for this. Here is an example:
```py
url = "http://127.0.0.1:7860"
option_payload = {
"sd_model_checkpoint": "Anything-V3.0-pruned.ckpt [2700c435]",
"CLIP_stop_at_last_layers": 2
}
response = requests.post(url=f'{url}/sdapi/v1/options', json=option_payload)
```
After sending this payload to the API, the model should swap to the one I set and set the CLIP skip to 2. Reiterating, this is different from "override_settings", because this change will persist, while "override_settings" is for a single request.
Note that if you're changing the `sd_model_checkpoint`, the value should be the name of the checkpoint as it appears in the web ui. This can be referenced with this API endpoint (same way we reference "options" API)
![image](https://user-images.githubusercontent.com/2993060/202928589-114aff91-2777-4269-9492-2eab015c5bca.png)
The "title" (name and hash) is what you want to use.
-----
This is as of commit [47a44c7](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/47a44c7e421b98ca07e92dbf88769b04c9e28f86)
For a more complete implementation of a frontend, my Discord bot is [here](https://github.com/Kilvoctu/aiyabot) if anyone wants to look at it as an example. Most of the action happens in stablecog.py. There are many comments explaining what each code does.
------
This guide can be found in [discussions](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/3734) page.
Also, check out this python API client library for webui: https://github.com/mix1009/sdwebuiapi
Using custom scripts/extensions example: [here](https://github.com/mix1009/sdwebuiapi/commit/fe269dc2d4f8a98e96c63c8a7d3b5f039625bc18)
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Change-model-folder-location.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>Sometimes it might be useful to move your models to another location. Reasons for this could be:</p>
<ul>
<li>Main disk has low disk space</li>
<li>You are using models in multiple tools and don’t want to store them twice</li>
</ul>
<p>The default model folder is <code>stable-diffusion-webui/models</code></p>
<h2>macOS Finder</h2>
<ul>
<li>Open in Finder two windows e.g. <code>stable-diffusion-webui/models/Stable-diffusion</code> and the folder where your models are located.</li>
<li>Press <kbd>option ⌥</kbd> + <kbd>command ⌘</kbd> while dragging your model from the model folder to the target folder</li>
<li>This will make an alias instead of moving the models</li>
</ul>
<h2>Command line</h2>
<ul>
<li>Let’s assume your model <code>openjourney-v4.ckpt</code> is stored in <code>~/ai/models/</code></li>
<li>Now we make a symbolic link (i.e. alias) to this model</li>
<li>Open your terminal and navigate to your Stable Diffusion model folder e.g. <code>cd ~/stable-diffusion-webui/models/Stable-diffusion</code></li>
<li>Make a symbolic link to your model with <code>ln -sf ~/ai/models/openjourney-v4.ckpt</code></li>
</ul>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
Sometimes it might be useful to move your models to another location. Reasons for this could be:
- Main disk has low disk space
- You are using models in multiple tools and don't want to store them twice
The default model folder is `stable-diffusion-webui/models`
## macOS Finder
- Open in Finder two windows e.g. `stable-diffusion-webui/models/Stable-diffusion` and the folder where your models are located.
- Press <kbd>option ⌥</kbd> + <kbd>command ⌘</kbd> while dragging your model from the model folder to the target folder
- This will make an alias instead of moving the models
## Command line
- Let's assume your model `openjourney-v4.ckpt` is stored in `~/ai/models/`
- Now we make a symbolic link (i.e. alias) to this model
- Open your terminal and navigate to your Stable Diffusion model folder e.g. `cd ~/stable-diffusion-webui/models/Stable-diffusion`
- Make a symbolic link to your model with `ln -sf ~/ai/models/openjourney-v4.ckpt`
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>All command line arguments</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h2>Environment variables</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>PYTHON</td>
<td>Sets a custom path for Python executable.</td>
</tr>
<tr>
<td>VENV_DIR</td>
<td>Specifies the path for the virtual environment. Default is <code>venv</code>. Special value <code>-</code> runs the script without creating virtual environment.</td>
</tr>
<tr>
<td>COMMANDLINE_ARGS</td>
<td>Additional commandline arguments for the main program.</td>
</tr>
<tr>
<td>IGNORE_CMD_ARGS_ERRORS</td>
<td>Set to anything to make the program not exit with an error if an unexpected commandline argument is encountered.</td>
</tr>
<tr>
<td>REQS_FILE</td>
<td>Name of <code>requirements.txt</code> file with dependencies that will be installed when <code>launch.py</code> is run. Defaults to <code>requirements_versions.txt</code>.</td>
</tr>
<tr>
<td>TORCH_COMMAND</td>
<td>Command for installing PyTorch.</td>
</tr>
<tr>
<td>INDEX_URL</td>
<td><code>--index-url</code> parameter for pip.</td>
</tr>
<tr>
<td>TRANSFORMERS_CACHE</td>
<td>Path to where transformers library will download and keep its files related to the CLIP model.</td>
</tr>
<tr>
<td>CUDA_VISIBLE_DEVICES</td>
<td>Select GPU to use for your instance on a system with multiple GPUs. For example, if you want to use secondary GPU, put “1”.<br>(add a new line to webui-user.bat not in COMMANDLINE_ARGS): <code>set CUDA_VISIBLE_DEVICES=0</code><br>Alternatively, just use <code>--device-id</code> flag in <code>COMMANDLINE_ARGS</code>.</td>
</tr>
</tbody>
</table>
<h3>webui-user</h3>
<p>The recommended way to specify environment variables is by editing <code>webui-user.bat</code> (Windows) and <code>webui-user.sh</code> (Linux):</p>
<ul>
<li><code>set VARNAME=VALUE</code> for Windows</li>
<li><code>export VARNAME=&quot;VALUE&quot;</code> for Linux</li>
</ul>
<p>For example, in Windows:</p>
<pre><code>set COMMANDLINE_ARGS=--allow-code --xformers --skip-torch-cuda-test --no-half-vae --api --ckpt-dir A:\\stable-diffusion-checkpoints
</code></pre>
<h3>Running online</h3>
<p>Use the <code>--share</code> option to run online. You will get a xxx.app.gradio link. This is the intended way to use the program in colabs. You may set up authentication for said gradio shared instance with the flag <code>--gradio-auth username:password</code>, optionally providing multiple sets of usernames and passwords separated by commas.</p>
<h3>Running within Local Area Network</h3>
<p>Use <code>--listen</code> to make the server listen to network connections. This will allow computers on the local network to access the UI, and if you configure port forwarding, also computers on the internet. Example address: <code>http://192.168.1.3:7860</code>
Where your “192.168.1.3” is the local IP address.</p>
<p>Use <code>--port xxxx</code> to make the server listen on a specific port, xxxx being the wanted port. Remember that all ports below 1024 need root/admin rights, for this reason it is advised to use a port above 1024. Defaults to port 7860 if available.</p>
<h3>Running on CPU</h3>
<p>Running with only your CPU is possible, but not recommended.
It is very slow and there is no fp16 implementation.</p>
<p>To run, you must have all these flags enabled: <code>--use-cpu all --precision full --no-half --skip-torch-cuda-test</code></p>
<p>Though this is a questionable way to run webui, due to the very slow generation speeds; using the various AI upscalers and captioning tools may be useful to some people.</p>
<details><summary>Extras: </summary>
<p>For the technically inclined, here are some steps a user provided to boost CPU performance:</p>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10514">https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10514</a></p>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10516">https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10516</a></p>
</details>
<h1>All command line arguments</h1>
<table>
<thead>
<tr>
<th>Argument Command</th>
<th>Value</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>CONFIGURATION</strong></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>-h, --help</td>
<td>None</td>
<td>False</td>
<td>Show this help message and exit.</td>
</tr>
<tr>
<td>–exit</td>
<td></td>
<td></td>
<td>Terminate after installation</td>
</tr>
<tr>
<td>–data-dir</td>
<td>DATA_DIR</td>
<td>./</td>
<td>base path where all user data is stored</td>
</tr>
<tr>
<td>–config</td>
<td>CONFIG</td>
<td>configs/stable-diffusion/v1-inference.yaml</td>
<td>Path to config which constructs model.</td>
</tr>
<tr>
<td>–ckpt</td>
<td>CKPT</td>
<td>model.ckpt</td>
<td>Path to checkpoint of Stable Diffusion model; if specified, this checkpoint will be added to the list of checkpoints and loaded.</td>
</tr>
<tr>
<td>–ckpt-dir</td>
<td>CKPT_DIR</td>
<td>None</td>
<td>Path to directory with Stable Diffusion checkpoints.</td>
</tr>
<tr>
<td>–no-download-sd-model</td>
<td>None</td>
<td>False</td>
<td>Don’t download SD1.5 model even if no model is found.</td>
</tr>
<tr>
<td>–vae-dir</td>
<td>VAE_PATH</td>
<td>None</td>
<td>Path to Variational Autoencoders model</td>
</tr>
<tr>
<td>–vae-path</td>
<td>VAE_PATH</td>
<td>None</td>
<td>Checkpoint to use as VAE; setting this argument</td>
</tr>
<tr>
<td>–gfpgan-dir</td>
<td>GFPGAN_DIR</td>
<td>GFPGAN/</td>
<td>GFPGAN directory.</td>
</tr>
<tr>
<td>–gfpgan-model</td>
<td>GFPGAN_MODEL</td>
<td>GFPGAN model file name.</td>
<td></td>
</tr>
<tr>
<td>–codeformer-models-path</td>
<td>CODEFORMER_MODELS_PATH</td>
<td>models/Codeformer/</td>
<td>Path to directory with codeformer model file(s).</td>
</tr>
<tr>
<td>–gfpgan-models-path</td>
<td>GFPGAN_MODELS_PATH</td>
<td>models/GFPGAN</td>
<td>Path to directory with GFPGAN model file(s).</td>
</tr>
<tr>
<td>–esrgan-models-path</td>
<td>ESRGAN_MODELS_PATH</td>
<td>models/ESRGAN</td>
<td>Path to directory with ESRGAN model file(s).</td>
</tr>
<tr>
<td>–bsrgan-models-path</td>
<td>BSRGAN_MODELS_PATH</td>
<td>models/BSRGAN</td>
<td>Path to directory with BSRGAN model file(s).</td>
</tr>
<tr>
<td>–realesrgan-models-path</td>
<td>REALESRGAN_MODELS_PATH</td>
<td>models/RealESRGAN</td>
<td>Path to directory with RealESRGAN model file(s).</td>
</tr>
<tr>
<td>–scunet-models-path</td>
<td>SCUNET_MODELS_PATH</td>
<td>models/ScuNET</td>
<td>Path to directory with ScuNET model file(s).</td>
</tr>
<tr>
<td>–swinir-models-path</td>
<td>SWINIR_MODELS_PATH</td>
<td>models/SwinIR</td>
<td>Path to directory with SwinIR and SwinIR v2 model file(s).</td>
</tr>
<tr>
<td>–ldsr-models-path</td>
<td>LDSR_MODELS_PATH</td>
<td>models/LDSR</td>
<td>Path to directory with LDSR model file(s).</td>
</tr>
<tr>
<td>–lora-dir</td>
<td>LORA_DIR</td>
<td>models/Lora</td>
<td>Path to directory with Lora networks.</td>
</tr>
<tr>
<td>–clip-models-path</td>
<td>CLIP_MODELS_PATH</td>
<td>None</td>
<td>Path to directory with CLIP model file(s).</td>
</tr>
<tr>
<td>–embeddings-dir</td>
<td>EMBEDDINGS_DIR</td>
<td>embeddings/</td>
<td>Embeddings directory for textual inversion (default: embeddings).</td>
</tr>
<tr>
<td>–textual-inversion-templates-dir</td>
<td>TEXTUAL_INVERSION_TEMPLATES_DIR</td>
<td>textual_inversion_templates</td>
<td>Directory with textual inversion templates.</td>
</tr>
<tr>
<td>–hypernetwork-dir</td>
<td>HYPERNETWORK_DIR</td>
<td>models/hypernetworks/</td>
<td>hypernetwork directory.</td>
</tr>
<tr>
<td>–localizations-dir</td>
<td>LOCALIZATIONS_DIR</td>
<td>localizations/</td>
<td>Localizations directory.</td>
</tr>
<tr>
<td>–styles-file</td>
<td>STYLES_FILE</td>
<td>styles.csv</td>
<td>Filename to use for styles.</td>
</tr>
<tr>
<td>–ui-config-file</td>
<td>UI_CONFIG_FILE</td>
<td>ui-config.json</td>
<td>Filename to use for UI configuration.</td>
</tr>
<tr>
<td>–no-progressbar-hiding</td>
<td>None</td>
<td>False</td>
<td>Do not hide progress bar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser).</td>
</tr>
<tr>
<td>–max-batch-count</td>
<td>MAX_BATCH_COUNT</td>
<td>16</td>
<td>Maximum batch count value for the UI.</td>
</tr>
<tr>
<td>–ui-settings-file</td>
<td>UI_SETTINGS_FILE</td>
<td>config.json</td>
<td>Filename to use for UI settings.</td>
</tr>
<tr>
<td>–allow-code</td>
<td>None</td>
<td>False</td>
<td>Allow custom script execution from web UI.</td>
</tr>
<tr>
<td>–share</td>
<td>None</td>
<td>False</td>
<td>Use <code>share=True</code> for gradio and make the UI accessible through their site.</td>
</tr>
<tr>
<td>–listen</td>
<td>None</td>
<td>False</td>
<td>Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests.</td>
</tr>
<tr>
<td>–port</td>
<td>PORT</td>
<td>7860</td>
<td>Launch gradio with given server port, you need root/admin rights for ports &lt; 1024; defaults to 7860 if available.</td>
</tr>
<tr>
<td>–hide-ui-dir-config</td>
<td>None</td>
<td>False</td>
<td>Hide directory configuration from web UI.</td>
</tr>
<tr>
<td>–freeze-settings</td>
<td>None</td>
<td>False</td>
<td>disable editing settings</td>
</tr>
<tr>
<td>–enable-insecure-extension-access</td>
<td>None</td>
<td>False</td>
<td>Enable extensions tab regardless of other options.</td>
</tr>
<tr>
<td>–gradio-debug</td>
<td>None</td>
<td>False</td>
<td>Launch gradio with <code>--debug</code> option.</td>
</tr>
<tr>
<td>–gradio-auth</td>
<td>GRADIO_AUTH</td>
<td>None</td>
<td>Set gradio authentication like <code>username:password</code>; or comma-delimit multiple like <code>u1:p1,u2:p2,u3:p3</code>.</td>
</tr>
<tr>
<td>–gradio-auth-path</td>
<td>GRADIO_AUTH_PATH</td>
<td>None</td>
<td>Set gradio authentication file path ex. <code>/path/to/auth/file</code> same auth format as <code>--gradio-auth</code>.</td>
</tr>
<tr>
<td>–disable-console-progressbars</td>
<td>None</td>
<td>False</td>
<td>Do not output progress bars to console.</td>
</tr>
<tr>
<td>–enable-console-prompts</td>
<td>None</td>
<td>False</td>
<td>Print prompts to console when generating with txt2img and img2img.</td>
</tr>
<tr>
<td>–api</td>
<td>None</td>
<td>False</td>
<td>Launch web UI with API.</td>
</tr>
<tr>
<td>–api-auth</td>
<td>API_AUTH</td>
<td>None</td>
<td>Set authentication for API like <code>username:password</code>; or comma-delimit multiple like <code>u1:p1,u2:p2,u3:p3</code>.</td>
</tr>
<tr>
<td>–api-log</td>
<td>None</td>
<td>False</td>
<td>Enable logging of all API requests.</td>
</tr>
<tr>
<td>–nowebui</td>
<td>None</td>
<td>False</td>
<td>Only launch the API, without the UI.</td>
</tr>
<tr>
<td>–ui-debug-mode</td>
<td>None</td>
<td>False</td>
<td>Don’t load model to quickly launch UI.</td>
</tr>
<tr>
<td>–device-id</td>
<td>DEVICE_ID</td>
<td>None</td>
<td>Select the default CUDA device to use (export <code>CUDA_VISIBLE_DEVICES=0,1</code> etc might be needed before).</td>
</tr>
<tr>
<td>–administrator</td>
<td>None</td>
<td>False</td>
<td>Administrator privileges.</td>
</tr>
<tr>
<td>–cors-allow-origins</td>
<td>CORS_ALLOW_ORIGINS</td>
<td>None</td>
<td>Allowed CORS origin(s) in the form of a comma-separated list (no spaces).</td>
</tr>
<tr>
<td>–cors-allow-origins-regex</td>
<td>CORS_ALLOW_ORIGINS_REGEX</td>
<td>None</td>
<td>Allowed CORS origin(s) in the form of a single regular expression.</td>
</tr>
<tr>
<td>–tls-keyfile</td>
<td>TLS_KEYFILE</td>
<td>None</td>
<td>Partially enables TLS, requires <code>--tls-certfile</code> to fully function.</td>
</tr>
<tr>
<td>–tls-certfile</td>
<td>TLS_CERTFILE</td>
<td>None</td>
<td>Partially enables TLS, requires <code>--tls-keyfile</code> to fully function.</td>
</tr>
<tr>
<td>–disable-tls-verify</td>
<td>None</td>
<td>False</td>
<td>When passed, enables the use of self-signed certificates.</td>
</tr>
<tr>
<td>–server-name</td>
<td>SERVER_NAME</td>
<td>None</td>
<td>Sets hostname of server.</td>
</tr>
<tr>
<td>–no-gradio-queue</td>
<td>None</td>
<td>False</td>
<td>Disables gradio queue; causes the webpage to use http requests instead of websockets; was the default in earlier versions.</td>
</tr>
<tr>
<td>–no-hashing</td>
<td>None</td>
<td>False</td>
<td>Disable SHA-256 hashing of checkpoints to help loading performance.</td>
</tr>
<tr>
<td>–skip-version-check</td>
<td>None</td>
<td>False</td>
<td>Do not check versions of torch and xformers.</td>
</tr>
<tr>
<td>–skip-python-version-check</td>
<td>None</td>
<td>False</td>
<td>Do not check versions of Python.</td>
</tr>
<tr>
<td>–skip-torch-cuda-test</td>
<td>None</td>
<td>False</td>
<td>Do not check if CUDA is able to work properly.</td>
</tr>
<tr>
<td>–skip-install</td>
<td>None</td>
<td>False</td>
<td>Skip installation of packages.</td>
</tr>
<tr>
<td><strong>PERFORMANCE</strong></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>–xformers</td>
<td>None</td>
<td>False</td>
<td>Enable xformers for cross attention layers.</td>
</tr>
<tr>
<td>–force-enable-xformers</td>
<td>None</td>
<td>False</td>
<td>Enable xformers for cross attention layers regardless of whether the checking code thinks you can run it; <em><strong>do not make bug reports if this fails to work</strong></em>.</td>
</tr>
<tr>
<td>–xformers-flash-attention</td>
<td>None</td>
<td>False</td>
<td>Enable xformers with Flash Attention to improve reproducibility (supported for SD2.x or variant only).</td>
</tr>
<tr>
<td>–opt-sdp-attention</td>
<td>None</td>
<td>False</td>
<td>Enable scaled dot product cross-attention layer optimization; requires PyTorch 2.*</td>
</tr>
<tr>
<td>–opt-sdp-no-mem-attention</td>
<td>False</td>
<td>None</td>
<td>Enable scaled dot product cross-attention layer optimization without memory efficient attention, makes image generation deterministic; requires PyTorch 2.*</td>
</tr>
<tr>
<td>–opt-split-attention</td>
<td>None</td>
<td>False</td>
<td>Force-enables Doggettx’s cross-attention layer optimization. By default, it’s on for CUDA-enabled systems.</td>
</tr>
<tr>
<td>–opt-split-attention-invokeai</td>
<td>None</td>
<td>False</td>
<td>Force-enables InvokeAI’s cross-attention layer optimization. By default, it’s on when CUDA is unavailable.</td>
</tr>
<tr>
<td>–opt-split-attention-v1</td>
<td>None</td>
<td>False</td>
<td>Enable older version of split attention optimization that does not consume all VRAM available.</td>
</tr>
<tr>
<td>–opt-sub-quad-attention</td>
<td>None</td>
<td>False</td>
<td>Enable memory efficient sub-quadratic cross-attention layer optimization.</td>
</tr>
<tr>
<td>–sub-quad-q-chunk-size</td>
<td>SUB_QUAD_Q_CHUNK_SIZE</td>
<td>1024</td>
<td>Query chunk size for the sub-quadratic cross-attention layer optimization to use.</td>
</tr>
<tr>
<td>–sub-quad-kv-chunk-size</td>
<td>SUB_QUAD_KV_CHUNK_SIZE</td>
<td>None</td>
<td>KV chunk size for the sub-quadratic cross-attention layer optimization to use.</td>
</tr>
<tr>
<td>–sub-quad-chunk-threshold</td>
<td>SUB_QUAD_CHUNK_THRESHOLD</td>
<td>None</td>
<td>The percentage of VRAM threshold for the sub-quadratic cross-attention layer optimization to use chunking.</td>
</tr>
<tr>
<td>–opt-channelslast</td>
<td>None</td>
<td>False</td>
<td>Enable alternative layout for 4d tensors, may result in faster inference <strong>only</strong> on Nvidia cards with Tensor cores (16xx and higher).</td>
</tr>
<tr>
<td>–disable-opt-split-attention</td>
<td>None</td>
<td>False</td>
<td>Force-disables cross-attention layer optimization.</td>
</tr>
<tr>
<td>–disable-nan-check</td>
<td>None</td>
<td>False</td>
<td>Do not check if produced images/latent spaces have nans; useful for running without a checkpoint in CI.</td>
</tr>
<tr>
<td>–use-cpu</td>
<td>{all, sd, interrogate, gfpgan, bsrgan, esrgan, scunet, codeformer}</td>
<td>None</td>
<td>Use CPU as torch device for specified modules.</td>
</tr>
<tr>
<td>–no-half</td>
<td>None</td>
<td>False</td>
<td>Do not switch the model to 16-bit floats.</td>
</tr>
<tr>
<td>–precision</td>
<td>{full,autocast}</td>
<td>autocast</td>
<td>Evaluate at this precision.</td>
</tr>
<tr>
<td>–no-half-vae</td>
<td>None</td>
<td>False</td>
<td>Do not switch the VAE model to 16-bit floats.</td>
</tr>
<tr>
<td>–upcast-sampling</td>
<td>None</td>
<td>False</td>
<td>Upcast sampling. No effect with <code>--no-half</code>. Usually produces similar results to <code>--no-half</code> with better performance while using less memory.</td>
</tr>
<tr>
<td>–medvram</td>
<td>None</td>
<td>False</td>
<td>Enable Stable Diffusion model optimizations for sacrificing a some performance for low VRAM usage.</td>
</tr>
<tr>
<td>–lowvram</td>
<td>None</td>
<td>False</td>
<td>Enable Stable Diffusion model optimizations for sacrificing a lot of speed for very low VRAM usage.</td>
</tr>
<tr>
<td>–lowram</td>
<td>None</td>
<td>False</td>
<td>Load Stable Diffusion checkpoint weights to VRAM instead of RAM.</td>
</tr>
<tr>
<td>–always-batch-cond-uncond</td>
<td>None</td>
<td>False</td>
<td>Disables cond/uncond batching that is enabled to save memory with <code>--medvram</code> or <code>--lowvram</code>.</td>
</tr>
<tr>
<td><strong>FEATURES</strong></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>–autolaunch</td>
<td>None</td>
<td>False</td>
<td>Open the web UI URL in the system’s default browser upon launch.</td>
</tr>
<tr>
<td>–theme</td>
<td>None</td>
<td>Unset</td>
<td>Open the web UI with the specified theme (<code>light</code> or <code>dark</code>). If not specified, uses the default browser theme.</td>
</tr>
<tr>
<td>–use-textbox-seed</td>
<td>None</td>
<td>False</td>
<td>Use textbox for seeds in UI (no up/down, but possible to input long seeds).</td>
</tr>
<tr>
<td>–disable-safe-unpickle</td>
<td>None</td>
<td>False</td>
<td>Disable checking PyTorch models for malicious code.</td>
</tr>
<tr>
<td>–ngrok</td>
<td>NGROK</td>
<td>None</td>
<td>ngrok authtoken, alternative to gradio <code>--share</code>.</td>
</tr>
<tr>
<td>–ngrok-region</td>
<td>NGROK_REGION</td>
<td>us</td>
<td>The region in which ngrok should start.</td>
</tr>
<tr>
<td>–update-check</td>
<td>None</td>
<td>None</td>
<td>On startup, notifies whether or not your web UI version (commit) is up-to-date with the current master branch.</td>
</tr>
<tr>
<td>–update-all-extensions</td>
<td>None</td>
<td>None</td>
<td>On startup, it pulls the latest updates for all extensions you have installed.</td>
</tr>
<tr>
<td>–reinstall-xformers</td>
<td>None</td>
<td>False</td>
<td>Force-reinstall xformers. Useful for upgrading - but remove it after upgrading or you’ll reinstall xformers perpetually.</td>
</tr>
<tr>
<td>–reinstall-torch</td>
<td>None</td>
<td>False</td>
<td>Force-reinstall torch. Useful for upgrading - but remove it after upgrading or you’ll reinstall torch perpetually.</td>
</tr>
<tr>
<td>–tests</td>
<td>TESTS</td>
<td>False</td>
<td>Run test to validate web UI functionality, see wiki topic for more details.</td>
</tr>
<tr>
<td>–no-tests</td>
<td>None</td>
<td>False</td>
<td>Do not run tests even if <code>--tests</code> option is specified.</td>
</tr>
<tr>
<td><strong>DEFUNCT OPTIONS</strong></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>–show-negative-prompt</td>
<td>None</td>
<td>False</td>
<td>No longer has an effect.</td>
</tr>
<tr>
<td>–deepdanbooru</td>
<td>None</td>
<td>False</td>
<td>No longer has an effect.</td>
</tr>
<tr>
<td>–unload-gfpgan</td>
<td>None</td>
<td>False</td>
<td>No longer has an effect.</td>
</tr>
<tr>
<td>–gradio-img2img-tool</td>
<td>GRADIO_IMG2IMG_TOOL</td>
<td>None</td>
<td>No longer has an effect.</td>
</tr>
<tr>
<td>–gradio-inpaint-tool</td>
<td>GRADIO_INPAINT_TOOL</td>
<td>None</td>
<td>No longer has an effect.</td>
</tr>
<tr>
<td>–gradio-queue</td>
<td>None</td>
<td>False</td>
<td>No longer has an effect.</td>
</tr>
</tbody>
</table>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
## Environment variables
| Name | Description |
|------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| PYTHON | Sets a custom path for Python executable. |
| VENV_DIR | Specifies the path for the virtual environment. Default is `venv`. Special value `-` runs the script without creating virtual environment. |
| COMMANDLINE_ARGS | Additional commandline arguments for the main program. |
| IGNORE_CMD_ARGS_ERRORS | Set to anything to make the program not exit with an error if an unexpected commandline argument is encountered. |
| REQS_FILE | Name of `requirements.txt` file with dependencies that will be installed when `launch.py` is run. Defaults to `requirements_versions.txt`. |
| TORCH_COMMAND | Command for installing PyTorch. |
| INDEX_URL | `--index-url` parameter for pip. |
| TRANSFORMERS_CACHE | Path to where transformers library will download and keep its files related to the CLIP model. |
| CUDA_VISIBLE_DEVICES | Select GPU to use for your instance on a system with multiple GPUs. For example, if you want to use secondary GPU, put "1".<br>(add a new line to webui-user.bat not in COMMANDLINE_ARGS): `set CUDA_VISIBLE_DEVICES=0`<br>Alternatively, just use `--device-id` flag in `COMMANDLINE_ARGS`. |
### webui-user
The recommended way to specify environment variables is by editing `webui-user.bat` (Windows) and `webui-user.sh` (Linux):
- `set VARNAME=VALUE` for Windows
- `export VARNAME="VALUE"` for Linux
For example, in Windows:
```
set COMMANDLINE_ARGS=--allow-code --xformers --skip-torch-cuda-test --no-half-vae --api --ckpt-dir A:\\stable-diffusion-checkpoints
```
### Running online
Use the `--share` option to run online. You will get a xxx.app.gradio link. This is the intended way to use the program in colabs. You may set up authentication for said gradio shared instance with the flag `--gradio-auth username:password`, optionally providing multiple sets of usernames and passwords separated by commas.
### Running within Local Area Network
Use `--listen` to make the server listen to network connections. This will allow computers on the local network to access the UI, and if you configure port forwarding, also computers on the internet. Example address: `http://192.168.1.3:7860`
Where your "192.168.1.3" is the local IP address.
Use `--port xxxx` to make the server listen on a specific port, xxxx being the wanted port. Remember that all ports below 1024 need root/admin rights, for this reason it is advised to use a port above 1024. Defaults to port 7860 if available.
### Running on CPU
Running with only your CPU is possible, but not recommended.
It is very slow and there is no fp16 implementation.
To run, you must have all these flags enabled: `--use-cpu all --precision full --no-half --skip-torch-cuda-test`
Though this is a questionable way to run webui, due to the very slow generation speeds; using the various AI upscalers and captioning tools may be useful to some people.
<details><summary>Extras: </summary>
For the technically inclined, here are some steps a user provided to boost CPU performance:
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10514
https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/10516
</details>
# All command line arguments
| Argument Command | Value | Default | Description |
| ---------------- | ----- | ------- | ----------- |
| **CONFIGURATION** |
-h, --help | None | False | Show this help message and exit. |
--exit | | | Terminate after installation |
--data-dir | DATA_DIR | ./ | base path where all user data is stored |
--config | CONFIG | configs/stable-diffusion/v1-inference.yaml | Path to config which constructs model. |
--ckpt | CKPT | model.ckpt | Path to checkpoint of Stable Diffusion model; if specified, this checkpoint will be added to the list of checkpoints and loaded. |
--ckpt-dir | CKPT_DIR | None | Path to directory with Stable Diffusion checkpoints. |
--no-download-sd-model | None | False | Don't download SD1.5 model even if no model is found. |
--vae-dir | VAE_PATH | None | Path to Variational Autoencoders model | disables all settings related to VAE.
--vae-path | VAE_PATH | None | Checkpoint to use as VAE; setting this argument
--gfpgan-dir| GFPGAN_DIR | GFPGAN/ | GFPGAN directory. |
--gfpgan-model| GFPGAN_MODEL | GFPGAN model file name. |
--codeformer-models-path | CODEFORMER_MODELS_PATH | models/Codeformer/ | Path to directory with codeformer model file(s). |
--gfpgan-models-path | GFPGAN_MODELS_PATH | models/GFPGAN | Path to directory with GFPGAN model file(s). |
--esrgan-models-path | ESRGAN_MODELS_PATH | models/ESRGAN | Path to directory with ESRGAN model file(s). |
--bsrgan-models-path | BSRGAN_MODELS_PATH | models/BSRGAN | Path to directory with BSRGAN model file(s). |
--realesrgan-models-path | REALESRGAN_MODELS_PATH | models/RealESRGAN | Path to directory with RealESRGAN model file(s). |
--scunet-models-path | SCUNET_MODELS_PATH | models/ScuNET | Path to directory with ScuNET model file(s). |
--swinir-models-path | SWINIR_MODELS_PATH | models/SwinIR | Path to directory with SwinIR and SwinIR v2 model file(s). |
--ldsr-models-path | LDSR_MODELS_PATH | models/LDSR | Path to directory with LDSR model file(s). |
--lora-dir | LORA_DIR | models/Lora | Path to directory with Lora networks.
--clip-models-path | CLIP_MODELS_PATH | None | Path to directory with CLIP model file(s). |
--embeddings-dir | EMBEDDINGS_DIR | embeddings/ | Embeddings directory for textual inversion (default: embeddings). |
--textual-inversion-templates-dir | TEXTUAL_INVERSION_TEMPLATES_DIR | textual_inversion_templates | Directory with textual inversion templates.
--hypernetwork-dir | HYPERNETWORK_DIR | models/hypernetworks/ | hypernetwork directory. |
--localizations-dir | LOCALIZATIONS_DIR | localizations/ | Localizations directory.
--styles-file | STYLES_FILE | styles.csv | Filename to use for styles. |
--ui-config-file | UI_CONFIG_FILE | ui-config.json | Filename to use for UI configuration. |
--no-progressbar-hiding | None | False | Do not hide progress bar in gradio UI (we hide it because it slows down ML if you have hardware acceleration in browser). |
--max-batch-count| MAX_BATCH_COUNT | 16 | Maximum batch count value for the UI. |
--ui-settings-file | UI_SETTINGS_FILE | config.json | Filename to use for UI settings. |
--allow-code | None | False | Allow custom script execution from web UI. |
--share | None | False | Use `share=True` for gradio and make the UI accessible through their site.
--listen | None | False | Launch gradio with 0.0.0.0 as server name, allowing to respond to network requests. |
--port | PORT | 7860 | Launch gradio with given server port, you need root/admin rights for ports < 1024; defaults to 7860 if available. |
--hide-ui-dir-config | None | False | Hide directory configuration from web UI. |
--freeze-settings | None | False | disable editing settings |
--enable-insecure-extension-access | None | False | Enable extensions tab regardless of other options. |
--gradio-debug | None | False | Launch gradio with `--debug` option. |
--gradio-auth | GRADIO_AUTH | None | Set gradio authentication like `username:password`; or comma-delimit multiple like `u1:p1,u2:p2,u3:p3`. |
--gradio-auth-path | GRADIO_AUTH_PATH | None | Set gradio authentication file path ex. `/path/to/auth/file` same auth format as `--gradio-auth`. |
--disable-console-progressbars | None | False | Do not output progress bars to console. |
--enable-console-prompts | None | False | Print prompts to console when generating with txt2img and img2img. |
--api | None | False | Launch web UI with API. |
--api-auth | API_AUTH | None | Set authentication for API like `username:password`; or comma-delimit multiple like `u1:p1,u2:p2,u3:p3`. |
--api-log | None | False | Enable logging of all API requests. |
--nowebui | None | False | Only launch the API, without the UI. |
--ui-debug-mode | None | False | Don't load model to quickly launch UI. |
--device-id | DEVICE_ID | None | Select the default CUDA device to use (export `CUDA_VISIBLE_DEVICES=0,1` etc might be needed before). |
--administrator | None | False | Administrator privileges. |
--cors-allow-origins | CORS_ALLOW_ORIGINS | None | Allowed CORS origin(s) in the form of a comma-separated list (no spaces). |
--cors-allow-origins-regex | CORS_ALLOW_ORIGINS_REGEX | None | Allowed CORS origin(s) in the form of a single regular expression. |
--tls-keyfile | TLS_KEYFILE | None | Partially enables TLS, requires `--tls-certfile` to fully function. |
--tls-certfile | TLS_CERTFILE | None | Partially enables TLS, requires `--tls-keyfile` to fully function. |
--disable-tls-verify | None | False | When passed, enables the use of self-signed certificates.
--server-name | SERVER_NAME | None | Sets hostname of server. |
--no-gradio-queue | None| False | Disables gradio queue; causes the webpage to use http requests instead of websockets; was the default in earlier versions.
--no-hashing | None | False | Disable SHA-256 hashing of checkpoints to help loading performance. |
--skip-version-check | None | False | Do not check versions of torch and xformers. |
--skip-python-version-check | None | False | Do not check versions of Python. |
--skip-torch-cuda-test | None | False | Do not check if CUDA is able to work properly. |
--skip-install | None | False | Skip installation of packages. |
| **PERFORMANCE** |
--xformers | None | False | Enable xformers for cross attention layers. |
--force-enable-xformers | None | False | Enable xformers for cross attention layers regardless of whether the checking code thinks you can run it; ***do not make bug reports if this fails to work***. |
--xformers-flash-attention | None | False | Enable xformers with Flash Attention to improve reproducibility (supported for SD2.x or variant only).
--opt-sdp-attention | None | False | Enable scaled dot product cross-attention layer optimization; requires PyTorch 2.*
--opt-sdp-no-mem-attention | False | None | Enable scaled dot product cross-attention layer optimization without memory efficient attention, makes image generation deterministic; requires PyTorch 2.*
--opt-split-attention | None | False | Force-enables Doggettx's cross-attention layer optimization. By default, it's on for CUDA-enabled systems. |
--opt-split-attention-invokeai | None | False | Force-enables InvokeAI's cross-attention layer optimization. By default, it's on when CUDA is unavailable. |
--opt-split-attention-v1 | None | False | Enable older version of split attention optimization that does not consume all VRAM available. |
--opt-sub-quad-attention | None | False | Enable memory efficient sub-quadratic cross-attention layer optimization.
--sub-quad-q-chunk-size | SUB_QUAD_Q_CHUNK_SIZE | 1024 | Query chunk size for the sub-quadratic cross-attention layer optimization to use.
--sub-quad-kv-chunk-size | SUB_QUAD_KV_CHUNK_SIZE | None | KV chunk size for the sub-quadratic cross-attention layer optimization to use.
--sub-quad-chunk-threshold | SUB_QUAD_CHUNK_THRESHOLD | None | The percentage of VRAM threshold for the sub-quadratic cross-attention layer optimization to use chunking.
--opt-channelslast | None | False | Enable alternative layout for 4d tensors, may result in faster inference **only** on Nvidia cards with Tensor cores (16xx and higher). |
--disable-opt-split-attention | None | False | Force-disables cross-attention layer optimization. |
--disable-nan-check | None | False | Do not check if produced images/latent spaces have nans; useful for running without a checkpoint in CI.
--use-cpu | {all, sd, interrogate, gfpgan, bsrgan, esrgan, scunet, codeformer} | None | Use CPU as torch device for specified modules. |
--no-half | None | False | Do not switch the model to 16-bit floats. |
--precision | {full,autocast} | autocast | Evaluate at this precision. |
--no-half-vae | None | False | Do not switch the VAE model to 16-bit floats. |
--upcast-sampling | None | False | Upcast sampling. No effect with `--no-half`. Usually produces similar results to `--no-half` with better performance while using less memory.
--medvram | None | False | Enable Stable Diffusion model optimizations for sacrificing a some performance for low VRAM usage. |
--lowvram | None | False | Enable Stable Diffusion model optimizations for sacrificing a lot of speed for very low VRAM usage. |
--lowram | None | False | Load Stable Diffusion checkpoint weights to VRAM instead of RAM.
--always-batch-cond-uncond | None | False | Disables cond/uncond batching that is enabled to save memory with `--medvram` or `--lowvram`.
| **FEATURES** |
--autolaunch | None | False | Open the web UI URL in the system's default browser upon launch. |
--theme | None | Unset | Open the web UI with the specified theme (`light` or `dark`). If not specified, uses the default browser theme. |
--use-textbox-seed | None | False | Use textbox for seeds in UI (no up/down, but possible to input long seeds). |
--disable-safe-unpickle | None | False | Disable checking PyTorch models for malicious code. |
--ngrok | NGROK | None | ngrok authtoken, alternative to gradio `--share`.
--ngrok-region | NGROK_REGION | us | The region in which ngrok should start.
--update-check | None | None | On startup, notifies whether or not your web UI version (commit) is up-to-date with the current master branch.
--update-all-extensions | None | None | On startup, it pulls the latest updates for all extensions you have installed.
--reinstall-xformers | None | False | Force-reinstall xformers. Useful for upgrading - but remove it after upgrading or you'll reinstall xformers perpetually. |
--reinstall-torch | None | False | Force-reinstall torch. Useful for upgrading - but remove it after upgrading or you'll reinstall torch perpetually. |
--tests | TESTS | False | Run test to validate web UI functionality, see wiki topic for more details.
--no-tests | None | False | Do not run tests even if `--tests` option is specified.
| **DEFUNCT OPTIONS** |
--show-negative-prompt | None | False | No longer has an effect. |
--deepdanbooru | None | False | No longer has an effect. |
--unload-gfpgan | None | False | No longer has an effect.
--gradio-img2img-tool | GRADIO_IMG2IMG_TOOL | None | No longer has an effect. |
--gradio-inpaint-tool | GRADIO_INPAINT_TOOL | None | No longer has an effect. |
--gradio-queue | None | False | No longer has an effect. |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Pull requests</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>Pull requests</h1>
<p>To contribute, clone the repository, make your changes, commit and push to your clone, and submit a pull request.</p>
<blockquote>
<p><strong>Note</strong>
If you’re not a contributor to this repository, you need to fork and clone the repository before pushing your changes. For more information, check out <a href="https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository">Contributing to Projects</a> in the GitHub documentation.</p>
</blockquote>
<ul>
<li>If you are adding a lot of code, <strong>consider making it an <a href="Extensions">extension</a> instead</strong>.</li>
<li>Do not add multiple unrelated things in same PR.</li>
<li>PRs should target the <code>dev</code> branch.</li>
<li>Make sure that your changes do not break anything by running <a href="Tests">tests</a>.</li>
<li>Do not submit PRs where you just take existing lines and reformat them without changing what they do.</li>
<li>If you are submitting a bug fix, there must be a way for me to reproduce the bug.</li>
<li>Do not use your clone’s <code>master</code> or <code>main</code> branch to make a PR - create a branch and PR that.</li>
</ul>
<details><summary>There is a discord channel for development of the webui (click to expand). Join if you want to talk about a PR in real time. Don't join if you're not involved in development.</summary><blockquote>
<details><summary>This is a discord for development only, NOT for tech support.
</summary><blockquote>
<p><a href="https://discord.gg/WG2nzq3YEH">Dev discord</a></p>
</details></blockquote></details>
<p>If you are making changes to used libraries or the installation script, you must verify them to work on default Windows installation from scratch. If you cannot test if it works (due to your OS or anything else), do not make those changes (with possible exception of changes that explicitly are guarded from being executed on Windows by <code>if</code>s or something else).</p>
<h1>Code style</h1>
<p>We use linters to enforce style for python and javascript. If you make a PR that fails the check, I will ask you to fix the code until the linter does not complain anymore.</p>
<p>Here’s how to use linters locally:</p>
<h4>python</h4>
<p>Install: <code>pip install ruff</code></p>
<p>Run: <code>ruff .</code> (or <code>python -mruff .</code>)</p>
<h4>javascript</h4>
<p>Install: install npm on your system.</p>
<p>Run: <code>npx eslint .</code></p>
<h1>Quirks</h1>
<ul>
<li><code>webui.user.bat</code> is never to be edited</li>
<li><code>requirements_versions.txt</code> is for python 3.10.6</li>
<li><code>requirements.txt</code> is for people running on colabs and whatnot using python 3.7</li>
</ul>
<h1>Gradio</h1>
<p>Gradio at some point wanted to add this section to shill their project in the contributing section, which I didn’t have at the time, so here it is now.</p>
<p>For <a href="https://github.com/gradio-app/gradio">Gradio</a> check out the <a href="https://gradio.app/docs/">docs</a> to contribute:
Have an issue or feature request with Gradio? open a issue/feature request on github for support: <a href="https://github.com/gradio-app/gradio/issues">https://github.com/gradio-app/gradio/issues</a></p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# Pull requests
To contribute, clone the repository, make your changes, commit and push to your clone, and submit a pull request.
> **Note**
If you're not a contributor to this repository, you need to fork and clone the repository before pushing your changes. For more information, check out [Contributing to Projects](https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository) in the GitHub documentation.
* If you are adding a lot of code, **consider making it an [extension](Extensions) instead**.
* Do not add multiple unrelated things in same PR.
* PRs should target the `dev` branch.
* Make sure that your changes do not break anything by running [tests](Tests).
* Do not submit PRs where you just take existing lines and reformat them without changing what they do.
* If you are submitting a bug fix, there must be a way for me to reproduce the bug.
* Do not use your clone's `master` or `main` branch to make a PR - create a branch and PR that.
<details><summary>There is a discord channel for development of the webui (click to expand). Join if you want to talk about a PR in real time. Don't join if you're not involved in development.</summary><blockquote>
<details><summary>This is a discord for development only, NOT for tech support.
</summary><blockquote>
[Dev discord](https://discord.gg/WG2nzq3YEH)
</details></blockquote></details>
If you are making changes to used libraries or the installation script, you must verify them to work on default Windows installation from scratch. If you cannot test if it works (due to your OS or anything else), do not make those changes (with possible exception of changes that explicitly are guarded from being executed on Windows by `if`s or something else).
# Code style
We use linters to enforce style for python and javascript. If you make a PR that fails the check, I will ask you to fix the code until the linter does not complain anymore.
Here's how to use linters locally:
#### python
Install: `pip install ruff`
Run: `ruff .` (or `python -mruff .`)
#### javascript
Install: install npm on your system.
Run: `npx eslint .`
# Quirks
* `webui.user.bat` is never to be edited
* `requirements_versions.txt` is for python 3.10.6
* `requirements.txt` is for people running on colabs and whatnot using python 3.7
# Gradio
Gradio at some point wanted to add this section to shill their project in the contributing section, which I didn't have at the time, so here it is now.
For [Gradio](https://github.com/gradio-app/gradio) check out the [docs](https://gradio.app/docs/) to contribute:
Have an issue or feature request with Gradio? open a issue/feature request on github for support: https://github.com/gradio-app/gradio/issues
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Patterns</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><blockquote>
<p>the following information is about the image filename and subdirectory name, not the <code>Paths for saving \ Output directories</code></p>
</blockquote>
<h3>By default, the Web UI saves images in the output directories and output archive with a filename structure of</h3>
<p>Images: <code>[number]-[seed]-[prompt_spaces]</code></p>
<pre><code>01234-987654321-((masterpiece)), ((best quality)), ((illustration)), extremely detailed,style girl.png
</code></pre>
<p>Zip archive: <code>[datetime]_[[model_name]]_[seed]-[seed_last]</code></p>
<pre><code>20230530133149_[v1-5-pruned-emaonly]_987654321-987654329.zip
</code></pre>
<p>A different image filename and optional subdirectory and zip filename can be used if a user wishes.</p>
<p>Image filename pattern can be configured under.</p>
<p><code>settings tab</code> &gt; <code>Saving images/grids</code> &gt; <code>Images filename pattern</code></p>
<p>Subdirectory can be configured under settings.</p>
<p><code>settings tab</code> &gt; <code>Saving to a directory</code> &gt; <code>Directory name pattern</code></p>
<p>Zip archive can be configured under settings.</p>
<p><code>settings tab</code> &gt; <code>Saving images/grids</code> &gt; <code>Archive filename pattern</code></p>
<h1>Patterns</h1>
<p>Web-Ui provides several patterns that can be used as placeholders for inserting information into the filename or subdirectory,
user can chain these patterns together, forming a filename that suits their use case.</p>
<table>
<thead>
<tr>
<th>Pattern</th>
<th>Description</th>
<th>Example</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>[seed]</code></td>
<td>Seed</td>
<td>1234567890</td>
</tr>
<tr>
<td><code>[seed_first]</code></td>
<td>First Seed of batch or Seed of single image</td>
<td>[1234567890,1234567891,1234567892,1234567893] -&gt; 1234567890<br>[1234567891] -&gt; 1234567891</td>
</tr>
<tr>
<td><code>[seed_last]</code></td>
<td>Last Seed of batch</td>
<td>[1234567890,1234567891,1234567892,1234567893] -&gt; 1234567893</td>
</tr>
<tr>
<td><code>[steps]</code></td>
<td>Steps</td>
<td>20</td>
</tr>
<tr>
<td><code>[cfg]</code></td>
<td>CFG scale</td>
<td>7</td>
</tr>
<tr>
<td><code>[sampler]</code></td>
<td>Sampling method</td>
<td>Euler a</td>
</tr>
<tr>
<td><code>[model_name]</code></td>
<td>Name of the model</td>
<td>sd-v1-4</td>
</tr>
<tr>
<td><code>[model_hash]</code></td>
<td>The first 8 characters of the prompt’s SHA-256 hash</td>
<td>7460a6fa</td>
</tr>
<tr>
<td><code>[width]</code></td>
<td>Image width</td>
<td>512</td>
</tr>
<tr>
<td><code>[height]</code></td>
<td>Image height</td>
<td>512</td>
</tr>
<tr>
<td><code>[styles]</code></td>
<td>Name of the chosen Styles</td>
<td>my style name</td>
</tr>
<tr>
<td><code>[date]</code></td>
<td>Date of the computer in ISO format</td>
<td>2022-10-24</td>
</tr>
<tr>
<td><code>[datetime]</code></td>
<td>Datetime in “%Y%m%d%H%M%S”</td>
<td>20221025013106</td>
</tr>
<tr>
<td><code>[datetime&lt;Format&gt;]</code></td>
<td>Datetime in specified &lt;Format&gt;</td>
<td>[datetime&lt;%Y%m%d_%H%M%S_%f&gt;]<br>20221025_014350_733877</td>
</tr>
<tr>
<td><code>[datetime&lt;Format&gt;&lt;TimeZone&gt;]</code></td>
<td>Datetime at specific &lt;Time Zone&gt; in specified &lt;Format&gt;</td>
<td>[datetime&lt;%Y%m%d_%H%M%S_%f&gt;&lt;Asia/Tokyo&gt;]`<br>20221025_014350_733877</td>
</tr>
<tr>
<td><code>[prompt_no_styles]</code></td>
<td>Prompt without Styles</td>
<td>1girl, white space, ((very important)), [not important], (some value_1.5), (whatever), the end<br></td>
</tr>
<tr>
<td><code>[prompt_spaces]</code></td>
<td>Prompt with Styles</td>
<td>1girl, white space, ((very important)), [not important], (some value_1.5), (whatever), the end<br>, (((crystals texture Hair))),(((</td>
</tr>
<tr>
<td><code>[prompt]</code></td>
<td>Prompt with Styles, <code>Space bar</code> replaced with<code>_</code></td>
<td>1girl,___white_space,_((very_important)),_[not_important],_(some_value_1.5),_(whatever),_the_end,_(((crystals_texture_Hair))),(((</td>
</tr>
<tr>
<td><code>[prompt_words]</code></td>
<td>Prompt with Styles, Bracket and Comma removed</td>
<td>1gir white space very important not important some value 1 5 whatever the end crystals texture Hair , extremely detailed</td>
</tr>
<tr>
<td><code>[prompt_hash]</code></td>
<td>The first 8 characters of the prompt’s SHA-256 hash</td>
<td>1girl -&gt; 6362d0d2<br>(1girl:1.1) -&gt; 0102e068</td>
</tr>
<tr>
<td><code>[clip_skip]</code></td>
<td>CLIP stop at last layers</td>
<td>1</td>
</tr>
<tr>
<td><code>[batch_number]</code></td>
<td>the Nth image in a single batch job</td>
<td>BatchNo_[batch_number] -&gt; BatchNo_3</td>
</tr>
<tr>
<td><code>[batch_size]</code></td>
<td>Batch size</td>
<td>[1234567890,1234567891,1234567892,1234567893] -&gt; 4</td>
</tr>
<tr>
<td><code>[generation_number]</code></td>
<td>the Nth image in an entire job</td>
<td>GenNo_[generation_number] -&gt; GenNo_9</td>
</tr>
<tr>
<td><code>[hasprompt&lt;prompt1\|default&gt;&lt;prompt2&gt;...]</code></td>
<td>if specified <code>prompt</code> is found in prompts then <code>prompt</code> will be added to filename, else <code>default</code> will be added to filename (<code>default</code> can be blank)</td>
<td>[hasprompt<girl><boy>] -&gt; girl<br>[hasprompt&lt;girl|no girl&gt;&lt;boy|no boy&gt;] -&gt; girlno boy</td>
</tr>
</tbody>
</table>
<p>If <code>&lt;Format&gt;</code> is blank or invalid, it will use the default time format “%Y%m%d%H%M%S”
tip: you can use extra characters inside <code>&lt;Format&gt;</code> for punctuation, such as <code>_ -</code></p>
<p>If <code>&lt;TimeZone&gt;</code> is blank or invalid, it will use the default system time zone</p>
<p>If <code>batch size</code> is 1 the <code>[batch_number]</code>, <code>[seed_last]</code> along with the previous segment of text will not be added to filename</p>
<p>If <code>batch size</code> x <code>batch count</code> is 1 the [generation_number] along with the previous segment of text will not be added to filename</p>
<p><code>[batch_number]</code> and <code>[generation_number]</code> along with the previous segment of text will not be added to filename of zip achive.</p>
<p>The Prompts and Style used for the above <code>[prompt]</code> examples
Prompt:</p>
<pre><code>1girl, white space, ((very important)), [not important], (some value:1.5), (whatever), the end
</code></pre>
<p>Selected Styles:</p>
<pre><code>(((crystals texture Hair))),(((((extremely detailed CG))))),((8k_wallpaper))
</code></pre>
<p>note: the <code>Styles</code> mentioned above is referring to the two drop down menu below the generate button</p>
<h3>Datetime Formatting details</h3>
<p>Reference python documentation for more details on <a href="https://docs.python.org/3.10/library/datetime.html#strftime-and-strptime-format-codes">Format Codes</a></p>
<h3>Datetime Time Zone details</h3>
<p>Reference <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/List-of-Time-Zones">List of Time Zones</a> for a list of valid time zones</p>
<h3>if the prompt is too long, it will be cutoff</h3>
<p>this is due to your computer having a maximum file length</p>
<h1>Add / Remove number to filename when saving</h1>
<p>you can remove the prefix number
by unchecking the checkbox under</p>
<p><code>Settings</code> &gt; <code>Saving images/grids</code> &gt; <code>Add number to filename when saving</code></p>
<p>with prefix number</p>
<pre><code>00123-`987654321-((masterpiece)).png
</code></pre>
<p>without prefix number</p>
<pre><code>987654321-((masterpiece)).png
</code></pre>
<h3>Caution</h3>
<p>The purpose of the prefix number is to ensure that the saved image file name is <strong>Unique</strong>.
If you decide to not use the prefix number, make sure that your pattern will generate a unique file name, <strong>otherwise files may be overwritten</strong>.</p>
<p>Generally, datetime down to seconds should be able to guarantee that file name is unique.</p>
<pre><code>[datetime&lt;%Y%m%d_%H%M%S&gt;]-[seed]
</code></pre>
<pre><code>20221025_014350-281391998.png
</code></pre>
<p>But some <strong>Custom Scripts</strong> might generate <strong>multiples images</strong> using the <strong>same seed</strong> in a <strong>single batch</strong>,</p>
<p>in this case it is safer to also use <code>%f</code> for <code>Microsecond as a decimal number, zero-padded to 6 digits.</code></p>
<pre><code>[datetime&lt;%Y%m%d_%H%M%S_%f&gt;]-[seed]
</code></pre>
<pre><code>20221025_014350_733877-281391998.png
</code></pre>
<h1>Filename Pattern Examples</h1>
<p>If you’re running Web-Ui on multiple machines, say on Google Colab and your own Computer, you might want to use a filename with a time as the Prefix.
this is so that when you download the files, you can put them in the same folder.</p>
<p>Also since you don’t know what time zone Google Colab is using, you would want to specify the time zone.</p>
<pre><code>[datetime&lt;%Y%m%d_%H%M%S_%f&gt;&lt;Asia/Tokyo&gt;]-[seed]-[prompt_words]
</code></pre>
<pre><code>20221025_032649_058536-3822510847-1girl.png
</code></pre>
<p>It might also be useful to set Subdirectory the date, so that one folder doesn’t have too many images</p>
<pre><code>[datetime&lt;%Y-%m-%d&gt;&lt;Asia/Tokyo&gt;]
</code></pre>
<pre><code>2022-10-25
</code></pre>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
> the following information is about the image filename and subdirectory name, not the `Paths for saving \ Output directories`
### By default, the Web UI saves images in the output directories and output archive with a filename structure of
Images: `[number]-[seed]-[prompt_spaces]`
```
01234-987654321-((masterpiece)), ((best quality)), ((illustration)), extremely detailed,style girl.png
```
Zip archive: `[datetime]_[[model_name]]_[seed]-[seed_last]`
```
20230530133149_[v1-5-pruned-emaonly]_987654321-987654329.zip
```
A different image filename and optional subdirectory and zip filename can be used if a user wishes.
Image filename pattern can be configured under.
`settings tab` > `Saving images/grids` > `Images filename pattern`
Subdirectory can be configured under settings.
`settings tab` > `Saving to a directory` > `Directory name pattern`
Zip archive can be configured under settings.
`settings tab` > `Saving images/grids` > `Archive filename pattern`
# Patterns
Web-Ui provides several patterns that can be used as placeholders for inserting information into the filename or subdirectory,
user can chain these patterns together, forming a filename that suits their use case.
| Pattern | Description | Example |
|--------------------------------|------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------|
| `[seed]` | Seed | 1234567890 |
| `[seed_first]` | First Seed of batch or Seed of single image | [1234567890,1234567891,1234567892,1234567893] -> 1234567890<br>[1234567891] -> 1234567891
| `[seed_last]` | Last Seed of batch | [1234567890,1234567891,1234567892,1234567893] -> 1234567893
| `[steps]` | Steps | 20 |
| `[cfg]` | CFG scale | 7 |
| `[sampler]` | Sampling method | Euler a |
| `[model_name]` | Name of the model | sd-v1-4
| `[model_hash]` | The first 8 characters of the prompt's SHA-256 hash | 7460a6fa |
| `[width]` | Image width | 512 |
| `[height]` | Image height | 512 |
| `[styles]` | Name of the chosen Styles | my style name |
| `[date]` | Date of the computer in ISO format | 2022-10-24 |
| `[datetime]` | Datetime in "%Y%m%d%H%M%S" | 20221025013106 |
| `[datetime<Format>]` | Datetime in specified \<Format\> | \[datetime<%Y%m%d_%H%M%S_%f>]<br>20221025_014350_733877 |
| `[datetime<Format><TimeZone>]` | Datetime at specific \<Time Zone\> in specified \<Format\> | \[datetime<%Y%m%d_%H%M%S_%f><Asia/Tokyo>]`<br>20221025_014350_733877 |
| `[prompt_no_styles]` | Prompt without Styles | 1girl, white space, ((very important)), [not important], (some value_1.5), (whatever), the end<br> |
| `[prompt_spaces]` | Prompt with Styles | 1girl, white space, ((very important)), [not important], (some value_1.5), (whatever), the end<br>, (((crystals texture Hair))),((( |
| `[prompt]` | Prompt with Styles, `Space bar` replaced with`_` | 1girl,\_\_\_white_space,\_((very\_important)),\_[not\_important],\_(some\_value\_1.5),\_(whatever),\_the\_end,\_(((crystals_texture_Hair))),((( |
| `[prompt_words]` | Prompt with Styles, Bracket and Comma removed | 1gir white space very important not important some value 1 5 whatever the end crystals texture Hair , extremely detailed |
| `[prompt_hash]` | The first 8 characters of the prompt's SHA-256 hash | 1girl -> 6362d0d2<br>(1girl:1.1) -> 0102e068 |
| `[clip_skip]` | CLIP stop at last layers | 1 |
| `[batch_number]` | the Nth image in a single batch job | BatchNo_[batch_number] -> BatchNo_3
| `[batch_size]` | Batch size | [1234567890,1234567891,1234567892,1234567893] -> 4
| `[generation_number]` | the Nth image in an entire job | GenNo_[generation_number] -> GenNo_9
| `[hasprompt<prompt1\|default><prompt2>...]` | if specified `prompt` is found in prompts then `prompt` will be added to filename, else `default` will be added to filename (`default` can be blank) | [hasprompt<girl><boy>] -> girl<br>[hasprompt<girl\|no girl><boy\|no boy>] -> girlno boy
If `<Format>` is blank or invalid, it will use the default time format "%Y%m%d%H%M%S"
tip: you can use extra characters inside `<Format>` for punctuation, such as `_ -`
If `<TimeZone>` is blank or invalid, it will use the default system time zone
If `batch size` is 1 the `[batch_number]`, `[seed_last]` along with the previous segment of text will not be added to filename
If `batch size` x `batch count` is 1 the [generation_number] along with the previous segment of text will not be added to filename
`[batch_number]` and `[generation_number]` along with the previous segment of text will not be added to filename of zip achive.
The Prompts and Style used for the above `[prompt]` examples
Prompt:
```
1girl, white space, ((very important)), [not important], (some value:1.5), (whatever), the end
```
Selected Styles:
```
(((crystals texture Hair))),(((((extremely detailed CG))))),((8k_wallpaper))
```
note: the `Styles` mentioned above is referring to the two drop down menu below the generate button
### Datetime Formatting details
Reference python documentation for more details on [Format Codes](https://docs.python.org/3.10/library/datetime.html#strftime-and-strptime-format-codes)
### Datetime Time Zone details
Reference [List of Time Zones](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/List-of-Time-Zones) for a list of valid time zones
### if the prompt is too long, it will be cutoff
this is due to your computer having a maximum file length
# Add / Remove number to filename when saving
you can remove the prefix number
by unchecking the checkbox under
`Settings` > `Saving images/grids` > `Add number to filename when saving`
with prefix number
```
00123-`987654321-((masterpiece)).png
```
without prefix number
```
987654321-((masterpiece)).png
```
### Caution
The purpose of the prefix number is to ensure that the saved image file name is **Unique**.
If you decide to not use the prefix number, make sure that your pattern will generate a unique file name, **otherwise files may be overwritten**.
Generally, datetime down to seconds should be able to guarantee that file name is unique.
```
[datetime<%Y%m%d_%H%M%S>]-[seed]
```
```
20221025_014350-281391998.png
```
But some **Custom Scripts** might generate **multiples images** using the **same seed** in a **single batch**,
in this case it is safer to also use `%f` for `Microsecond as a decimal number, zero-padded to 6 digits.`
```
[datetime<%Y%m%d_%H%M%S_%f>]-[seed]
```
```
20221025_014350_733877-281391998.png
```
# Filename Pattern Examples
If you're running Web-Ui on multiple machines, say on Google Colab and your own Computer, you might want to use a filename with a time as the Prefix.
this is so that when you download the files, you can put them in the same folder.
Also since you don't know what time zone Google Colab is using, you would want to specify the time zone.
```
[datetime<%Y%m%d_%H%M%S_%f><Asia/Tokyo>]-[seed]-[prompt_words]
```
```
20221025_032649_058536-3822510847-1girl.png
```
It might also be useful to set Subdirectory the date, so that one folder doesn't have too many images
```
[datetime<%Y-%m-%d><Asia/Tokyo>]
```
```
2022-10-25
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Installing and Using Custom Scripts</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>Installing and Using Custom Scripts</h1>
<p>To install custom scripts, place them into the <code>scripts</code> directory and click the <code>Reload custom script</code> button at the bottom in the settings tab. Custom scripts will appear in the lower-left dropdown menu on the txt2img and img2img tabs after being installed. Below are some notable custom scripts created by Web UI users:</p>
<h2>txt2img2img</h2>
<p><a href="https://github.com/ThereforeGames/txt2img2img">https://github.com/ThereforeGames/txt2img2img</a></p>
<p>Greatly improve the editability of any character/subject while retaining their likeness. The main motivation for this script is improving the editability of embeddings created through <a href="https://textual-inversion.github.io/">Textual Inversion</a>.</p>
<p>(be careful with cloning as it has a bit of venv checked in)</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/98228077/200106431-21a22657-db24-4e9c-b7fa-e3a8e9096b89.png" width="624" height="312" />
</details>
<h2>txt2mask</h2>
<p><a href="https://github.com/ThereforeGames/txt2mask">https://github.com/ThereforeGames/txt2mask</a></p>
<p>Allows you to specify an inpainting mask with text, as opposed to the brush.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/95403634/190878562-d020887c-ccb0-411c-ab37-38e2115552eb.png" width="674" height="312" />
</details>
<h2>Mask drawing UI</h2>
<p><a href="https://github.com/dfaker/stable-diffusion-webui-cv2-external-masking-script">https://github.com/dfaker/stable-diffusion-webui-cv2-external-masking-script</a></p>
<p>Provides a local popup window powered by CV2 that allows addition of a mask before processing.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/98228077/200109495-3d6741f1-0e25-4ae5-9f84-d93f886f302a.png" width="302" height="312" />
</details>
<h2>Img2img Video</h2>
<p><a href="https://github.com/memes-forever/Stable-diffusion-webui-video">https://github.com/memes-forever/Stable-diffusion-webui-video</a></p>
<p>Using img2img, generates pictures one after another.</p>
<h2>Advanced Seed Blending</h2>
<p><a href="https://github.com/amotile/stable-diffusion-backend/tree/master/src/process/implementations/automatic1111_scripts">https://github.com/amotile/stable-diffusion-backend/tree/master/src/process/implementations/automatic1111_scripts</a></p>
<p>This script allows you to base the initial noise on multiple weighted seeds.</p>
<p>Ex. <code>seed1:2, seed2:1, seed3:1</code></p>
<p>The weights are normalized so you can use bigger once like above, or you can do floating point numbers:</p>
<p>Ex. <code>seed1:0.5, seed2:0.25, seed3:0.25</code></p>
<h2>Prompt Blending</h2>
<p><a href="https://github.com/amotile/stable-diffusion-backend/tree/master/src/process/implementations/automatic1111_scripts">https://github.com/amotile/stable-diffusion-backend/tree/master/src/process/implementations/automatic1111_scripts</a></p>
<p>This script allows you to combine multiple weighted prompts together by mathematically combining their textual embeddings before generating the image.</p>
<p>Ex.</p>
<p><code>Crystal containing elemental {fire|ice}</code></p>
<p>It supports nested definitions so you can do this as well:</p>
<p><code>Crystal containing elemental {{fire:5|ice}|earth}</code></p>
<h2>Animator</h2>
<p><a href="https://github.com/Animator-Anon/Animator">https://github.com/Animator-Anon/Animator</a></p>
<p>A basic img2img script that will dump frames and build a video file. Suitable for creating interesting zoom in warping movies, but not too much else at this time.</p>
<h2>Parameter Sequencer</h2>
<p><a href="https://github.com/rewbs/sd-parseq">https://github.com/rewbs/sd-parseq</a></p>
<p>Generate videos with tight control and flexible interpolation over many Stable Diffusion parameters (such as seed, scale, prompt weights, denoising strength…), as well as input processing parameter (such as zoom, pan, 3D rotation…)</p>
<h2>Alternate Noise Schedules</h2>
<p><a href="https://gist.github.com/dfaker/f88aa62e3a14b559fe4e5f6b345db664">https://gist.github.com/dfaker/f88aa62e3a14b559fe4e5f6b345db664</a></p>
<p>Uses alternate generators for the sampler’s sigma schedule.</p>
<p>Allows access to Karras, Exponential and Variance Preserving schedules from crowsonkb/k-diffusion along with their parameters.</p>
<h2>Vid2Vid</h2>
<p><a href="https://github.com/Filarius/stable-diffusion-webui/blob/master/scripts/vid2vid.py">https://github.com/Filarius/stable-diffusion-webui/blob/master/scripts/vid2vid.py</a></p>
<p>From real video, img2img the frames and stitch them together. Does not unpack frames to hard drive.</p>
<h2>Txt2VectorGraphics</h2>
<p><a href="https://github.com/GeorgLegato/Txt2Vectorgraphics">https://github.com/GeorgLegato/Txt2Vectorgraphics</a></p>
<p>Create custom, scaleable icons from your prompts as SVG or PDF.</p>
<details><summary>Example: (Click to expand:)</summary>
<table>
<thead>
<tr>
<th style="text-align:left">prompt</th>
<th style="text-align:center">PNG</th>
<th style="text-align:center">SVG</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left">Happy Einstein</td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193370360-506eb6b5-4fa7-4b2a-9fec-6430f6d027f5.png" width="40%" /></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193370379-2680aa2a-f460-44e7-9c4e-592cf096de71.svg" width=30%/></td>
</tr>
<tr>
<td style="text-align:left">Mountainbike Downhill</td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193371353-f0f5ff6f-12f7-423b-a481-f9bd119631dd.png" width=40%/></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193371585-68dea4ca-6c1a-4d31-965d-c1b5f145bb6f.svg" width=30%/></td>
</tr>
<tr>
<td style="text-align:left">coffe mug in shape of a heart</td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193374299-98379ca1-3106-4ceb-bcd3-fa129e30817a.png" width=40%/></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193374525-460395af-9588-476e-bcf6-6a8ad426be8e.svg" width=30%/></td>
</tr>
<tr>
<td style="text-align:left">Headphones</td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193376238-5c4d4a8f-1f06-4ba4-b780-d2fa2e794eda.png" width=40%/></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/7210708/193376255-80e25271-6313-4bff-a98e-ba3ae48538ca.svg" width=30%/></td>
</tr>
</tbody>
</table>
</details>
<h2>Loopback and Superimpose</h2>
<p><a href="https://github.com/DiceOwl/StableDiffusionStuff">https://github.com/DiceOwl/StableDiffusionStuff</a></p>
<p><a href="https://github.com/DiceOwl/StableDiffusionStuff/blob/main/loopback_superimpose.py">https://github.com/DiceOwl/StableDiffusionStuff/blob/main/loopback_superimpose.py</a></p>
<p>Mixes output of img2img with original input image at strength alpha. The result is fed into img2img again (at loop&gt;=2), and this procedure repeats. Tends to sharpen the image, improve consistency, reduce creativity and reduce fine detail.</p>
<h2>Interpolate</h2>
<p><a href="https://github.com/DiceOwl/StableDiffusionStuff">https://github.com/DiceOwl/StableDiffusionStuff</a></p>
<p><a href="https://github.com/DiceOwl/StableDiffusionStuff/blob/main/interpolate.py">https://github.com/DiceOwl/StableDiffusionStuff/blob/main/interpolate.py</a></p>
<p>An img2img script to produce in-between images. Allows two input images for interpolation. More features shown in the <a href="https://github.com/DiceOwl/StableDiffusionStuff">readme</a>.</p>
<h2>Run n times</h2>
<p><a href="https://gist.github.com/camenduru/9ec5f8141db9902e375967e93250860f">https://gist.github.com/camenduru/9ec5f8141db9902e375967e93250860f</a></p>
<p>Run n times with random seed.</p>
<h2>Advanced Loopback</h2>
<p><a href="https://github.com/Extraltodeus/advanced-loopback-for-sd-webui">https://github.com/Extraltodeus/advanced-loopback-for-sd-webui</a></p>
<p>Dynamic zoom loopback with parameters variations and prompt switching amongst other features!</p>
<h2>prompt-morph</h2>
<p><a href="https://github.com/feffy380/prompt-morph">https://github.com/feffy380/prompt-morph</a></p>
<p>Generate morph sequences with Stable Diffusion. Interpolate between two or more prompts and create an image at each step.</p>
<p>Uses the new AND keyword and can optionally export the sequence as a video.</p>
<h2>prompt interpolation</h2>
<p><a href="https://github.com/EugeoSynthesisThirtyTwo/prompt-interpolation-script-for-sd-webui">https://github.com/EugeoSynthesisThirtyTwo/prompt-interpolation-script-for-sd-webui</a></p>
<p>With this script, you can interpolate between two prompts (using the “AND” keyword), generate as many images as you want.
You can also generate a gif with the result. Works for both txt2img and img2img.</p>
<details><summary>Example: (Click to expand:)</summary>
<figure><img src="https://user-images.githubusercontent.com/24735555/195470874-afc3dfdc-7b35-4b23-9c34-5888a4100ac1.gif" alt="gif"></figure>
</details>
<h2>Asymmetric Tiling</h2>
<p><a href="https://github.com/tjm35/asymmetric-tiling-sd-webui/">https://github.com/tjm35/asymmetric-tiling-sd-webui/</a></p>
<p>Control horizontal/vertical seamless tiling independently of each other.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/19196175/195132862-8c050327-92f3-44a4-9c02-0f11cce0b609.png" width="624" height="312" />
</details>
<h2>Force Symmetry</h2>
<p><a href="https://gist.github.com/missionfloyd/69e5a5264ad09ccaab52355b45e7c08f">https://gist.github.com/missionfloyd/69e5a5264ad09ccaab52355b45e7c08f</a></p>
<p>see <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/2441">https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/2441</a></p>
<p>applies symmetry to the image every n steps and sends the result further to img2img.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/83316072/196016119-0a03664b-c3e4-49f0-81ac-a9e719b24bd1.png" width="624" height="312" />
</details>
<h2>txt2palette</h2>
<p><a href="https://github.com/1ort/txt2palette">https://github.com/1ort/txt2palette</a></p>
<p>Generate palettes by text description. This script takes the generated images and converts them into color palettes.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/83316072/199360686-62f0f5ec-ed3d-4c0f-95b4-af9c67d1e248.png" width="352" height="312" />
</details>
<h2>XYZ Plot Script</h2>
<p><a href="https://github.com/xrpgame/xyz_plot_script">https://github.com/xrpgame/xyz_plot_script</a></p>
<p>Generates an .html file to interactively browse the imageset. Use the scroll wheel or arrow keys to move in the Z dimension.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://raw.githubusercontent.com/xrpgame/xyz_plot_script/master/example1.png" width="522" height="312" />
</details>
<h2>Expanded-XY-grid</h2>
<p><a href="https://github.com/0xALIVEBEEF/Expanded-XY-grid">https://github.com/0xALIVEBEEF/Expanded-XY-grid</a></p>
<p>Custom script for AUTOMATIC1111’s stable-diffusion-webui that adds more features to the standard xy grid:</p>
<ul>
<li>
<p>Multitool: Allows multiple parameters in one axis, theoretically allows unlimited parameters to be adjusted in one xy grid</p>
</li>
<li>
<p>Customizable prompt matrix</p>
</li>
<li>
<p>Group files in a directory</p>
</li>
<li>
<p>S/R Placeholder - replace a placeholder value (the first value in the list of parameters) with desired values.</p>
</li>
<li>
<p>Add PNGinfo to grid image</p>
</li>
</ul>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/80003301/202277871-a4a3341b-13f7-42f4-a3e6-ca8f8cd8250a.png" width="574" height="197" />
<p>Example images: Prompt: “darth vader riding a bicycle, modifier”; X: Multitool: “Prompt S/R: bicycle, motorcycle | CFG scale: 7.5, 10 | Prompt S/R Placeholder: modifier, 4k, artstation”; Y: Multitool: “Sampler: Euler, Euler a | Steps: 20, 50”</p>
</details>
<h2>Embedding to PNG</h2>
<p><a href="https://github.com/dfaker/embedding-to-png-script">https://github.com/dfaker/embedding-to-png-script</a></p>
<p>Converts existing embeddings to the shareable image versions.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/35278260/196052398-268a3a3e-0fad-46cd-b37d-9808480ceb18.png" width="263" height="256" />
</details>
<h2>Alpha Canvas</h2>
<p><a href="https://github.com/TKoestlerx/sdexperiments">https://github.com/TKoestlerx/sdexperiments</a></p>
<p>Outpaint a region. Infinite outpainting concept, used the two existing outpainting scripts from the AUTOMATIC1111 repo as a basis.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/86352149/199517938-3430170b-adca-487c-992b-eb89b3b63681.jpg" width="446" height="312" />
</details>
<h2>Random grid</h2>
<p><a href="https://github.com/lilly1987/AI-WEBUI-scripts-Random">https://github.com/lilly1987/AI-WEBUI-scripts-Random</a></p>
<p>Randomly enter xy grid values.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/20321215/197346726-f93b7e84-f808-4167-9969-dc42763eeff1.png" width="198" height="312" />
<p>Basic logic is same as x/y plot, only internally, x type is fixed as step, and type y is fixed as cfg.
Generates x values as many as the number of step counts (10) within the range of step1|2 values (10-30)
Generates x values as many as the number of cfg counts (10) within the range of cfg1|2 values (6-15)
Even if you put the 1|2 range cap upside down, it will automatically change it.
In the case of the cfg value, it is treated as an int type and the decimal value is not read.</p>
</details>
<h2>Random</h2>
<p><a href="https://github.com/lilly1987/AI-WEBUI-scripts-Random">https://github.com/lilly1987/AI-WEBUI-scripts-Random</a></p>
<p>Repeat a simple number of times without a grid.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/20321215/197346617-0ed1cd09-0ddd-48ad-8161-bc1540d628ad.png" width="258" height="312" />
</details>
<h2>Stable Diffusion Aesthetic Scorer</h2>
<p><a href="https://github.com/grexzen/SD-Chad">https://github.com/grexzen/SD-Chad</a></p>
<p>Rates your images.</p>
<h2>img2tiles</h2>
<p><a href="https://github.com/arcanite24/img2tiles">https://github.com/arcanite24/img2tiles</a></p>
<p>generate tiles from a base image. Based on SD upscale script.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://github.com/arcanite24/img2tiles/raw/master/examples/example5.png" width="312" height="312" />
</details>
<h2>img2mosiac</h2>
<p><a href="https://github.com/1ort/img2mosaic">https://github.com/1ort/img2mosaic</a></p>
<p>Generate mosaics from images. The script cuts the image into tiles and processes each tile separately. The size of each tile is chosen randomly.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/83316072/200170569-0e7131e4-1da8-4caf-9cd9-5b785c9d21b0.png" width="758" height="312" />
</details>
<h2>Test my prompt</h2>
<p><a href="https://github.com/Extraltodeus/test_my_prompt">https://github.com/Extraltodeus/test_my_prompt</a></p>
<p>Have you ever used a very long prompt full of words that you are not sure have any actual impact on your image? Did you lose the courage to try to remove them one by one to test if their effects are worthy of your pwescious GPU?</p>
<p>WELL now you don’t need any courage as this script has been MADE FOR YOU!</p>
<p>It generates as many images as there are words in your prompt (you can select the separator of course).</p>
<details><summary>Example: (Click to expand:)</summary>
<p>Here the prompt is simply : “<strong>banana, on fire, snow</strong>” and so as you can see it has generated each image without each description in it.</p>
<img src="https://user-images.githubusercontent.com/15731540/200349119-e45d3cfb-39f0-4999-a8f0-4671a6393824.png" width="512" height="512" />
<p>You can also test your negative prompt.</p>
</details>
<h2>Pixel Art</h2>
<p><a href="https://github.com/C10udburst/stable-diffusion-webui-scripts">https://github.com/C10udburst/stable-diffusion-webui-scripts</a></p>
<p>Simple script which resizes images by a variable amount, also converts image to use a color palette of a given size.</p>
<details><summary>Example: (Click to expand:)</summary>
<table>
<thead>
<tr>
<th style="text-align:center">Disabled</th>
<th style="text-align:center">Enabled x8, no resize back, no color palette</th>
<th style="text-align:center">Enabled x8, no color palette</th>
<th style="text-align:center">Enabled x8, 16 color palette</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/18114966/201491785-e30cfa9d-c850-4853-98b8-11db8de78c8d.png" alt="preview"></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/18114966/201492204-f4303694-e98d-4ea3-8256-538a88ea26b6.png" alt="preview"></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/18114966/201491864-d0c0c9f1-e34f-4cb6-a68e-7043ec5ce74e.png" alt="preview"></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/18114966/201492175-c55fa260-a17d-47c9-a919-9116e1caa8fe.png" alt="preview"></td>
</tr>
</tbody>
</table>
<p><a href="https://publicprompts.art/all-in-one-pixel-art-dreambooth-model/">model used</a></p>
<pre><code class="language-text">japanese pagoda with blossoming cherry trees, full body game asset, in pixelsprite style
Steps: 20, Sampler: DDIM, CFG scale: 7, Seed: 4288895889, Size: 512x512, Model hash: 916ea38c, Batch size: 4
</code></pre>
</details>
<h2>Scripts by FartyPants</h2>
<p><a href="https://github.com/FartyPants/sd_web_ui_scripts">https://github.com/FartyPants/sd_web_ui_scripts</a></p>
<h3>Hallucinate</h3>
<ul>
<li>swaps negative and positive prompts</li>
</ul>
<h3>Mr. Negativity</h3>
<ul>
<li>more advanced script that swaps negative and positive tokens depending on Mr. negativity rage</li>
</ul>
<h2>gif2gif</h2>
<p><a href="https://github.com/LonicaMewinsky/gif2gif">https://github.com/LonicaMewinsky/gif2gif</a></p>
<p>The purpose of this script is to accept an animated gif as input, process frames as img2img typically would, and recombine them back into an animated gif. Not intended to have extensive functionality. Referenced code from prompts_from_file.</p>
<h2>Post-Face-Restore-Again</h2>
<p><a href="https://github.com/butaixianran/Stable-Diffusion-Webui-Post-Face-Restore-Again">https://github.com/butaixianran/Stable-Diffusion-Webui-Post-Face-Restore-Again</a></p>
<p>Run face restore twice in one go, from extras tab.</p>
<h2>Infinite Zoom</h2>
<p><a href="https://github.com/coolzilj/infinite-zoom">https://github.com/coolzilj/infinite-zoom</a></p>
<p>Generate Zoom in/out videos, with outpainting, as a custom script for inpaint mode in img2img tab.</p>
<h2>ImageReward Scorer</h2>
<p><a href="https://github.com/THUDM/ImageReward#integration-into-stable-diffusion-web-ui">https://github.com/THUDM/ImageReward#integration-into-stable-diffusion-web-ui</a></p>
<p>An image <strong>scorer</strong> based on <a href="https://github.com/THUDM/ImageReward">ImageReward</a>, the first general-purpose text-to-image human preference RM, which is trained on in total <strong>137k pairs of expert comparisons</strong>.</p>
<p><a href="https://github.com/THUDM/ImageReward#features"><strong>Features</strong></a> developed to date (2023-04-24) include: (click to expand demo video)</p>
<details>
<summary>1. Score generated images and append to image information</summary>
<p><a href="https://user-images.githubusercontent.com/98524878/233889441-d593675a-dff4-43aa-ad6b-48cc68326fb0.mp4">https://user-images.githubusercontent.com/98524878/233889441-d593675a-dff4-43aa-ad6b-48cc68326fb0.mp4</a></p>
</details>
<details>
<summary>2. Automatically filter out images with low scores</summary>
<p><a href="https://user-images.githubusercontent.com/98524878/233889490-5c4a062f-bb5e-4179-ba98-b336cda4d290.mp4">https://user-images.githubusercontent.com/98524878/233889490-5c4a062f-bb5e-4179-ba98-b336cda4d290.mp4</a></p>
</details>
<p>For details including <strong>installing</strong> and <strong>feature-specific usage</strong>, check <a href="https://github.com/THUDM/ImageReward#integration-into-stable-diffusion-web-ui">the script introduction</a>.</p>
<h2>Saving steps of the sampling process</h2>
<p>(Example Script) <br>
This script will save steps of the sampling process to a directory.</p>
<pre><code class="language-python"><span class="hljs-keyword">import</span> os.path
<span class="hljs-keyword">import</span> modules.scripts <span class="hljs-keyword">as</span> scripts
<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr
<span class="hljs-keyword">from</span> modules <span class="hljs-keyword">import</span> shared, sd_samplers_common
<span class="hljs-keyword">from</span> modules.processing <span class="hljs-keyword">import</span> Processed, process_images
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Script</span><span class="hljs-params">(scripts.Script)</span>:</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">title</span><span class="hljs-params">(self)</span>:</span>
<span class="hljs-keyword">return</span> <span class="hljs-string">"Save steps of the sampling process to files"</span>
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">ui</span><span class="hljs-params">(self, is_img2img)</span>:</span>
path = gr.Textbox(label=<span class="hljs-string">"Save images to path"</span>, placeholder=<span class="hljs-string">"Enter folder path here. Defaults to webui's root folder"</span>)
<span class="hljs-keyword">return</span> [path]
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">run</span><span class="hljs-params">(self, p, path)</span>:</span>
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> os.path.exists(path):
os.makedirs(path)
index = [<span class="hljs-number">0</span>]
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">store_latent</span><span class="hljs-params">(x)</span>:</span>
image = shared.state.current_image = sd_samplers_common.sample_to_image(x)
image.save(os.path.join(path, <span class="hljs-string">f"sample-<span class="hljs-subst">{index[<span class="hljs-number">0</span>]:<span class="hljs-number">05</span>}</span>.png"</span>))
index[<span class="hljs-number">0</span>] += <span class="hljs-number">1</span>
fun(x)
fun = sd_samplers_common.store_latent
sd_samplers_common.store_latent = store_latent
<span class="hljs-keyword">try</span>:
proc = process_images(p)
<span class="hljs-keyword">finally</span>:
sd_samplers_common.store_latent = fun
<span class="hljs-keyword">return</span> Processed(p, proc.images, p.seed, <span class="hljs-string">""</span>)
</code></pre>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# Installing and Using Custom Scripts
To install custom scripts, place them into the `scripts` directory and click the `Reload custom script` button at the bottom in the settings tab. Custom scripts will appear in the lower-left dropdown menu on the txt2img and img2img tabs after being installed. Below are some notable custom scripts created by Web UI users:
## txt2img2img
https://github.com/ThereforeGames/txt2img2img
Greatly improve the editability of any character/subject while retaining their likeness. The main motivation for this script is improving the editability of embeddings created through [Textual Inversion](https://textual-inversion.github.io/).
(be careful with cloning as it has a bit of venv checked in)
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/98228077/200106431-21a22657-db24-4e9c-b7fa-e3a8e9096b89.png" width="624" height="312" />
</details>
## txt2mask
https://github.com/ThereforeGames/txt2mask
Allows you to specify an inpainting mask with text, as opposed to the brush.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/95403634/190878562-d020887c-ccb0-411c-ab37-38e2115552eb.png" width="674" height="312" />
</details>
## Mask drawing UI
https://github.com/dfaker/stable-diffusion-webui-cv2-external-masking-script
Provides a local popup window powered by CV2 that allows addition of a mask before processing.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/98228077/200109495-3d6741f1-0e25-4ae5-9f84-d93f886f302a.png" width="302" height="312" />
</details>
## Img2img Video
https://github.com/memes-forever/Stable-diffusion-webui-video
Using img2img, generates pictures one after another.
## Advanced Seed Blending
https://github.com/amotile/stable-diffusion-backend/tree/master/src/process/implementations/automatic1111_scripts
This script allows you to base the initial noise on multiple weighted seeds.
Ex. `seed1:2, seed2:1, seed3:1`
The weights are normalized so you can use bigger once like above, or you can do floating point numbers:
Ex. `seed1:0.5, seed2:0.25, seed3:0.25`
## Prompt Blending
https://github.com/amotile/stable-diffusion-backend/tree/master/src/process/implementations/automatic1111_scripts
This script allows you to combine multiple weighted prompts together by mathematically combining their textual embeddings before generating the image.
Ex.
`Crystal containing elemental {fire|ice}`
It supports nested definitions so you can do this as well:
`Crystal containing elemental {{fire:5|ice}|earth}`
## Animator
https://github.com/Animator-Anon/Animator
A basic img2img script that will dump frames and build a video file. Suitable for creating interesting zoom in warping movies, but not too much else at this time.
## Parameter Sequencer
https://github.com/rewbs/sd-parseq
Generate videos with tight control and flexible interpolation over many Stable Diffusion parameters (such as seed, scale, prompt weights, denoising strength...), as well as input processing parameter (such as zoom, pan, 3D rotation...)
## Alternate Noise Schedules
https://gist.github.com/dfaker/f88aa62e3a14b559fe4e5f6b345db664
Uses alternate generators for the sampler's sigma schedule.
Allows access to Karras, Exponential and Variance Preserving schedules from crowsonkb/k-diffusion along with their parameters.
## Vid2Vid
https://github.com/Filarius/stable-diffusion-webui/blob/master/scripts/vid2vid.py
From real video, img2img the frames and stitch them together. Does not unpack frames to hard drive.
## Txt2VectorGraphics
https://github.com/GeorgLegato/Txt2Vectorgraphics
Create custom, scaleable icons from your prompts as SVG or PDF.
<details><summary>Example: (Click to expand:)</summary>
| prompt |PNG |SVG |
| :-------- | :-----------------: | :---------------------: |
| Happy Einstein | <img src="https://user-images.githubusercontent.com/7210708/193370360-506eb6b5-4fa7-4b2a-9fec-6430f6d027f5.png" width="40%" /> | <img src="https://user-images.githubusercontent.com/7210708/193370379-2680aa2a-f460-44e7-9c4e-592cf096de71.svg" width=30%/> |
| Mountainbike Downhill | <img src="https://user-images.githubusercontent.com/7210708/193371353-f0f5ff6f-12f7-423b-a481-f9bd119631dd.png" width=40%/> | <img src="https://user-images.githubusercontent.com/7210708/193371585-68dea4ca-6c1a-4d31-965d-c1b5f145bb6f.svg" width=30%/> |
coffe mug in shape of a heart | <img src="https://user-images.githubusercontent.com/7210708/193374299-98379ca1-3106-4ceb-bcd3-fa129e30817a.png" width=40%/> | <img src="https://user-images.githubusercontent.com/7210708/193374525-460395af-9588-476e-bcf6-6a8ad426be8e.svg" width=30%/> |
| Headphones | <img src="https://user-images.githubusercontent.com/7210708/193376238-5c4d4a8f-1f06-4ba4-b780-d2fa2e794eda.png" width=40%/> | <img src="https://user-images.githubusercontent.com/7210708/193376255-80e25271-6313-4bff-a98e-ba3ae48538ca.svg" width=30%/> |
</details>
## Loopback and Superimpose
https://github.com/DiceOwl/StableDiffusionStuff
https://github.com/DiceOwl/StableDiffusionStuff/blob/main/loopback_superimpose.py
Mixes output of img2img with original input image at strength alpha. The result is fed into img2img again (at loop>=2), and this procedure repeats. Tends to sharpen the image, improve consistency, reduce creativity and reduce fine detail.
## Interpolate
https://github.com/DiceOwl/StableDiffusionStuff
https://github.com/DiceOwl/StableDiffusionStuff/blob/main/interpolate.py
An img2img script to produce in-between images. Allows two input images for interpolation. More features shown in the [readme](https://github.com/DiceOwl/StableDiffusionStuff).
## Run n times
https://gist.github.com/camenduru/9ec5f8141db9902e375967e93250860f
Run n times with random seed.
## Advanced Loopback
https://github.com/Extraltodeus/advanced-loopback-for-sd-webui
Dynamic zoom loopback with parameters variations and prompt switching amongst other features!
## prompt-morph
https://github.com/feffy380/prompt-morph
Generate morph sequences with Stable Diffusion. Interpolate between two or more prompts and create an image at each step.
Uses the new AND keyword and can optionally export the sequence as a video.
## prompt interpolation
https://github.com/EugeoSynthesisThirtyTwo/prompt-interpolation-script-for-sd-webui
With this script, you can interpolate between two prompts (using the "AND" keyword), generate as many images as you want.
You can also generate a gif with the result. Works for both txt2img and img2img.
<details><summary>Example: (Click to expand:)</summary>
![gif](https://user-images.githubusercontent.com/24735555/195470874-afc3dfdc-7b35-4b23-9c34-5888a4100ac1.gif)
</details>
## Asymmetric Tiling
https://github.com/tjm35/asymmetric-tiling-sd-webui/
Control horizontal/vertical seamless tiling independently of each other.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/19196175/195132862-8c050327-92f3-44a4-9c02-0f11cce0b609.png" width="624" height="312" />
</details>
## Force Symmetry
https://gist.github.com/missionfloyd/69e5a5264ad09ccaab52355b45e7c08f
see https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/2441
applies symmetry to the image every n steps and sends the result further to img2img.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/83316072/196016119-0a03664b-c3e4-49f0-81ac-a9e719b24bd1.png" width="624" height="312" />
</details>
## txt2palette
https://github.com/1ort/txt2palette
Generate palettes by text description. This script takes the generated images and converts them into color palettes.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/83316072/199360686-62f0f5ec-ed3d-4c0f-95b4-af9c67d1e248.png" width="352" height="312" />
</details>
## XYZ Plot Script
https://github.com/xrpgame/xyz_plot_script
Generates an .html file to interactively browse the imageset. Use the scroll wheel or arrow keys to move in the Z dimension.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://raw.githubusercontent.com/xrpgame/xyz_plot_script/master/example1.png" width="522" height="312" />
</details>
## Expanded-XY-grid
https://github.com/0xALIVEBEEF/Expanded-XY-grid
Custom script for AUTOMATIC1111's stable-diffusion-webui that adds more features to the standard xy grid:
- Multitool: Allows multiple parameters in one axis, theoretically allows unlimited parameters to be adjusted in one xy grid
- Customizable prompt matrix
- Group files in a directory
- S/R Placeholder - replace a placeholder value (the first value in the list of parameters) with desired values.
- Add PNGinfo to grid image
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/80003301/202277871-a4a3341b-13f7-42f4-a3e6-ca8f8cd8250a.png" width="574" height="197" />
Example images: Prompt: "darth vader riding a bicycle, modifier"; X: Multitool: "Prompt S/R: bicycle, motorcycle | CFG scale: 7.5, 10 | Prompt S/R Placeholder: modifier, 4k, artstation"; Y: Multitool: "Sampler: Euler, Euler a | Steps: 20, 50"
</details>
## Embedding to PNG
https://github.com/dfaker/embedding-to-png-script
Converts existing embeddings to the shareable image versions.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/35278260/196052398-268a3a3e-0fad-46cd-b37d-9808480ceb18.png" width="263" height="256" />
</details>
## Alpha Canvas
https://github.com/TKoestlerx/sdexperiments
Outpaint a region. Infinite outpainting concept, used the two existing outpainting scripts from the AUTOMATIC1111 repo as a basis.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/86352149/199517938-3430170b-adca-487c-992b-eb89b3b63681.jpg" width="446" height="312" />
</details>
## Random grid
https://github.com/lilly1987/AI-WEBUI-scripts-Random
Randomly enter xy grid values.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/20321215/197346726-f93b7e84-f808-4167-9969-dc42763eeff1.png" width="198" height="312" />
Basic logic is same as x/y plot, only internally, x type is fixed as step, and type y is fixed as cfg.
Generates x values as many as the number of step counts (10) within the range of step1|2 values (10-30)
Generates x values as many as the number of cfg counts (10) within the range of cfg1|2 values (6-15)
Even if you put the 1|2 range cap upside down, it will automatically change it.
In the case of the cfg value, it is treated as an int type and the decimal value is not read.
</details>
## Random
https://github.com/lilly1987/AI-WEBUI-scripts-Random
Repeat a simple number of times without a grid.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/20321215/197346617-0ed1cd09-0ddd-48ad-8161-bc1540d628ad.png" width="258" height="312" />
</details>
## Stable Diffusion Aesthetic Scorer
https://github.com/grexzen/SD-Chad
Rates your images.
## img2tiles
https://github.com/arcanite24/img2tiles
generate tiles from a base image. Based on SD upscale script.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://github.com/arcanite24/img2tiles/raw/master/examples/example5.png" width="312" height="312" />
</details>
## img2mosiac
https://github.com/1ort/img2mosaic
Generate mosaics from images. The script cuts the image into tiles and processes each tile separately. The size of each tile is chosen randomly.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://user-images.githubusercontent.com/83316072/200170569-0e7131e4-1da8-4caf-9cd9-5b785c9d21b0.png" width="758" height="312" />
</details>
## Test my prompt
https://github.com/Extraltodeus/test_my_prompt
Have you ever used a very long prompt full of words that you are not sure have any actual impact on your image? Did you lose the courage to try to remove them one by one to test if their effects are worthy of your pwescious GPU?
WELL now you don't need any courage as this script has been MADE FOR YOU!
It generates as many images as there are words in your prompt (you can select the separator of course).
<details><summary>Example: (Click to expand:)</summary>
Here the prompt is simply : "**banana, on fire, snow**" and so as you can see it has generated each image without each description in it.
<img src="https://user-images.githubusercontent.com/15731540/200349119-e45d3cfb-39f0-4999-a8f0-4671a6393824.png" width="512" height="512" />
You can also test your negative prompt.
</details>
## Pixel Art
https://github.com/C10udburst/stable-diffusion-webui-scripts
Simple script which resizes images by a variable amount, also converts image to use a color palette of a given size.
<details><summary>Example: (Click to expand:)</summary>
| Disabled | Enabled x8, no resize back, no color palette | Enabled x8, no color palette | Enabled x8, 16 color palette |
| :---: | :---: | :---: | :---: |
|![preview](https://user-images.githubusercontent.com/18114966/201491785-e30cfa9d-c850-4853-98b8-11db8de78c8d.png) | ![preview](https://user-images.githubusercontent.com/18114966/201492204-f4303694-e98d-4ea3-8256-538a88ea26b6.png) | ![preview](https://user-images.githubusercontent.com/18114966/201491864-d0c0c9f1-e34f-4cb6-a68e-7043ec5ce74e.png) | ![preview](https://user-images.githubusercontent.com/18114966/201492175-c55fa260-a17d-47c9-a919-9116e1caa8fe.png) |
[model used](https://publicprompts.art/all-in-one-pixel-art-dreambooth-model/)
```text
japanese pagoda with blossoming cherry trees, full body game asset, in pixelsprite style
Steps: 20, Sampler: DDIM, CFG scale: 7, Seed: 4288895889, Size: 512x512, Model hash: 916ea38c, Batch size: 4
```
</details>
## Scripts by FartyPants
https://github.com/FartyPants/sd_web_ui_scripts
### Hallucinate
- swaps negative and positive prompts
### Mr. Negativity
- more advanced script that swaps negative and positive tokens depending on Mr. negativity rage
## gif2gif
https://github.com/LonicaMewinsky/gif2gif
The purpose of this script is to accept an animated gif as input, process frames as img2img typically would, and recombine them back into an animated gif. Not intended to have extensive functionality. Referenced code from prompts_from_file.
## Post-Face-Restore-Again
https://github.com/butaixianran/Stable-Diffusion-Webui-Post-Face-Restore-Again
Run face restore twice in one go, from extras tab.
## Infinite Zoom
https://github.com/coolzilj/infinite-zoom
Generate Zoom in/out videos, with outpainting, as a custom script for inpaint mode in img2img tab.
## ImageReward Scorer
https://github.com/THUDM/ImageReward#integration-into-stable-diffusion-web-ui
An image **scorer** based on [ImageReward](https://github.com/THUDM/ImageReward), the first general-purpose text-to-image human preference RM, which is trained on in total **137k pairs of expert comparisons**.
[**Features**](https://github.com/THUDM/ImageReward#features) developed to date (2023-04-24) include: (click to expand demo video)
<details>
<summary>1. Score generated images and append to image information</summary>
https://user-images.githubusercontent.com/98524878/233889441-d593675a-dff4-43aa-ad6b-48cc68326fb0.mp4
</details>
<details>
<summary>2. Automatically filter out images with low scores</summary>
https://user-images.githubusercontent.com/98524878/233889490-5c4a062f-bb5e-4179-ba98-b336cda4d290.mp4
</details>
For details including **installing** and **feature-specific usage**, check [the script introduction](https://github.com/THUDM/ImageReward#integration-into-stable-diffusion-web-ui).
## Saving steps of the sampling process
(Example Script) \
This script will save steps of the sampling process to a directory.
```python
import os.path
import modules.scripts as scripts
import gradio as gr
from modules import shared, sd_samplers_common
from modules.processing import Processed, process_images
class Script(scripts.Script):
def title(self):
return "Save steps of the sampling process to files"
def ui(self, is_img2img):
path = gr.Textbox(label="Save images to path", placeholder="Enter folder path here. Defaults to webui's root folder")
return [path]
def run(self, p, path):
if not os.path.exists(path):
os.makedirs(path)
index = [0]
def store_latent(x):
image = shared.state.current_image = sd_samplers_common.sample_to_image(x)
image.save(os.path.join(path, f"sample-{index[0]:05}.png"))
index[0] += 1
fun(x)
fun = sd_samplers_common.store_latent
sd_samplers_common.store_latent = store_latent
try:
proc = process_images(p)
finally:
sd_samplers_common.store_latent = fun
return Processed(p, proc.images, p.seed, "")
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Required Dependencies</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>Required Dependencies</h1>
<ol>
<li>Python 3.10.6 and Git:
<ul>
<li>Windows: download and run installers for Python 3.10.6 (<a href="https://www.python.org/downloads/release/python-3106/">webpage</a>, <a href="https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe">exe</a>, or <a href="https://github.com/adang1345/PythonWin7/raw/master/3.10.6/python-3.10.6-amd64-full.exe">win7 version</a>) and git (<a href="https://git-scm.com/download/win">webpage</a>)</li>
<li>Linux (Debian-based): <code>sudo apt install wget git python3 python3-venv</code></li>
<li>Linux (Red Hat-based): <code>sudo dnf install wget git python3</code></li>
<li>Linux (Arch-based): <code>sudo pacman -S wget git python3</code></li>
</ul>
</li>
<li>Code from this repository:
<ul>
<li>preferred way: using git: <code>git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git</code>.
<ul>
<li>This way is preferred because it lets you update by just running <code>git pull</code>.</li>
<li>Those commands can be used from command line window that opens after you right click in Explorer and select “Git Bash here”.</li>
</ul>
</li>
<li>alternative way: use the “Code” (green button) -&gt; “Download ZIP” option on the main page of the repo.
<ul>
<li>You still need to install git even if you choose this.</li>
<li>To update, you’ll have to download zip again and replace files.</li>
</ul>
</li>
</ul>
</li>
</ol>
<h1>Optional Dependencies</h1>
<h2>ESRGAN (Upscaling)</h2>
<p>Additional finetuned ESRGAN models such as those from the <a href="https://upscale.wiki/wiki/Model_Database">Model Database</a>, may be placed into the ESRGAN directory. ESRGAN directory doesn’t exist in the repo, until you run for the first time.</p>
<p>The models will be loaded as a model if it has <code>.pth</code> extension, and it will show up with its name in the UI.</p>
<blockquote>
<p>Note: RealESRGAN models are not ESRGAN models, they are not compatible. Do not download RealESRGAN models. Do not place RealESRGAN into the directory with ESRGAN models.</p>
</blockquote>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# Required Dependencies
1. Python 3.10.6 and Git:
- Windows: download and run installers for Python 3.10.6 ([webpage](https://www.python.org/downloads/release/python-3106/), [exe](https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe), or [win7 version](https://github.com/adang1345/PythonWin7/raw/master/3.10.6/python-3.10.6-amd64-full.exe)) and git ([webpage](https://git-scm.com/download/win))
- Linux (Debian-based): `sudo apt install wget git python3 python3-venv`
- Linux (Red Hat-based): `sudo dnf install wget git python3`
- Linux (Arch-based): `sudo pacman -S wget git python3`
2. Code from this repository:
- preferred way: using git: `git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git`.
- This way is preferred because it lets you update by just running `git pull`.
- Those commands can be used from command line window that opens after you right click in Explorer and select "Git Bash here".
- alternative way: use the "Code" (green button) -> "Download ZIP" option on the main page of the repo.
- You still need to install git even if you choose this.
- To update, you'll have to download zip again and replace files.
# Optional Dependencies
## ESRGAN (Upscaling)
Additional finetuned ESRGAN models such as those from the [Model Database](https://upscale.wiki/wiki/Model_Database), may be placed into the ESRGAN directory. ESRGAN directory doesn't exist in the repo, until you run for the first time.
The models will be loaded as a model if it has `.pth` extension, and it will show up with its name in the UI.
> Note: RealESRGAN models are not ESRGAN models, they are not compatible. Do not download RealESRGAN models. Do not place RealESRGAN into the directory with ESRGAN models.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Developing-custom-scripts.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>The Script class definition can be found in <code>modules/scripts.py</code>. To create your own custom script, create a python script that implements the class and drop it into the <code>scripts</code> folder, using the below example or other scripts already in the folder as a guide.</p>
<p>The Script class has four primary methods, described in further detail below with a simple example script that rotates and/or flips generated images.</p>
<pre><code class="language-python"><span class="hljs-keyword">import</span> modules.scripts <span class="hljs-keyword">as</span> scripts
<span class="hljs-keyword">import</span> gradio <span class="hljs-keyword">as</span> gr
<span class="hljs-keyword">import</span> os
<span class="hljs-keyword">from</span> modules <span class="hljs-keyword">import</span> images
<span class="hljs-keyword">from</span> modules.processing <span class="hljs-keyword">import</span> process_images, Processed
<span class="hljs-keyword">from</span> modules.processing <span class="hljs-keyword">import</span> Processed
<span class="hljs-keyword">from</span> modules.shared <span class="hljs-keyword">import</span> opts, cmd_opts, state
<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Script</span><span class="hljs-params">(scripts.Script)</span>:</span>
<span class="hljs-comment"># The title of the script. This is what will be displayed in the dropdown menu.</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">title</span><span class="hljs-params">(self)</span>:</span>
        <span class="hljs-keyword">return</span> <span class="hljs-string">"Flip/Rotate Output"</span>
<span class="hljs-comment"># Determines when the script should be shown in the dropdown menu via the </span>
<span class="hljs-comment"># returned value. As an example:</span>
<span class="hljs-comment"># is_img2img is True if the current tab is img2img, and False if it is txt2img.</span>
<span class="hljs-comment"># Thus, return is_img2img to only show the script on the img2img tab.</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">show</span><span class="hljs-params">(self, is_img2img)</span>:</span>
        <span class="hljs-keyword">return</span> is_img2img
<span class="hljs-comment"># How the script's is displayed in the UI. See https://gradio.app/docs/#components</span>
<span class="hljs-comment"># for the different UI components you can use and how to create them.</span>
<span class="hljs-comment"># Most UI components can return a value, such as a boolean for a checkbox.</span>
<span class="hljs-comment"># The returned values are passed to the run method as parameters.</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">ui</span><span class="hljs-params">(self, is_img2img)</span>:</span>
        angle = gr.Slider(minimum=<span class="hljs-number">0.0</span>, maximum=<span class="hljs-number">360.0</span>, step=<span class="hljs-number">1</span>, value=<span class="hljs-number">0</span>,
        label=<span class="hljs-string">"Angle"</span>)
        hflip = gr.Checkbox(<span class="hljs-literal">False</span>, label=<span class="hljs-string">"Horizontal flip"</span>)
        vflip = gr.Checkbox(<span class="hljs-literal">False</span>, label=<span class="hljs-string">"Vertical flip"</span>)
        overwrite = gr.Checkbox(<span class="hljs-literal">False</span>, label=<span class="hljs-string">"Overwrite existing files"</span>)
        <span class="hljs-keyword">return</span> [angle, hflip, vflip, overwrite]
<span class="hljs-comment"># This is where the additional processing is implemented. The parameters include</span>
<span class="hljs-comment"># self, the model object "p" (a StableDiffusionProcessing class, see</span>
<span class="hljs-comment"># processing.py), and the parameters returned by the ui method.</span>
<span class="hljs-comment"># Custom functions can be defined here, and additional libraries can be imported </span>
<span class="hljs-comment"># to be used in processing. The return value should be a Processed object, which is</span>
<span class="hljs-comment"># what is returned by the process_images method.</span>
    <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">run</span><span class="hljs-params">(self, p, angle, hflip, vflip, overwrite)</span>:</span>
        <span class="hljs-comment"># function which takes an image from the Processed object, </span>
<span class="hljs-comment"># and the angle and two booleans indicating horizontal and</span>
        <span class="hljs-comment"># vertical flips from the UI, then returns the </span>
        <span class="hljs-comment"># image rotated and flipped accordingly</span>
        <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">rotate_and_flip</span><span class="hljs-params">(im, angle, hflip, vflip)</span>:</span>
            <span class="hljs-keyword">from</span> PIL <span class="hljs-keyword">import</span> Image
           
            raf = im
           
            <span class="hljs-keyword">if</span> angle != <span class="hljs-number">0</span>:
                raf = raf.rotate(angle, expand=<span class="hljs-literal">True</span>)
            <span class="hljs-keyword">if</span> hflip:
                raf = raf.transpose(Image.FLIP_LEFT_RIGHT)
            <span class="hljs-keyword">if</span> vflip:
                raf = raf.transpose(Image.FLIP_TOP_BOTTOM)
            <span class="hljs-keyword">return</span> raf
        <span class="hljs-comment"># If overwrite is false, append the rotation information to the filename</span>
        <span class="hljs-comment"># using the "basename" parameter and save it in the same directory.</span>
        <span class="hljs-comment"># If overwrite is true, stop the model from saving its outputs and</span>
        <span class="hljs-comment"># save the rotated and flipped images instead.</span>
        basename = <span class="hljs-string">""</span>
        <span class="hljs-keyword">if</span>(<span class="hljs-keyword">not</span> overwrite):
            <span class="hljs-keyword">if</span> angle != <span class="hljs-number">0</span>:
                basename += <span class="hljs-string">"rotated_"</span> + str(angle)
            <span class="hljs-keyword">if</span> hflip:
                basename += <span class="hljs-string">"_hflip"</span>
            <span class="hljs-keyword">if</span> vflip:
                basename += <span class="hljs-string">"_vflip"</span>
        <span class="hljs-keyword">else</span>:
            p.do_not_save_samples = <span class="hljs-literal">True</span>
        proc = process_images(p)
        <span class="hljs-comment"># rotate and flip each image in the processed images</span>
<span class="hljs-comment"># use the save_images method from images.py to save</span>
<span class="hljs-comment"># them.</span>
        <span class="hljs-keyword">for</span> i <span class="hljs-keyword">in</span> range(len(proc.images)):
            proc.images[i] = rotate_and_flip(proc.images[i], angle, hflip, vflip)
            images.save_image(proc.images[i], p.outpath_samples, basename,
            proc.seed + i, proc.prompt, opts.samples_format, info= proc.info, p=p)
        <span class="hljs-keyword">return</span> proc
</code></pre>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
The Script class definition can be found in `modules/scripts.py`. To create your own custom script, create a python script that implements the class and drop it into the `scripts` folder, using the below example or other scripts already in the folder as a guide.
The Script class has four primary methods, described in further detail below with a simple example script that rotates and/or flips generated images.
```python
import modules.scripts as scripts
import gradio as gr
import os
from modules import images
from modules.processing import process_images, Processed
from modules.processing import Processed
from modules.shared import opts, cmd_opts, state
class Script(scripts.Script):
# The title of the script. This is what will be displayed in the dropdown menu.
    def title(self):
        return "Flip/Rotate Output"
# Determines when the script should be shown in the dropdown menu via the
# returned value. As an example:
# is_img2img is True if the current tab is img2img, and False if it is txt2img.
# Thus, return is_img2img to only show the script on the img2img tab.
    def show(self, is_img2img):
        return is_img2img
# How the script's is displayed in the UI. See https://gradio.app/docs/#components
# for the different UI components you can use and how to create them.
# Most UI components can return a value, such as a boolean for a checkbox.
# The returned values are passed to the run method as parameters.
    def ui(self, is_img2img):
        angle = gr.Slider(minimum=0.0, maximum=360.0, step=1, value=0,
        label="Angle")
        hflip = gr.Checkbox(False, label="Horizontal flip")
        vflip = gr.Checkbox(False, label="Vertical flip")
        overwrite = gr.Checkbox(False, label="Overwrite existing files")
        return [angle, hflip, vflip, overwrite]
# This is where the additional processing is implemented. The parameters include
# self, the model object "p" (a StableDiffusionProcessing class, see
# processing.py), and the parameters returned by the ui method.
# Custom functions can be defined here, and additional libraries can be imported
# to be used in processing. The return value should be a Processed object, which is
# what is returned by the process_images method.
    def run(self, p, angle, hflip, vflip, overwrite):
        # function which takes an image from the Processed object,
# and the angle and two booleans indicating horizontal and
        # vertical flips from the UI, then returns the
        # image rotated and flipped accordingly
        def rotate_and_flip(im, angle, hflip, vflip):
            from PIL import Image
           
            raf = im
           
            if angle != 0:
                raf = raf.rotate(angle, expand=True)
            if hflip:
                raf = raf.transpose(Image.FLIP_LEFT_RIGHT)
            if vflip:
                raf = raf.transpose(Image.FLIP_TOP_BOTTOM)
            return raf
        # If overwrite is false, append the rotation information to the filename
        # using the "basename" parameter and save it in the same directory.
        # If overwrite is true, stop the model from saving its outputs and
        # save the rotated and flipped images instead.
        basename = ""
        if(not overwrite):
            if angle != 0:
                basename += "rotated_" + str(angle)
            if hflip:
                basename += "_hflip"
            if vflip:
                basename += "_vflip"
        else:
            p.do_not_save_samples = True
        proc = process_images(p)
        # rotate and flip each image in the processed images
# use the save_images method from images.py to save
# them.
        for i in range(len(proc.images)):
            proc.images[i] = rotate_and_flip(proc.images[i], angle, hflip, vflip)
            images.save_image(proc.images[i], p.outpath_samples, basename,
            proc.seed + i, proc.prompt, opts.samples_format, info= proc.info, p=p)
        return proc
```
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Developing-extensions.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p><a href="#Official-Extension-Index">Adding to Index</a></p>
<p>An extension is just a subdirectory in the <code>extensions</code> directory.</p>
<p>Web ui interacts with installed extensions in the following way:</p>
<ul>
<li>extension’s <code>install.py</code> script, if it exists, is executed.</li>
<li>extension’s scripts in the <code>scripts</code> directory are executed as if they were just usual user scripts, except:
<ul>
<li><code>sys.path</code> is extended to include the extension directory, so you can import anything in it without worrying</li>
<li>you can use <code>scripts.basedir()</code> to get the current extension’s directory (since user can name it anything he wants)</li>
</ul>
</li>
<li>extension’s javascript files in the <code>javascript</code> directory are added to the page</li>
<li>extension’s localization files in the <code>localizations</code> directory are added to settings; if there are two localizations with same name, they are not merged, one replaces another.</li>
<li>extension’s <code>style.css</code> file is added to the page</li>
<li>if extension has <code>preload.py</code> file in its root directory, it is loaded before parsing commandline args</li>
<li>if extension’s <code>preload.py</code> has a <code>preload</code> function, it is called, and commandline args parser is passed to it as an argument. Here’s an example of how to use it to add a command line argument:</li>
</ul>
<pre><code class="language-python"><span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">preload</span><span class="hljs-params">(parser)</span>:</span>
parser.add_argument(<span class="hljs-string">"--wildcards-dir"</span>, type=str, help=<span class="hljs-string">"directory with wildcards"</span>, default=<span class="hljs-literal">None</span>)
</code></pre>
<p>For how to develop custom scripts, which usually will do most of extension’s work, see <a href="Developing-custom-scripts">Developing custom scripts</a>.</p>
<h2>Localization extensions</h2>
<p>The preferred way to do localizations for the project is via making an extension. The basic file structure for the extension should be:</p>
<pre><code>
📁 webui root directory
┗━━ 📁 extensions
┗━━ 📁 webui-localization-la_LA &lt;----- name of extension
┗━━ 📁 localizations &lt;----- the single directory inside the extension
┗━━ 📄 la_LA.json &lt;----- actual file with translations
</code></pre>
<p>Create a github repository with this file structure and ask any of people listed in collaborators section to add your extension to wiki.</p>
<p>If your language needs javascript/css or even python support, you can add that to the extension too.</p>
<h2><a href="http://install.py">install.py</a></h2>
<p><code>install.py</code> is the script that is launched by the <code>launch.py</code>, the launcher, in a separate process before webui starts, and it’s meant to install dependencies of the extension. It must be located in the root directory of the extension, not in the scripts directory. The script is launched with <code>PYTHONPATH</code> environment variable set to webui’s path, so you can just <code>import launch</code> and use its functionality:</p>
<pre><code class="language-python"><span class="hljs-keyword">import</span> launch
<span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> launch.is_installed(<span class="hljs-string">"aitextgen"</span>):
launch.run_pip(<span class="hljs-string">"install aitextgen==0.6.0"</span>, <span class="hljs-string">"requirements for MagicPrompt"</span>)
</code></pre>
<h2>Minor tips</h2>
<h3>Adding extra textual inversion dirs</h3>
<p>This code goes into extension’s script:</p>
<pre><code class="language-python">path = os.path.join(modules.scripts.basedir(), <span class="hljs-string">"embeddings"</span>)
modules.sd_hijack.model_hijack.embedding_db.add_embedding_dir(path)
</code></pre>
<h2>User Examples</h2>
<p><a href="https://github.com/udon-universe/stable-diffusion-webui-extension-templates">https://github.com/udon-universe/stable-diffusion-webui-extension-templates</a> <br>
<a href="https://github.com/AliceQAQ/sd-webui-gradio-demo">https://github.com/AliceQAQ/sd-webui-gradio-demo</a> <br>
<a href="https://github.com/wcdnail/sd-web-ui-wexperimental">https://github.com/wcdnail/sd-web-ui-wexperimental</a> <br>
<a href="https://github.com/EnsignMK/ExampleSendText">https://github.com/EnsignMK/ExampleSendText</a></p>
<h2>Official Extension Index</h2>
<ul>
<li>Add extensions here - <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-extensions">https://github.com/AUTOMATIC1111/stable-diffusion-webui-extensions</a></li>
</ul>
<p>(additionally, you could add working commit versions of your extensions+webui here: )</p>
<ul>
<li><a href="https://github.com/camenduru/sd-webui-extension-records">https://github.com/camenduru/sd-webui-extension-records</a></li>
</ul>
<h2>Internals Diagram by <a href="https://github.com/hananbeer">@hananbeer</a></h2>
<ul>
<li><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8601">https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8601</a></li>
</ul>
<p><a href="https://miro.com/app/board/uXjVMdgY-TY=/?share_link_id=547908852229">https://miro.com/app/board/uXjVMdgY-TY=/?share_link_id=547908852229</a></p>
<figure><img src="https://user-images.githubusercontent.com/98228077/229259967-15556a72-774c-44ba-bab5-687f854a0fc7.png" alt="image"></figure>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
[Adding to Index](#Official-Extension-Index)
An extension is just a subdirectory in the `extensions` directory.
Web ui interacts with installed extensions in the following way:
- extension's `install.py` script, if it exists, is executed.
- extension's scripts in the `scripts` directory are executed as if they were just usual user scripts, except:
- `sys.path` is extended to include the extension directory, so you can import anything in it without worrying
- you can use `scripts.basedir()` to get the current extension's directory (since user can name it anything he wants)
- extension's javascript files in the `javascript` directory are added to the page
- extension's localization files in the `localizations` directory are added to settings; if there are two localizations with same name, they are not merged, one replaces another.
- extension's `style.css` file is added to the page
- if extension has `preload.py` file in its root directory, it is loaded before parsing commandline args
- if extension's `preload.py` has a `preload` function, it is called, and commandline args parser is passed to it as an argument. Here's an example of how to use it to add a command line argument:
```python
def preload(parser):
parser.add_argument("--wildcards-dir", type=str, help="directory with wildcards", default=None)
```
For how to develop custom scripts, which usually will do most of extension's work, see [Developing custom scripts](Developing-custom-scripts).
## Localization extensions
The preferred way to do localizations for the project is via making an extension. The basic file structure for the extension should be:
```
📁 webui root directory
┗━━ 📁 extensions
┗━━ 📁 webui-localization-la_LA <----- name of extension
┗━━ 📁 localizations <----- the single directory inside the extension
┗━━ 📄 la_LA.json <----- actual file with translations
```
Create a github repository with this file structure and ask any of people listed in collaborators section to add your extension to wiki.
If your language needs javascript/css or even python support, you can add that to the extension too.
## install.py
`install.py` is the script that is launched by the `launch.py`, the launcher, in a separate process before webui starts, and it's meant to install dependencies of the extension. It must be located in the root directory of the extension, not in the scripts directory. The script is launched with `PYTHONPATH` environment variable set to webui's path, so you can just `import launch` and use its functionality:
```python
import launch
if not launch.is_installed("aitextgen"):
launch.run_pip("install aitextgen==0.6.0", "requirements for MagicPrompt")
```
## Minor tips
### Adding extra textual inversion dirs
This code goes into extension's script:
```python
path = os.path.join(modules.scripts.basedir(), "embeddings")
modules.sd_hijack.model_hijack.embedding_db.add_embedding_dir(path)
```
## User Examples
https://github.com/udon-universe/stable-diffusion-webui-extension-templates \
https://github.com/AliceQAQ/sd-webui-gradio-demo \
https://github.com/wcdnail/sd-web-ui-wexperimental \
https://github.com/EnsignMK/ExampleSendText
## Official Extension Index
- Add extensions here - https://github.com/AUTOMATIC1111/stable-diffusion-webui-extensions
(additionally, you could add working commit versions of your extensions+webui here: )
- https://github.com/camenduru/sd-webui-extension-records
## Internals Diagram by [@hananbeer](https://github.com/hananbeer)
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/8601
https://miro.com/app/board/uXjVMdgY-TY=/?share_link_id=547908852229
![image](https://user-images.githubusercontent.com/98228077/229259967-15556a72-774c-44ba-bab5-687f854a0fc7.png)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Extensions-index.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>{
“about”: “This file is Deprecated any changes will be forcibly removed, submit your extension to the index via <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-extensions">https://github.com/AUTOMATIC1111/stable-diffusion-webui-extensions</a>. This file is used by Web UI to show the index of available extensions. It’s in JSON format and is not meant to be viewed by users directly. If you edit the file you must ensure that it’s still a valid JSON.”,
“tags”: {
“script”: “a general extension that adds functionality”,
“localization”: “a localization extension that translates web ui into another language”,
“tab”: “adds a tab”,
“dropdown”: “adds a dropbear in the ui”,
“ads”: “contains ads”,
“installed”: “an extension that is already installed”,
“training”: “new type of training / assists with training.”,
“models”: “conversion and merging related.”,
“UI related”: “enhances the display or user interface experience.”,
“prompting”: “assists with writing words, for prompts.”,
“editing”: “an extension that changes images, not using stable diffusion.”,
“manipulations”: “an extension that changes images with stable diffusion.”,
“online”: “an extension which requires wifi to use, often API related.”,
“animation”: “an extension related to creating videos with stable diffusion.”,
“query”: “extracting info from images.”,
“science”: “experimentation with stable diffusion.”
},
“extensions”: [
{
“name”: “Aesthetic Gradients”,
“url”: “<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients.git">https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients.git</a>”,
“description”: “Allows training an embedding from one or few pictures, specifically meant for applying styles. Also, allows use of these specific embeddings to generated images.”,
“added”: “2022-11-01”,
“tags”: [“tab”, “dropdown”, “training”]
},
{
“name”: “Dreambooth”,
“url”: “<a href="https://github.com/d8ahazard/sd_dreambooth_extension.git">https://github.com/d8ahazard/sd_dreambooth_extension.git</a>”,
“description”: “Dreambooth training based on Shivam Shiaro’s repo, optimized for lower-VRAM GPUs.”,
“added”: “2022-11-07”,
“tags”: [“tab”, “training”]
},
{
“name”: “training-picker”,
“url”: “<a href="https://github.com/Maurdekye/training-picker.git">https://github.com/Maurdekye/training-picker.git</a>”,
“description”: “Adds a tab to the webui that allows the user to automatically extract keyframes from video, and manually extract 512x512 crops of those frames for use in model training.”,
“added”: “2022-11-06”,
“tags”: [“tab”, “training”]
},
{
“name”: “Dataset Tag Editor”,
“url”: “<a href="https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor.git">https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor.git</a>”,
“description”: “Feature-rich UI tab that allows image viewing, search-filtering and editing.”,
“added”: “2022-11-01”,
“tags”: [“tab”, “training”]
},
{
“name”: “DreamArtist”,
“url”: “<a href="https://github.com/7eu7d7/DreamArtist-sd-webui-extension.git">https://github.com/7eu7d7/DreamArtist-sd-webui-extension.git</a>”,
“description”: “Towards Controllable One-Shot Text-to-Image Generation via Contrastive Prompt-Tuning.”,
“added”: “2022-11-15”,
“tags”: [“training”]
},
{
“name”: “WD 1.4 Tagger”,
“url”: “<a href="https://github.com/toriato/stable-diffusion-webui-wd14-tagger.git">https://github.com/toriato/stable-diffusion-webui-wd14-tagger.git</a>”,
“description”: “Interrogates single or multiple image files using various alternative models, similar to deepdanbooru interrogate.”,
“added”: “2022-11-20”,
“tags”: [“tab”, “training”]
},
{
“name”: “Hypernetwork-Monkeypatch-Extension”,
“url”: “<a href="https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension.git">https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension.git</a>”,
“description”: “Extension that provides additional training features for hypernetwork training. Also supports using multiple hypernetworks for inference.”,
“added”: “2023-01-12”,
“tags”: [“tab”, “training”]
},
{
“name”: “Custom Diffusion”,
“url”: “<a href="https://github.com/guaneec/custom-diffusion-webui.git">https://github.com/guaneec/custom-diffusion-webui.git</a>”,
“description”: “Custom Diffusion is, in short, finetuning-lite with TI, instead of tuning the whole model. Similar speed and memory requirements to TI and supposedly gives better results in less steps.”,
“added”: “2023-01-28”,
“tags”: [“tab”, “training”]
},
{
“name”: “Smart Process”,
“url”: “<a href="https://github.com/d8ahazard/sd_smartprocess.git">https://github.com/d8ahazard/sd_smartprocess.git</a>”,
“description”: “Smart pre-process including auto subject identification, caption subject swapping, and upscaling/facial restoration.”,
“added”: “2022-11-12”,
“tags”: [“tab”, “editing”, “training”]
},
{
“name”: “Embeddings editor”,
“url”: “<a href="https://github.com/CodeExplode/stable-diffusion-webui-embedding-editor.git">https://github.com/CodeExplode/stable-diffusion-webui-embedding-editor.git</a>”,
“description”: “Allows you to manually edit textual inversion embeddings using sliders.”,
“added”: “2022-11-06”,
“tags”: [“tab”, “models”]
},
{
“name”: “embedding-inspector”,
“url”: “<a href="https://github.com/tkalayci71/embedding-inspector.git">https://github.com/tkalayci71/embedding-inspector.git</a>”,
“description”: “Inspect any token(a word) or Textual-Inversion embeddings and find out which embeddings are similar. You can mix, modify, or create the embeddings in seconds.”,
“added”: “2022-12-06”,
“tags”: [“tab”, “models”]
},
{
“name”: “Merge Board”,
“url”: “<a href="https://github.com/bbc-mc/sdweb-merge-board.git">https://github.com/bbc-mc/sdweb-merge-board.git</a>”,
“description”: “Multiple lane merge support(up to 10). Save and Load your merging combination as Recipes, which is simple text.”,
“added”: “2022-11-21”,
“tags”: [“tab”, “models”]
},
{
“name”: “Model Converter”,
“url”: “<a href="https://github.com/Akegarasu/sd-webui-model-converter.git">https://github.com/Akegarasu/sd-webui-model-converter.git</a>”,
“description”: “Convert models to fp16/bf16 no-ema/ema-only safetensors. Convert/copy/delete any parts of model: unet, text encoder(clip), vae.”,
“added”: “2023-01-05”,
“tags”: [“tab”, “models”]
},
{
“name”: “Kohya-ss Additional Networks”,
“url”: “<a href="https://github.com/kohya-ss/sd-webui-additional-networks.git">https://github.com/kohya-ss/sd-webui-additional-networks.git</a>”,
“description”: “Allows the Web UI to use LoRAs (1.X and 2.X) to generate images. Also allows editing .safetensors networks prompt metadata.”,
“added”: “2023-01-06”,
“tags”: [“models”]
},
{
“name”: “Merge Block Weighted”,
“url”: “<a href="https://github.com/bbc-mc/sdweb-merge-block-weighted-gui.git">https://github.com/bbc-mc/sdweb-merge-block-weighted-gui.git</a>”,
“description”: “Merge models with separate rate for each 25 U-Net block (input, middle, output).”,
“added”: “2023-01-13”,
“tags”: [“tab”, “models”]
},
{
“name”: “Embedding Merge”,
“url”: “<a href="https://github.com/klimaleksus/stable-diffusion-webui-embedding-merge.git">https://github.com/klimaleksus/stable-diffusion-webui-embedding-merge.git</a>”,
“description”: “Merging Textual Inversion embeddings at runtime from string literals. Phrases and weight values also supported.”,
“added”: “2023-02-09”,
“tags”: [“tab”, “models”, “manipulations”]
},
{
“name”: “SuperMerger”,
“url”: “<a href="https://github.com/hako-mikan/sd-webui-supermerger.git">https://github.com/hako-mikan/sd-webui-supermerger.git</a>”,
“description”: “Merge and run without saving to drive. Sequential XY merge generations; extract and merge loras, bind loras to ckpt, merge block weights, and more.”,
“added”: “2023-02-18”,
“tags”: [“tab”, “models”]
},
{
“name”: “LoRA Block Weight”,
“url”: “<a href="https://github.com/hako-mikan/sd-webui-lora-block-weight.git">https://github.com/hako-mikan/sd-webui-lora-block-weight.git</a>”,
“description”: “Applies LoRA strength; block by block on the fly. Includes presets, weight analysis, randomization, XY plot.”,
“added”: “2023-02-28”,
“tags”: [“models”]
},
{
“name”: “Image browser”,
“url”: “<a href="https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git">https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git</a>”,
“description”: “Provides an interface to browse created images in the web browser.”,
“added”: “2022-11-01”,
“tags”: [“tab”, “UI related”]
},
{
“name”: “Inspiration”,
“url”: “<a href="https://github.com/yfszzx/stable-diffusion-webui-inspiration.git">https://github.com/yfszzx/stable-diffusion-webui-inspiration.git</a>”,
“description”: “Randomly display the pictures of the artist’s or artistic genres typical style, more pictures of this artist or genre is displayed after selecting. So you don’t have to worry about how hard it is to choose the right style of art when you create.”,
“added”: “2022-11-01”,
“tags”: [“tab”, “UI related”]
},
{
“name”: “Artists to study”,
“url”: “<a href="https://github.com/camenduru/stable-diffusion-webui-artists-to-study.git">https://github.com/camenduru/stable-diffusion-webui-artists-to-study.git</a>”,
“description”: “Shows a gallery of generated pictures by artists separated into categories.”,
“added”: “2022-11-01”,
“tags”: [“tab”, “UI related”]
},
{
“name”: “Prompt Gallery”,
“url”: “<a href="https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git">https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git</a>”,
“description”: “Build a yaml file filled with prompts of your character, hit generate, and quickly preview them by their word attributes and modifiers.”,
“added”: “2022-12-02”,
“tags”: [“tab”, “UI related”]
},
{
“name”: “Infinity Grid Generator”,
“url”: “<a href="https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script.git">https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script.git</a>”,
“description”: “Build a yaml file with your chosen parameters, and generate infinite-dimensional grids. Built-in ability to add description text to fields. See readme for usage details.”,
“added”: “2022-12-09”,
“tags”: [“UI related”]
},
{
“name”: “Config-Presets”,
“url”: “<a href="https://github.com/Zyin055/Config-Presets.git">https://github.com/Zyin055/Config-Presets.git</a>”,
“description”: “Adds a configurable dropdown to allow you to change UI preset settings in the txt2img and img2img tabs.”,
“added”: “2022-12-13”,
“tags”: [“UI related”]
},
{
“name”: “Preset Utilities”,
“url”: “<a href="https://github.com/Gerschel/sd_web_ui_preset_utils.git">https://github.com/Gerschel/sd_web_ui_preset_utils.git</a>”,
“description”: “Preset utility tool for ui. Offers compatibility with custom scripts. (to a limit)”,
“added”: “2022-12-19”,
“tags”: [“UI related”]
},
{
“name”: “openOutpaint extension”,
“url”: “<a href="https://github.com/zero01101/openOutpaint-webUI-extension.git">https://github.com/zero01101/openOutpaint-webUI-extension.git</a>”,
“description”: “A tab with the full openOutpaint UI. Run with the --api flag.”,
“added”: “2022-12-23”,
“tags”: [“tab”, “UI related”, “editing”]
},
{
“name”: “quick-css”,
“url”: “<a href="https://github.com/Gerschel/sd-web-ui-quickcss.git">https://github.com/Gerschel/sd-web-ui-quickcss.git</a>”,
“description”: “Extension for quickly selecting and applying custom.css files, for customizing look and placement of elements in ui.”,
“added”: “2022-12-30”,
“tags”: [“tab”, “UI related”]
},
{
“name”: “Aspect Ratio selector”,
“url”: “<a href="https://github.com/alemelis/sd-webui-ar.git">https://github.com/alemelis/sd-webui-ar.git</a>”,
“description”: “Adds image aspect ratio selector buttons.”,
“added”: “2023-02-04”,
“tags”: [“UI related”]
},
{
“name”: “Catppuccin Theme”,
“url”: “<a href="https://github.com/catppuccin/stable-diffusion-webui.git">https://github.com/catppuccin/stable-diffusion-webui.git</a>”,
“description”: “Adds various custom themes”,
“added”: “2023-02-04”,
“tags”: [“UI related”]
},
{
“name”: “Kitchen Theme”,
“url”: “<a href="https://github.com/canisminor1990/sd-web-ui-kitchen-theme.git">https://github.com/canisminor1990/sd-web-ui-kitchen-theme.git</a>”,
“description”: “Custom Theme.”,
“added”: “2023-02-28”,
“tags”: [“UI related”]
},
{
“name”: “Bilingual Localization”,
“url”: “<a href="https://github.com/journey-ad/sd-webui-bilingual-localization.git">https://github.com/journey-ad/sd-webui-bilingual-localization.git</a>”,
“description”: “Bilingual translation, no need to worry about how to find the original button. Compatible with language pack extensions, no need to re-import.”,
“added”: “2023-02-28”,
“tags”: [“UI related”]
},
{
“name”: “Dynamic Prompts”,
“url”: “<a href="https://github.com/adieyal/sd-dynamic-prompts.git">https://github.com/adieyal/sd-dynamic-prompts.git</a>”,
“description”: “Implements an expressive template language for random or combinatorial prompt generation along with features to support deep wildcard directory structures.”,
“added”: “2022-11-01”,
“tags”: [“prompting”]
},
{
“name”: “Unprompted”,
“url”: “<a href="https://github.com/ThereforeGames/unprompted.git">https://github.com/ThereforeGames/unprompted.git</a>”,
“description”: “Allows you to include various shortcodes in your prompts. You can pull text from files, set up your own variables, process text through conditional functions, and so much more - it’s like wildcards on steroids. It now includes integrations like hard-prompts made easy, ControlNet, txt2img2img and txt2mask.”,
“added”: “2022-11-04”,
“tags”: [“prompting”, “ads”]
},
{
“name”: “StylePile”,
“url”: “<a href="https://github.com/some9000/StylePile.git">https://github.com/some9000/StylePile.git</a>”,
“description”: “An easy way to mix and match elements to prompts that affect the style of the result.”,
“added”: “2022-11-24”,
“tags”: [“prompting”]
},
{
“name”: “Booru tag autocompletion”,
“url”: “<a href="https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git">https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git</a>”,
“description”: “Displays autocompletion hints for tags from image booru boards such as Danbooru. Uses local tag CSV files and includes a config for customization.”,
“added”: “2022-11-04”,
“tags”: [“prompting”]
},
{
“name”: “novelai-2-local-prompt”,
“url”: “<a href="https://github.com/animerl/novelai-2-local-prompt.git">https://github.com/animerl/novelai-2-local-prompt.git</a>”,
“description”: “Add a button to convert the prompts used in NovelAI for use in the WebUI. In addition, add a button that allows you to recall a previously used prompt.”,
“added”: “2022-11-05”,
“tags”: [“prompting”]
},
{
“name”: “tokenizer”,
“url”: “<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer.git">https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer.git</a>”,
“description”: “Adds a tab that lets you preview how CLIP model would tokenize your text.”,
“added”: “2022-11-05”,
“tags”: [“tab”, “prompting”]
},
{
“name”: “Randomize”,
“url”: “<a href="https://github.com/innightwolfsleep/stable-diffusion-webui-randomize.git">https://github.com/innightwolfsleep/stable-diffusion-webui-randomize.git</a>”,
“description”: “Allows for random parameters during txt2img generation. This script will function with others as well. Original author: <a href="https://git.mmaker.moe/mmaker/stable-diffusion-webui-randomize">https://git.mmaker.moe/mmaker/stable-diffusion-webui-randomize</a>”,
“added”: “2022-11-11”,
“tags”: [“prompting”]
},
{
“name”: “conditioning-highres-fix”,
“url”: “<a href="https://github.com/klimaleksus/stable-diffusion-webui-conditioning-highres-fix.git">https://github.com/klimaleksus/stable-diffusion-webui-conditioning-highres-fix.git</a>”,
“description”: “This is Extension for rewriting Inpainting conditioning mask strength value relative to Denoising strength at runtime. This is useful for Inpainting models such as sd-v1-5-inpainting.ckpt”,
“added”: “2022-11-11”,
“tags”: [“prompting”]
},
{
“name”: “model-keyword”,
“url”: “<a href="https://github.com/mix1009/model-keyword.git">https://github.com/mix1009/model-keyword.git</a>”,
“description”: “Inserts matching keyword(s) to the prompt automatically. Update this extension to get the latest model+keyword mappings.”,
“added”: “2022-12-28”,
“tags”: [“prompting”]
},
{
“name”: “Prompt Generator”,
“url”: “<a href="https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator.git">https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator.git</a>”,
“description”: “generate a prompt from a small base prompt using distilgpt2. Adds a tab with additional control of the model.”,
“added”: “2022-12-30”,
“tags”: [“tab”, “prompting”]
},
{
“name”: “Promptgen”,
“url”: “<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen.git">https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen.git</a>”,
“description”: “Use transformers models to generate prompts.”,
“added”: “2023-01-18”,
“tags”: [“tab”, “prompting”]
},
{
“name”: “text2prompt”,
“url”: “<a href="https://github.com/toshiaki1729/stable-diffusion-webui-text2prompt.git">https://github.com/toshiaki1729/stable-diffusion-webui-text2prompt.git</a>”,
“description”: “Generates anime tags using databases and models for tokenizing.”,
“added”: “2023-02-11”,
“tags”: [“tab”, “prompting”]
},
{
“name”: “Prompt Translator”,
“url”: “<a href="https://github.com/butaixianran/Stable-Diffusion-Webui-Prompt-Translator">https://github.com/butaixianran/Stable-Diffusion-Webui-Prompt-Translator</a>”,
“description”: “A integrated translator for translating prompts to English using Deepl or Baidu.”,
“added”: “2023-02-11”,
“tags”: [“tab”, “prompting”, “online”]
},
{
“name”: “Deforum”,
“url”: “<a href="https://github.com/deforum-art/deforum-for-automatic1111-webui.git">https://github.com/deforum-art/deforum-for-automatic1111-webui.git</a>”,
“description”: “The official port of Deforum, an extensive script for 2D and 3D animations, supporting keyframable sequences, dynamic math parameters (even inside the prompts), dynamic masking, depth estimation and warping.”,
“added”: “2022-11-01”,
“tags”: [“tab”, “animation”]
},
{
“name”: “Animator”,
“url”: “<a href="https://github.com/Animator-Anon/animator_extension.git">https://github.com/Animator-Anon/animator_extension.git</a>”,
“description”: “A basic img2img script that will dump frames and build a video file. Suitable for creating interesting zoom-in warping movies. This is intended to be a versatile toolset to help you automate some img2img tasks.”,
“added”: “2023-01-11”,
“tags”: [“tab”, “animation”]
},
{
“name”: “gif2gif”,
“url”: “<a href="https://github.com/LonicaMewinsky/gif2gif.git">https://github.com/LonicaMewinsky/gif2gif.git</a>”,
“description”: “A script for img2img that extract a gif frame by frame for img2img generation and recombine them back into an animated gif”,
“added”: “2023-02-09”,
“tags”: [“animation”]
},
{
“name”: “Video Loopback”,
“url”: “<a href="https://github.com/fishslot/video_loopback_for_webui.git">https://github.com/fishslot/video_loopback_for_webui.git</a>”,
“description”: “A video2video script that tries to improve on the temporal consistency and flexibility of normal vid2vid.”,
“added”: “2023-02-13”,
“tags”: [“animation”]
},
{
“name”: “seed travel”,
“url”: “<a href="https://github.com/yownas/seed_travel.git">https://github.com/yownas/seed_travel.git</a>”,
“description”: “Small script for AUTOMATIC1111/stable-diffusion-webui to create images that exists between seeds.”,
“added”: “2022-11-09”,
“tags”: [“animation”]
},
{
“name”: “shift-attention”,
“url”: “<a href="https://github.com/yownas/shift-attention.git">https://github.com/yownas/shift-attention.git</a>”,
“description”: “Generate a sequence of images shifting attention in the prompt. This script enables you to give a range to the weight of tokens in a prompt and then generate a sequence of images stepping from the first one to the second.”,
“added”: “2022-11-09”,
“tags”: [“animation”]
},
{
“name”: “prompt travel”,
“url”: “<a href="https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel.git">https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel.git</a>”,
“description”: “Extension script for AUTOMATIC1111/stable-diffusion-webui to travel between prompts in latent space.”,
“added”: “2022-11-11”,
“tags”: [“animation”]
},
{
“name”: “Steps Animation”,
“url”: “<a href="https://github.com/vladmandic/sd-extension-steps-animation.git">https://github.com/vladmandic/sd-extension-steps-animation.git</a>”,
“description”: “Create animation sequence from denoised intermediate steps.”,
“added”: “2023-01-21”,
“tags”: [“animation”]
},
{
“name”: “auto-sd-paint-ext”,
“url”: “<a href="https://github.com/Interpause/auto-sd-paint-ext.git">https://github.com/Interpause/auto-sd-paint-ext.git</a>”,
“description”: “Krita Plugin.”,
“added”: “2022-11-04”,
“tags”: [“editing”]
},
{
“name”: “Detection Detailer”,
“url”: “<a href="https://github.com/dustysys/ddetailer.git">https://github.com/dustysys/ddetailer.git</a>”,
“description”: “An object detection and auto-mask extension for Stable Diffusion web UI.”,
“added”: “2022-11-09”,
“tags”: [“editing”]
},
{
“name”: “Batch Face Swap”,
“url”: “<a href="https://github.com/kex0/batch-face-swap.git">https://github.com/kex0/batch-face-swap.git</a>”,
“description”: “Automatically detects faces and replaces them.”,
“added”: “2023-01-13”,
“tags”: [“editing”]
},
{
“name”: “Depth Maps”,
“url”: “<a href="https://github.com/thygate/stable-diffusion-webui-depthmap-script.git">https://github.com/thygate/stable-diffusion-webui-depthmap-script.git</a>”,
“description”: “Depth Maps, Stereo Image, 3D Mesh and Video generator extension.”,
“added”: “2022-11-30”,
“tags”: [“editing”]
},
{
“name”: “multi-subject-render”,
“url”: “<a href="https://github.com/Extraltodeus/multi-subject-render.git">https://github.com/Extraltodeus/multi-subject-render.git</a>”,
“description”: “It is a depth aware extension that can help to create multiple complex subjects on a single image. It generates a background, then multiple foreground subjects, cuts their backgrounds after a depth analysis, paste them onto the background and finally does an img2img for a clean finish.”,
“added”: “2022-11-24”,
“tags”: [“editing”, “manipulations”]
},
{
“name”: “depthmap2mask”,
“url”: “<a href="https://github.com/Extraltodeus/depthmap2mask.git">https://github.com/Extraltodeus/depthmap2mask.git</a>”,
“description”: “Create masks for img2img based on a depth estimation made by MiDaS.”,
“added”: “2022-11-26”,
“tags”: [“editing”, “manipulations”]
},
{
“name”: “ABG_extension”,
“url”: “<a href="https://github.com/KutsuyaYuki/ABG_extension.git">https://github.com/KutsuyaYuki/ABG_extension.git</a>”,
“description”: “Automatically remove backgrounds. Uses an onnx model fine-tuned for anime images. Runs on GPU.”,
“added”: “2022-12-24”,
“tags”: [“editing”]
},
{
“name”: “Pixelization”,
“url”: “<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-pixelization.git">https://github.com/AUTOMATIC1111/stable-diffusion-webui-pixelization.git</a>”,
“description”: “Using pre-trained models, produce pixel art out of images in the extras tab.”,
“added”: “2023-01-23”,
“tags”: [“editing”]
},
{
“name”: “haku-img”,
“url”: “<a href="https://github.com/KohakuBlueleaf/a1111-sd-webui-haku-img.git">https://github.com/KohakuBlueleaf/a1111-sd-webui-haku-img.git</a>”,
“description”: “Image utils extension. Allows blending, layering, hue and color adjustments, blurring and sketch effects, and basic pixelization.”,
“added”: “2023-01-17”,
“tags”: [“tab”, “editing”]
},
{
“name”: “Asymmetric Tiling”,
“url”: “<a href="https://github.com/tjm35/asymmetric-tiling-sd-webui.git">https://github.com/tjm35/asymmetric-tiling-sd-webui.git</a>”,
“description”: “An always visible script extension to configure seamless image tiling independently for the X and Y axes.”,
“added”: “2023-01-13”,
“tags”: [“manipulations”]
},
{
“name”: “Latent Mirroring”,
“url”: “<a href="https://github.com/dfaker/SD-latent-mirroring.git">https://github.com/dfaker/SD-latent-mirroring.git</a>”,
“description”: “Applies mirroring and flips to the latent images to produce anything from subtle balanced compositions to perfect reflections”,
“added”: “2022-11-06”,
“tags”: [“manipulations”]
},
{
“name”: “Sonar”,
“url”: “<a href="https://github.com/Kahsolt/stable-diffusion-webui-sonar.git">https://github.com/Kahsolt/stable-diffusion-webui-sonar.git</a>”,
“description”: “Improve the generated image quality, searches for similar (yet even better!) images in the neighborhood of some known image, focuses on single prompt optimization rather than traveling between multiple prompts.”,
“added”: “2023-01-12”,
“tags”: [“manipulations”]
},
{
“name”: “Depth Image I/O”,
“url”: “<a href="https://github.com/AnonymousCervine/depth-image-io-for-SDWebui.git">https://github.com/AnonymousCervine/depth-image-io-for-SDWebui.git</a>”,
“description”: “An extension to allow managing custom depth inputs to Stable Diffusion depth2img models.”,
“added”: “2023-01-17”,
“tags”: [“manipulations”]
},
{
“name”: “Ultimate SD Upscale”,
“url”: “<a href="https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git">https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git</a>”,
“description”: “More advanced options for SD Upscale, less artifacts than original using higher denoise ratio (0.3-0.5).”,
“added”: “2023-01-10”,
“tags”: [“manipulations”]
},
{
“name”: “Fusion”,
“url”: “<a href="https://github.com/ljleb/prompt-fusion-extension.git">https://github.com/ljleb/prompt-fusion-extension.git</a>”,
“description”: “Adds prompt-travel and shift-attention-like interpolations (see exts), but during/within the sampling steps. Always-on + works w/ existing prompt-editing syntax. Various interpolation modes. See their wiki for more info.”,
“added”: “2023-01-28”,
“tags”: [“manipulations”]
},
{
“name”: “Dynamic Thresholding”,
“url”: “<a href="https://github.com/mcmonkeyprojects/sd-dynamic-thresholding.git">https://github.com/mcmonkeyprojects/sd-dynamic-thresholding.git</a>”,
“description”: “Adds customizable dynamic thresholding to allow high CFG Scale values without the burning / ‘pop art’ effect.”,
“added”: “2023-02-01”,
“tags”: [“manipulations”]
},
{
“name”: “anti-burn”,
“url”: “<a href="https://github.com/klimaleksus/stable-diffusion-webui-anti-burn.git">https://github.com/klimaleksus/stable-diffusion-webui-anti-burn.git</a>”,
“description”: “Smoothing generated images by skipping a few very last steps and averaging together some images before them.”,
“added”: “2023-02-09”,
“tags”: [“manipulations”]
},
{
“name”: “sd-webui-controlnet”,
“url”: “<a href="https://github.com/Mikubill/sd-webui-controlnet.git">https://github.com/Mikubill/sd-webui-controlnet.git</a>”,
“description”: “WebUI extension for ControlNet. Note: (WIP), so don’t expect seed reproducibility - as updates may change things.”,
“added”: “2023-02-18”,
“tags”: [“manipulations”]
},
{
“name”: “Latent Couple”,
“url”: “<a href="https://github.com/opparco/stable-diffusion-webui-two-shot.git">https://github.com/opparco/stable-diffusion-webui-two-shot.git</a>”,
“description”: “An extension of the built-in Composable Diffusion, allows you to determine the region of the latent space that reflects your subprompts.”,
“added”: “2023-02-18”,
“tags”: [“manipulations”]
},
{
“name”: “Composable LoRA”,
“url”: “<a href="https://github.com/opparco/stable-diffusion-webui-composable-lora.git">https://github.com/opparco/stable-diffusion-webui-composable-lora.git</a>”,
“description”: “Enables using AND keyword(composable diffusion) to limit LoRAs to subprompts. Useful when paired with Latent Couple extension.”,
“added”: “2023-02-25”,
“tags”: [“manipulations”]
},
{
“name”: “Auto TLS-HTTPS”,
“url”: “<a href="https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https.git">https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https.git</a>”,
“description”: “Allows you to easily, or even completely automatically start using HTTPS.”,
“added”: “2022-11-14”,
“tags”: [“script”]
},
{
“name”: “booru2prompt”,
“url”: “<a href="https://github.com/Malisius/booru2prompt.git">https://github.com/Malisius/booru2prompt.git</a>”,
“description”: “This SD extension allows you to turn posts from various image boorus into stable diffusion prompts. It does so by pulling a list of tags down from their API. You can copy-paste in a link to the post you want yourself, or use the built-in search feature to do it all without leaving SD.”,
“added”: “2022-11-21”,
“tags”: [“tab”, “online”]
},
{
“name”: “Gelbooru Prompt”,
“url”: “<a href="https://github.com/antis0007/sd-webui-gelbooru-prompt.git">https://github.com/antis0007/sd-webui-gelbooru-prompt.git</a>”,
“description”: “Extension that gets tags for saved gelbooru images in AUTOMATIC1111’s Stable Diffusion webui”,
“added”: “2022-12-20”,
“tags”: [“online”]
},
{
“name”: “NSFW checker”,
“url”: “<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-nsfw-censor.git">https://github.com/AUTOMATIC1111/stable-diffusion-webui-nsfw-censor.git</a>”,
“description”: “Replaces NSFW images with black.”,
“added”: “2022-12-10”,
“tags”: [“script”]
},
{
“name”: “Diffusion Defender”,
“url”: “<a href="https://github.com/WildBanjos/DiffusionDefender.git">https://github.com/WildBanjos/DiffusionDefender.git</a>”,
“description”: “Prompt blacklist, find and replace, for semi-private and public instances.”,
“added”: “2022-12-20”,
“tags”: [“script”]
},
{
“name”: “DH Patch”,
“url”: “<a href="https://github.com/d8ahazard/sd_auto_fix.git">https://github.com/d8ahazard/sd_auto_fix.git</a>”,
“description”: “Random patches by D8ahazard. Auto-load config YAML files for v2, 2.1 models; patch latent-diffusion to fix attention on 2.1 models (black boxes without no-half), whatever else I come up with.”,
“added”: “2022-12-16”,
“tags”: [“script”]
},
{
“name”: “Riffusion”,
“url”: “<a href="https://github.com/enlyth/sd-webui-riffusion.git">https://github.com/enlyth/sd-webui-riffusion.git</a>”,
“description”: “Use Riffusion model to produce music in gradio. To replicate original interpolation technique, input the prompt travel extension output frames into the riffusion tab.”,
“added”: “2022-12-19”,
“tags”: [“tab”]
},
{
“name”: “Save Intermediate Images”,
“url”: “<a href="https://github.com/AlUlkesh/sd_save_intermediate_images.git">https://github.com/AlUlkesh/sd_save_intermediate_images.git</a>”,
“description”: “Save intermediate images during the sampling process. You can also make videos from the intermediate images.”,
“added”: “2022-12-22”,
“tags”: [“script”]
},
{
“name”: “Add image number to grid”,
“url”: “<a href="https://github.com/AlUlkesh/sd_grid_add_image_number.git">https://github.com/AlUlkesh/sd_grid_add_image_number.git</a>”,
“description”: “Add the image’s number to its picture in the grid.”,
“added”: “2023-01-01”,
“tags”: [“script”]
},
{
“name”: “Multiple Hypernetworks”,
“url”: “<a href="https://github.com/antis0007/sd-webui-multiple-hypernetworks.git">https://github.com/antis0007/sd-webui-multiple-hypernetworks.git</a>”,
“description”: “Adds the ability to apply multiple hypernetworks at once. Apply multiple hypernetworks sequentially, with different weights.”,
“added”: “2023-01-13”,
“tags”: [“script”]
},
{
“name”: “System Info”,
“url”: “<a href="https://github.com/vladmandic/sd-extension-system-info.git">https://github.com/vladmandic/sd-extension-system-info.git</a>”,
“description”: “System Info tab for WebUI which shows realtime information of the server. Also supports sending crowdsourced inference data as an option.”,
“added”: “2023-01-21”,
“tags”: [“script”, “tab”]
},
{
“name”: “OpenPose Editor”,
“url”: “<a href="https://github.com/fkunn1326/openpose-editor.git">https://github.com/fkunn1326/openpose-editor.git</a>”,
“description”: “This can add multiple pose characters, detect pose from image, save to PNG, and send to controlnet extension.”,
“added”: “2023-02-18”,
“tags”: [“tab”]
},
{
“name”: “Stable Horde Worker”,
“url”: “<a href="https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker.git">https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker.git</a>”,
“description”: “Worker Client for Stable Horde. Generate pictures for other users with your PC. Please see readme for additional instructions.”,
“added”: “2023-01-10”,
“tags”: [“tab”, “online”]
},
{
“name”: “Stable Horde Client”,
“url”: “<a href="https://github.com/natanjunges/stable-diffusion-webui-stable-horde.git">https://github.com/natanjunges/stable-diffusion-webui-stable-horde.git</a>”,
“description”: “Stable Horde Client. Generate pictures using other user’s PC. Useful if u have no GPU.”,
“added”: “2023-01-11”,
“tags”: [“tab”, “online”]
},
{
“name”: “Discord Rich Presence”,
“url”: “<a href="https://github.com/kabachuha/discord-rpc-for-automatic1111-webui.git">https://github.com/kabachuha/discord-rpc-for-automatic1111-webui.git</a>”,
“description”: “Provides connection to Discord RPC, showing a fancy table in the user profile.”,
“added”: “2023-01-20”,
“tags”: [“online”]
},
{
“name”: “mine-diffusion”,
“url”: “<a href="https://github.com/fropych/mine-diffusion.git">https://github.com/fropych/mine-diffusion.git</a>”,
“description”: “This extension converts images into blocks and creates schematics for easy importing into Minecraft using the Litematica mod.”,
“added”: “2023-02-11”,
“tags”: [“tab”, “online”]
},
{
“name”: “Aesthetic Image Scorer”,
“url”: “<a href="https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer.git">https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer.git</a>”,
“description”: “Calculates aesthetic score for generated images using CLIP+MLP Aesthetic Score Predictor based on Chad Scorer”,
“added”: “2022-11-01”,
“tags”: [“query”]
},
{
“name”: “Aesthetic Scorer”,
“url”: “<a href="https://github.com/vladmandic/sd-extension-aesthetic-scorer.git">https://github.com/vladmandic/sd-extension-aesthetic-scorer.git</a>”,
“description”: “Uses existing CLiP model with an additional small pretrained model to calculate perceived aesthetic score of an image.”,
“added”: “2023-01-21”,
“tags”: [“query”]
},
{
“name”: “cafe-aesthetic”,
“url”: “<a href="https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic.git">https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic.git</a>”,
“description”: “Pre-trained model, determines if aesthetic/non-aesthetic, does 5 different style recognition modes, and Waifu confirmation. Also has a tab with Batch processing.”,
“added”: “2023-01-28”,
“tags”: [“tab”, “query”]
},
{
“name”: “Clip Interrogator”,
“url”: “<a href="https://github.com/pharmapsychotic/clip-interrogator-ext.git">https://github.com/pharmapsychotic/clip-interrogator-ext.git</a>”,
“description”: “Clip Interrogator by pharmapsychotic ported to an extension. Features a variety of clip models and interrogate settings.”,
“added”: “2023-02-21”,
“tags”: [“tab”, “query”]
},
{
“name”: “Visualize Cross-Attention”,
“url”: “<a href="https://github.com/benkyoujouzu/stable-diffusion-webui-visualize-cross-attention-extension.git">https://github.com/benkyoujouzu/stable-diffusion-webui-visualize-cross-attention-extension.git</a>”,
“description”: “Generates highlighted sectors of a submitted input image, based on input prompts. Use with tokenizer extension. See the readme for more info.”,
“added”: “2022-11-25”,
“tags”: [“tab”, “science”]
},
{
“name”: “DAAM”,
“url”: “<a href="https://github.com/toriato/stable-diffusion-webui-daam.git">https://github.com/toriato/stable-diffusion-webui-daam.git</a>”,
“description”: “DAAM stands for Diffusion Attentive Attribution Maps. Enter the attention text (must be a string contained in the prompt) and run. An overlapping image with a heatmap for each attention will be generated along with the original image.”,
“added”: “2022-12-02”,
“tags”: [“science”]
},
{
“name”: “Dump U-Net”,
“url”: “<a href="https://github.com/hnmr293/stable-diffusion-webui-dumpunet.git">https://github.com/hnmr293/stable-diffusion-webui-dumpunet.git</a>”,
“description”: “View different layers, observe U-Net feature maps. Image generation by giving different prompts for each block of the unet: <a href="https://note.com/kohya_ss/n/n93b7c01b0547">https://note.com/kohya_ss/n/n93b7c01b0547</a>”,
“added”: “2023-03-04”,
“tags”: [“science”]
},
{
“name”: “posex”,
“url”: “<a href="https://github.com/hnmr293/posex.git">https://github.com/hnmr293/posex.git</a>”,
“description”: “Estimated Image Generator for Pose2Image. This extension allows moving the openpose figure in 3d space.”,
“added”: “2023-03-04”,
“tags”: [“script”]
},
{
“name”: “LLuL”,
“url”: “<a href="https://github.com/hnmr293/sd-webui-llul.git">https://github.com/hnmr293/sd-webui-llul.git</a>”,
“description”: “Local Latent Upscaler. Target an area to selectively enhance details.”,
“added”: “2023-03-04”,
“tags”: [“manipulations”]
},
{
“name”: “CFG-Schedule-for-Automatic1111-SD”,
“url”: “<a href="https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD.git">https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD.git</a>”,
“description”: “These scripts allow for dynamic CFG control during generation steps. With the right settings, this could help get the details of high CFG without damaging the generated image even with low denoising in img2img.”,
“added”: “2023-03-04”,
“tags”: [“script”]
},
{
“name”: “a1111-sd-webui-locon”,
“url”: “<a href="https://github.com/KohakuBlueleaf/a1111-sd-webui-locon.git">https://github.com/KohakuBlueleaf/a1111-sd-webui-locon.git</a>”,
“description”: “An extension for loading LoCon networks in webui.”,
“added”: “2023-03-04”,
“tags”: [“script”]
},
{
“name”: “ebsynth_utility”,
“url”: “<a href="https://github.com/s9roll7/ebsynth_utility.git">https://github.com/s9roll7/ebsynth_utility.git</a>”,
“description”: “Extension for creating videos using img2img and ebsynth. Output edited videos using ebsynth. Works with ControlNet extension.”,
“added”: “2023-03-04”,
“tags”: [“tab”, “animation”]
},
{
“name”: “VRAM Estimator”,
“url”: “<a href="https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator.git">https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator.git</a>”,
“description”: “Runs txt2img, img2img, highres-fix at increasing dimensions and batch sizes until OOM, and outputs data to graph.”,
“added”: “2023-03-05”,
“tags”: [“tab”]
},
{
“name”: “MultiDiffusion with Tiled VAE”,
“url”: “<a href="https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git">https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git</a>”,
“description”: “Seamless Image Fusion, along with vram efficient tiled vae script.”,
“added”: “2023-03-08”,
“tags”: [“manipulations”]
},
{
“name”: “3D Model Loader”,
“url”: “<a href="https://github.com/jtydhr88/sd-3dmodel-loader.git">https://github.com/jtydhr88/sd-3dmodel-loader.git</a>”,
“description”: “Load your 3D model/animation inside webui, then send screenshot to txt2img or img2img to ControlNet.”,
“added”: “2023-03-11”,
“tags”: [“tab”]
},
{
“name”: “Corridor Crawler Outpainting”,
“url”: “<a href="https://github.com/brick2face/corridor-crawler-outpainting.git">https://github.com/brick2face/corridor-crawler-outpainting.git</a>”,
“description”: “Generate hallways with the depth-to-image model at 512 resolution. It can be tweaked to work with other models/resolutions.”,
“added”: “2023-03-11”,
“tags”: [“tab”]
},
{
“name”: “Panorama Viewer”,
“url”: “<a href="https://github.com/GeorgLegato/sd-webui-panorama-viewer.git">https://github.com/GeorgLegato/sd-webui-panorama-viewer.git</a>”,
“description”: “Provides a tab to display equirectangular images in interactive 3d-view.”,
“added”: “2023-03-11”,
“tags”: [“tab”]
},
{
“name”: “db-storage1111”,
“url”: “<a href="https://github.com/takoyaro/db-storage1111.git">https://github.com/takoyaro/db-storage1111.git</a>”,
“description”: “Allows to store pictures and their metadata in a database. (supports MongoDB)”,
“added”: “2023-03-12”,
“tags”: [“script”]
},
{
“name”: “zh_CN Localization”,
“url”: “<a href="https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN">https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN</a>”,
“description”: “Simplified Chinese localization, recommend using with Bilingual Localization.”,
“added”: “2022-11-06”,
“tags”: [“localization”]
},
{
“name”: “zh_TW Localization”,
“url”: “<a href="https://github.com/benlisquare/stable-diffusion-webui-localization-zh_TW">https://github.com/benlisquare/stable-diffusion-webui-localization-zh_TW</a>”,
“description”: “Traditional Chinese localization”,
“added”: “2022-11-09”,
“tags”: [“localization”]
},
{
“name”: “ko_KR Localization”,
“url”: “<a href="https://github.com/36DB/stable-diffusion-webui-localization-ko_KR">https://github.com/36DB/stable-diffusion-webui-localization-ko_KR</a>”,
“description”: “Korean localization”,
“added”: “2022-11-06”,
“tags”: [“localization”]
},
{
“name”: “th_TH Localization”,
“url”: “<a href="https://github.com/econDS/thai-localization-for-Automatic-stable-diffusion-webui">https://github.com/econDS/thai-localization-for-Automatic-stable-diffusion-webui</a>”,
“description”: “Thai localization”,
“added”: “2022-12-30”,
“tags”: [“localization”]
},
{
“name”: “es_ES Localization”,
“url”: “<a href="https://github.com/innovaciones/stable-diffusion-webui-localization-es_ES">https://github.com/innovaciones/stable-diffusion-webui-localization-es_ES</a>”,
“description”: “Spanish localization”,
“added”: “2022-11-09”,
“tags”: [“localization”]
},
{
“name”: “it_IT Localization”,
“url”: “<a href="https://github.com/Harvester62/stable-diffusion-webui-localization-it_IT">https://github.com/Harvester62/stable-diffusion-webui-localization-it_IT</a>”,
“description”: “Italian localization”,
“added”: “2022-11-07”,
“tags”: [“localization”]
},
{
“name”: “de_DE Localization”,
“url”: “<a href="https://github.com/Strothis/stable-diffusion-webui-de_DE">https://github.com/Strothis/stable-diffusion-webui-de_DE</a>”,
“description”: “German localization”,
“added”: “2022-11-07”,
“tags”: [“localization”]
},
{
“name”: “ja_JP Localization”,
“url”: “<a href="https://github.com/Katsuyuki-Karasawa/stable-diffusion-webui-localization-ja_JP">https://github.com/Katsuyuki-Karasawa/stable-diffusion-webui-localization-ja_JP</a>”,
“description”: “Japanese localization”,
“added”: “2022-11-07”,
“tags”: [“localization”]
},
{
“name”: “pt_BR Localization”,
“url”: “<a href="https://github.com/M-art-ucci/stable-diffusion-webui-localization-pt_BR">https://github.com/M-art-ucci/stable-diffusion-webui-localization-pt_BR</a>”,
“description”: “Brazillian portuguese localization”,
“added”: “2022-11-09”,
“tags”: [“localization”]
},
{
“name”: “tr_TR Localization”,
“url”: “<a href="https://github.com/camenduru/stable-diffusion-webui-localization-tr_TR">https://github.com/camenduru/stable-diffusion-webui-localization-tr_TR</a>”,
“description”: “Turkish localization”,
“added”: “2022-11-12”,
“tags”: [“localization”]
},
{
“name”: “no_NO Localization”,
“url”: “<a href="https://github.com/Cyanz83/stable-diffusion-webui-localization-no_NO">https://github.com/Cyanz83/stable-diffusion-webui-localization-no_NO</a>”,
“description”: “Norwegian localization”,
“added”: “2022-11-16”,
“tags”: [“localization”]
},
{
“name”: “ru_RU Localization”,
“url”: “<a href="https://github.com/ProfaneServitor/stable-diffusion-webui-localization-ru_RU">https://github.com/ProfaneServitor/stable-diffusion-webui-localization-ru_RU</a>”,
“description”: “Russian localization”,
“added”: “2022-11-20”,
“tags”: [“localization”]
},
{
“name”: “fi_FI Localization”,
“url”: “<a href="https://github.com/otsoniemi/stable-diffusion-webui-localization-fi_FI">https://github.com/otsoniemi/stable-diffusion-webui-localization-fi_FI</a>”,
“description”: “Finnish localization”,
“added”: “2022-12-28”,
“tags”: [“localization”]
},
{
“name”: “old localizations”,
“url”: “<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-old-localizations.git">https://github.com/AUTOMATIC1111/stable-diffusion-webui-old-localizations.git</a>”,
“description”: “Old unmaintained localizations that used to be a part of main repository”,
“added”: “2022-11-08”,
“tags”: [“localization”]
}
]
}</p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
{
"about": "This file is Deprecated any changes will be forcibly removed, submit your extension to the index via https://github.com/AUTOMATIC1111/stable-diffusion-webui-extensions. This file is used by Web UI to show the index of available extensions. It's in JSON format and is not meant to be viewed by users directly. If you edit the file you must ensure that it's still a valid JSON.",
"tags": {
"script": "a general extension that adds functionality",
"localization": "a localization extension that translates web ui into another language",
"tab": "adds a tab",
"dropdown": "adds a dropbear in the ui",
"ads": "contains ads",
"installed": "an extension that is already installed",
"training": "new type of training / assists with training.",
"models": "conversion and merging related.",
"UI related": "enhances the display or user interface experience.",
"prompting": "assists with writing words, for prompts.",
"editing": "an extension that changes images, not using stable diffusion.",
"manipulations": "an extension that changes images with stable diffusion.",
"online": "an extension which requires wifi to use, often API related.",
"animation": "an extension related to creating videos with stable diffusion.",
"query": "extracting info from images.",
"science": "experimentation with stable diffusion."
},
"extensions": [
{
"name": "Aesthetic Gradients",
"url": "https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients.git",
"description": "Allows training an embedding from one or few pictures, specifically meant for applying styles. Also, allows use of these specific embeddings to generated images.",
"added": "2022-11-01",
"tags": ["tab", "dropdown", "training"]
},
{
"name": "Dreambooth",
"url": "https://github.com/d8ahazard/sd_dreambooth_extension.git",
"description": "Dreambooth training based on Shivam Shiaro's repo, optimized for lower-VRAM GPUs.",
"added": "2022-11-07",
"tags": ["tab", "training"]
},
{
"name": "training-picker",
"url": "https://github.com/Maurdekye/training-picker.git",
"description": "Adds a tab to the webui that allows the user to automatically extract keyframes from video, and manually extract 512x512 crops of those frames for use in model training.",
"added": "2022-11-06",
"tags": ["tab", "training"]
},
{
"name": "Dataset Tag Editor",
"url": "https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor.git",
"description": "Feature-rich UI tab that allows image viewing, search-filtering and editing.",
"added": "2022-11-01",
"tags": ["tab", "training"]
},
{
"name": "DreamArtist",
"url": "https://github.com/7eu7d7/DreamArtist-sd-webui-extension.git",
"description": "Towards Controllable One-Shot Text-to-Image Generation via Contrastive Prompt-Tuning.",
"added": "2022-11-15",
"tags": ["training"]
},
{
"name": "WD 1.4 Tagger",
"url": "https://github.com/toriato/stable-diffusion-webui-wd14-tagger.git",
"description": "Interrogates single or multiple image files using various alternative models, similar to deepdanbooru interrogate.",
"added": "2022-11-20",
"tags": ["tab", "training"]
},
{
"name": "Hypernetwork-Monkeypatch-Extension",
"url": "https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension.git",
"description": "Extension that provides additional training features for hypernetwork training. Also supports using multiple hypernetworks for inference.",
"added": "2023-01-12",
"tags": ["tab", "training"]
},
{
"name": "Custom Diffusion",
"url": "https://github.com/guaneec/custom-diffusion-webui.git",
"description": "Custom Diffusion is, in short, finetuning-lite with TI, instead of tuning the whole model. Similar speed and memory requirements to TI and supposedly gives better results in less steps.",
"added": "2023-01-28",
"tags": ["tab", "training"]
},
{
"name": "Smart Process",
"url": "https://github.com/d8ahazard/sd_smartprocess.git",
"description": "Smart pre-process including auto subject identification, caption subject swapping, and upscaling/facial restoration.",
"added": "2022-11-12",
"tags": ["tab", "editing", "training"]
},
{
"name": "Embeddings editor",
"url": "https://github.com/CodeExplode/stable-diffusion-webui-embedding-editor.git",
"description": "Allows you to manually edit textual inversion embeddings using sliders.",
"added": "2022-11-06",
"tags": ["tab", "models"]
},
{
"name": "embedding-inspector",
"url": "https://github.com/tkalayci71/embedding-inspector.git",
"description": "Inspect any token(a word) or Textual-Inversion embeddings and find out which embeddings are similar. You can mix, modify, or create the embeddings in seconds.",
"added": "2022-12-06",
"tags": ["tab", "models"]
},
{
"name": "Merge Board",
"url": "https://github.com/bbc-mc/sdweb-merge-board.git",
"description": "Multiple lane merge support(up to 10). Save and Load your merging combination as Recipes, which is simple text.",
"added": "2022-11-21",
"tags": ["tab", "models"]
},
{
"name": "Model Converter",
"url": "https://github.com/Akegarasu/sd-webui-model-converter.git",
"description": "Convert models to fp16/bf16 no-ema/ema-only safetensors. Convert/copy/delete any parts of model: unet, text encoder(clip), vae.",
"added": "2023-01-05",
"tags": ["tab", "models"]
},
{
"name": "Kohya-ss Additional Networks",
"url": "https://github.com/kohya-ss/sd-webui-additional-networks.git",
"description": "Allows the Web UI to use LoRAs (1.X and 2.X) to generate images. Also allows editing .safetensors networks prompt metadata.",
"added": "2023-01-06",
"tags": ["models"]
},
{
"name": "Merge Block Weighted",
"url": "https://github.com/bbc-mc/sdweb-merge-block-weighted-gui.git",
"description": "Merge models with separate rate for each 25 U-Net block (input, middle, output).",
"added": "2023-01-13",
"tags": ["tab", "models"]
},
{
"name": "Embedding Merge",
"url": "https://github.com/klimaleksus/stable-diffusion-webui-embedding-merge.git",
"description": "Merging Textual Inversion embeddings at runtime from string literals. Phrases and weight values also supported.",
"added": "2023-02-09",
"tags": ["tab", "models", "manipulations"]
},
{
"name": "SuperMerger",
"url": "https://github.com/hako-mikan/sd-webui-supermerger.git",
"description": "Merge and run without saving to drive. Sequential XY merge generations; extract and merge loras, bind loras to ckpt, merge block weights, and more.",
"added": "2023-02-18",
"tags": ["tab", "models"]
},
{
"name": "LoRA Block Weight",
"url": "https://github.com/hako-mikan/sd-webui-lora-block-weight.git",
"description": "Applies LoRA strength; block by block on the fly. Includes presets, weight analysis, randomization, XY plot.",
"added": "2023-02-28",
"tags": ["models"]
},
{
"name": "Image browser",
"url": "https://github.com/AlUlkesh/stable-diffusion-webui-images-browser.git",
"description": "Provides an interface to browse created images in the web browser.",
"added": "2022-11-01",
"tags": ["tab", "UI related"]
},
{
"name": "Inspiration",
"url": "https://github.com/yfszzx/stable-diffusion-webui-inspiration.git",
"description": "Randomly display the pictures of the artist's or artistic genres typical style, more pictures of this artist or genre is displayed after selecting. So you don't have to worry about how hard it is to choose the right style of art when you create.",
"added": "2022-11-01",
"tags": ["tab", "UI related"]
},
{
"name": "Artists to study",
"url": "https://github.com/camenduru/stable-diffusion-webui-artists-to-study.git",
"description": "Shows a gallery of generated pictures by artists separated into categories.",
"added": "2022-11-01",
"tags": ["tab", "UI related"]
},
{
"name": "Prompt Gallery",
"url": "https://github.com/dr413677671/PromptGallery-stable-diffusion-webui.git",
"description": "Build a yaml file filled with prompts of your character, hit generate, and quickly preview them by their word attributes and modifiers.",
"added": "2022-12-02",
"tags": ["tab", "UI related"]
},
{
"name": "Infinity Grid Generator",
"url": "https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script.git",
"description": "Build a yaml file with your chosen parameters, and generate infinite-dimensional grids. Built-in ability to add description text to fields. See readme for usage details.",
"added": "2022-12-09",
"tags": ["UI related"]
},
{
"name": "Config-Presets",
"url": "https://github.com/Zyin055/Config-Presets.git",
"description": "Adds a configurable dropdown to allow you to change UI preset settings in the txt2img and img2img tabs.",
"added": "2022-12-13",
"tags": ["UI related"]
},
{
"name": "Preset Utilities",
"url": "https://github.com/Gerschel/sd_web_ui_preset_utils.git",
"description": "Preset utility tool for ui. Offers compatibility with custom scripts. (to a limit)",
"added": "2022-12-19",
"tags": ["UI related"]
},
{
"name": "openOutpaint extension",
"url": "https://github.com/zero01101/openOutpaint-webUI-extension.git",
"description": "A tab with the full openOutpaint UI. Run with the --api flag.",
"added": "2022-12-23",
"tags": ["tab", "UI related", "editing"]
},
{
"name": "quick-css",
"url": "https://github.com/Gerschel/sd-web-ui-quickcss.git",
"description": "Extension for quickly selecting and applying custom.css files, for customizing look and placement of elements in ui.",
"added": "2022-12-30",
"tags": ["tab", "UI related"]
},
{
"name": "Aspect Ratio selector",
"url": "https://github.com/alemelis/sd-webui-ar.git",
"description": "Adds image aspect ratio selector buttons.",
"added": "2023-02-04",
"tags": ["UI related"]
},
{
"name": "Catppuccin Theme",
"url": "https://github.com/catppuccin/stable-diffusion-webui.git",
"description": "Adds various custom themes",
"added": "2023-02-04",
"tags": ["UI related"]
},
{
"name": "Kitchen Theme",
"url": "https://github.com/canisminor1990/sd-web-ui-kitchen-theme.git",
"description": "Custom Theme.",
"added": "2023-02-28",
"tags": ["UI related"]
},
{
"name": "Bilingual Localization",
"url": "https://github.com/journey-ad/sd-webui-bilingual-localization.git",
"description": "Bilingual translation, no need to worry about how to find the original button. Compatible with language pack extensions, no need to re-import.",
"added": "2023-02-28",
"tags": ["UI related"]
},
{
"name": "Dynamic Prompts",
"url": "https://github.com/adieyal/sd-dynamic-prompts.git",
"description": "Implements an expressive template language for random or combinatorial prompt generation along with features to support deep wildcard directory structures.",
"added": "2022-11-01",
"tags": ["prompting"]
},
{
"name": "Unprompted",
"url": "https://github.com/ThereforeGames/unprompted.git",
"description": "Allows you to include various shortcodes in your prompts. You can pull text from files, set up your own variables, process text through conditional functions, and so much more - it's like wildcards on steroids. It now includes integrations like hard-prompts made easy, ControlNet, txt2img2img and txt2mask.",
"added": "2022-11-04",
"tags": ["prompting", "ads"]
},
{
"name": "StylePile",
"url": "https://github.com/some9000/StylePile.git",
"description": "An easy way to mix and match elements to prompts that affect the style of the result.",
"added": "2022-11-24",
"tags": ["prompting"]
},
{
"name": "Booru tag autocompletion",
"url": "https://github.com/DominikDoom/a1111-sd-webui-tagcomplete.git",
"description": "Displays autocompletion hints for tags from image booru boards such as Danbooru. Uses local tag CSV files and includes a config for customization.",
"added": "2022-11-04",
"tags": ["prompting"]
},
{
"name": "novelai-2-local-prompt",
"url": "https://github.com/animerl/novelai-2-local-prompt.git",
"description": "Add a button to convert the prompts used in NovelAI for use in the WebUI. In addition, add a button that allows you to recall a previously used prompt.",
"added": "2022-11-05",
"tags": ["prompting"]
},
{
"name": "tokenizer",
"url": "https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer.git",
"description": "Adds a tab that lets you preview how CLIP model would tokenize your text.",
"added": "2022-11-05",
"tags": ["tab", "prompting"]
},
{
"name": "Randomize",
"url": "https://github.com/innightwolfsleep/stable-diffusion-webui-randomize.git",
"description": "Allows for random parameters during txt2img generation. This script will function with others as well. Original author: https://git.mmaker.moe/mmaker/stable-diffusion-webui-randomize",
"added": "2022-11-11",
"tags": ["prompting"]
},
{
"name": "conditioning-highres-fix",
"url": "https://github.com/klimaleksus/stable-diffusion-webui-conditioning-highres-fix.git",
"description": "This is Extension for rewriting Inpainting conditioning mask strength value relative to Denoising strength at runtime. This is useful for Inpainting models such as sd-v1-5-inpainting.ckpt",
"added": "2022-11-11",
"tags": ["prompting"]
},
{
"name": "model-keyword",
"url": "https://github.com/mix1009/model-keyword.git",
"description": "Inserts matching keyword(s) to the prompt automatically. Update this extension to get the latest model+keyword mappings.",
"added": "2022-12-28",
"tags": ["prompting"]
},
{
"name": "Prompt Generator",
"url": "https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator.git",
"description": "generate a prompt from a small base prompt using distilgpt2. Adds a tab with additional control of the model.",
"added": "2022-12-30",
"tags": ["tab", "prompting"]
},
{
"name": "Promptgen",
"url": "https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen.git",
"description": "Use transformers models to generate prompts.",
"added": "2023-01-18",
"tags": ["tab", "prompting"]
},
{
"name": "text2prompt",
"url": "https://github.com/toshiaki1729/stable-diffusion-webui-text2prompt.git",
"description": "Generates anime tags using databases and models for tokenizing.",
"added": "2023-02-11",
"tags": ["tab", "prompting"]
},
{
"name": "Prompt Translator",
"url": "https://github.com/butaixianran/Stable-Diffusion-Webui-Prompt-Translator",
"description": "A integrated translator for translating prompts to English using Deepl or Baidu.",
"added": "2023-02-11",
"tags": ["tab", "prompting", "online"]
},
{
"name": "Deforum",
"url": "https://github.com/deforum-art/deforum-for-automatic1111-webui.git",
"description": "The official port of Deforum, an extensive script for 2D and 3D animations, supporting keyframable sequences, dynamic math parameters (even inside the prompts), dynamic masking, depth estimation and warping.",
"added": "2022-11-01",
"tags": ["tab", "animation"]
},
{
"name": "Animator",
"url": "https://github.com/Animator-Anon/animator_extension.git",
"description": "A basic img2img script that will dump frames and build a video file. Suitable for creating interesting zoom-in warping movies. This is intended to be a versatile toolset to help you automate some img2img tasks.",
"added": "2023-01-11",
"tags": ["tab", "animation"]
},
{
"name": "gif2gif",
"url": "https://github.com/LonicaMewinsky/gif2gif.git",
"description": "A script for img2img that extract a gif frame by frame for img2img generation and recombine them back into an animated gif",
"added": "2023-02-09",
"tags": ["animation"]
},
{
"name": "Video Loopback",
"url": "https://github.com/fishslot/video_loopback_for_webui.git",
"description": "A video2video script that tries to improve on the temporal consistency and flexibility of normal vid2vid.",
"added": "2023-02-13",
"tags": ["animation"]
},
{
"name": "seed travel",
"url": "https://github.com/yownas/seed_travel.git",
"description": "Small script for AUTOMATIC1111/stable-diffusion-webui to create images that exists between seeds.",
"added": "2022-11-09",
"tags": ["animation"]
},
{
"name": "shift-attention",
"url": "https://github.com/yownas/shift-attention.git",
"description": "Generate a sequence of images shifting attention in the prompt. This script enables you to give a range to the weight of tokens in a prompt and then generate a sequence of images stepping from the first one to the second.",
"added": "2022-11-09",
"tags": ["animation"]
},
{
"name": "prompt travel",
"url": "https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel.git",
"description": "Extension script for AUTOMATIC1111/stable-diffusion-webui to travel between prompts in latent space.",
"added": "2022-11-11",
"tags": ["animation"]
},
{
"name": "Steps Animation",
"url": "https://github.com/vladmandic/sd-extension-steps-animation.git",
"description": "Create animation sequence from denoised intermediate steps.",
"added": "2023-01-21",
"tags": ["animation"]
},
{
"name": "auto-sd-paint-ext",
"url": "https://github.com/Interpause/auto-sd-paint-ext.git",
"description": "Krita Plugin.",
"added": "2022-11-04",
"tags": ["editing"]
},
{
"name": "Detection Detailer",
"url": "https://github.com/dustysys/ddetailer.git",
"description": "An object detection and auto-mask extension for Stable Diffusion web UI.",
"added": "2022-11-09",
"tags": ["editing"]
},
{
"name": "Batch Face Swap",
"url": "https://github.com/kex0/batch-face-swap.git",
"description": "Automatically detects faces and replaces them.",
"added": "2023-01-13",
"tags": ["editing"]
},
{
"name": "Depth Maps",
"url": "https://github.com/thygate/stable-diffusion-webui-depthmap-script.git",
"description": "Depth Maps, Stereo Image, 3D Mesh and Video generator extension.",
"added": "2022-11-30",
"tags": ["editing"]
},
{
"name": "multi-subject-render",
"url": "https://github.com/Extraltodeus/multi-subject-render.git",
"description": "It is a depth aware extension that can help to create multiple complex subjects on a single image. It generates a background, then multiple foreground subjects, cuts their backgrounds after a depth analysis, paste them onto the background and finally does an img2img for a clean finish.",
"added": "2022-11-24",
"tags": ["editing", "manipulations"]
},
{
"name": "depthmap2mask",
"url": "https://github.com/Extraltodeus/depthmap2mask.git",
"description": "Create masks for img2img based on a depth estimation made by MiDaS.",
"added": "2022-11-26",
"tags": ["editing", "manipulations"]
},
{
"name": "ABG_extension",
"url": "https://github.com/KutsuyaYuki/ABG_extension.git",
"description": "Automatically remove backgrounds. Uses an onnx model fine-tuned for anime images. Runs on GPU.",
"added": "2022-12-24",
"tags": ["editing"]
},
{
"name": "Pixelization",
"url": "https://github.com/AUTOMATIC1111/stable-diffusion-webui-pixelization.git",
"description": "Using pre-trained models, produce pixel art out of images in the extras tab.",
"added": "2023-01-23",
"tags": ["editing"]
},
{
"name": "haku-img",
"url": "https://github.com/KohakuBlueleaf/a1111-sd-webui-haku-img.git",
"description": "Image utils extension. Allows blending, layering, hue and color adjustments, blurring and sketch effects, and basic pixelization.",
"added": "2023-01-17",
"tags": ["tab", "editing"]
},
{
"name": "Asymmetric Tiling",
"url": "https://github.com/tjm35/asymmetric-tiling-sd-webui.git",
"description": "An always visible script extension to configure seamless image tiling independently for the X and Y axes.",
"added": "2023-01-13",
"tags": ["manipulations"]
},
{
"name": "Latent Mirroring",
"url": "https://github.com/dfaker/SD-latent-mirroring.git",
"description": "Applies mirroring and flips to the latent images to produce anything from subtle balanced compositions to perfect reflections",
"added": "2022-11-06",
"tags": ["manipulations"]
},
{
"name": "Sonar",
"url": "https://github.com/Kahsolt/stable-diffusion-webui-sonar.git",
"description": "Improve the generated image quality, searches for similar (yet even better!) images in the neighborhood of some known image, focuses on single prompt optimization rather than traveling between multiple prompts.",
"added": "2023-01-12",
"tags": ["manipulations"]
},
{
"name": "Depth Image I/O",
"url": "https://github.com/AnonymousCervine/depth-image-io-for-SDWebui.git",
"description": "An extension to allow managing custom depth inputs to Stable Diffusion depth2img models.",
"added": "2023-01-17",
"tags": ["manipulations"]
},
{
"name": "Ultimate SD Upscale",
"url": "https://github.com/Coyote-A/ultimate-upscale-for-automatic1111.git",
"description": "More advanced options for SD Upscale, less artifacts than original using higher denoise ratio (0.3-0.5).",
"added": "2023-01-10",
"tags": ["manipulations"]
},
{
"name": "Fusion",
"url": "https://github.com/ljleb/prompt-fusion-extension.git",
"description": "Adds prompt-travel and shift-attention-like interpolations (see exts), but during/within the sampling steps. Always-on + works w/ existing prompt-editing syntax. Various interpolation modes. See their wiki for more info.",
"added": "2023-01-28",
"tags": ["manipulations"]
},
{
"name": "Dynamic Thresholding",
"url": "https://github.com/mcmonkeyprojects/sd-dynamic-thresholding.git",
"description": "Adds customizable dynamic thresholding to allow high CFG Scale values without the burning / 'pop art' effect.",
"added": "2023-02-01",
"tags": ["manipulations"]
},
{
"name": "anti-burn",
"url": "https://github.com/klimaleksus/stable-diffusion-webui-anti-burn.git",
"description": "Smoothing generated images by skipping a few very last steps and averaging together some images before them.",
"added": "2023-02-09",
"tags": ["manipulations"]
},
{
"name": "sd-webui-controlnet",
"url": "https://github.com/Mikubill/sd-webui-controlnet.git",
"description": "WebUI extension for ControlNet. Note: (WIP), so don't expect seed reproducibility - as updates may change things.",
"added": "2023-02-18",
"tags": ["manipulations"]
},
{
"name": "Latent Couple",
"url": "https://github.com/opparco/stable-diffusion-webui-two-shot.git",
"description": "An extension of the built-in Composable Diffusion, allows you to determine the region of the latent space that reflects your subprompts.",
"added": "2023-02-18",
"tags": ["manipulations"]
},
{
"name": "Composable LoRA",
"url": "https://github.com/opparco/stable-diffusion-webui-composable-lora.git",
"description": "Enables using AND keyword(composable diffusion) to limit LoRAs to subprompts. Useful when paired with Latent Couple extension.",
"added": "2023-02-25",
"tags": ["manipulations"]
},
{
"name": "Auto TLS-HTTPS",
"url": "https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https.git",
"description": "Allows you to easily, or even completely automatically start using HTTPS.",
"added": "2022-11-14",
"tags": ["script"]
},
{
"name": "booru2prompt",
"url": "https://github.com/Malisius/booru2prompt.git",
"description": "This SD extension allows you to turn posts from various image boorus into stable diffusion prompts. It does so by pulling a list of tags down from their API. You can copy-paste in a link to the post you want yourself, or use the built-in search feature to do it all without leaving SD.",
"added": "2022-11-21",
"tags": ["tab", "online"]
},
{
"name": "Gelbooru Prompt",
"url": "https://github.com/antis0007/sd-webui-gelbooru-prompt.git",
"description": "Extension that gets tags for saved gelbooru images in AUTOMATIC1111's Stable Diffusion webui",
"added": "2022-12-20",
"tags": ["online"]
},
{
"name": "NSFW checker",
"url": "https://github.com/AUTOMATIC1111/stable-diffusion-webui-nsfw-censor.git",
"description": "Replaces NSFW images with black.",
"added": "2022-12-10",
"tags": ["script"]
},
{
"name": "Diffusion Defender",
"url": "https://github.com/WildBanjos/DiffusionDefender.git",
"description": "Prompt blacklist, find and replace, for semi-private and public instances.",
"added": "2022-12-20",
"tags": ["script"]
},
{
"name": "DH Patch",
"url": "https://github.com/d8ahazard/sd_auto_fix.git",
"description": "Random patches by D8ahazard. Auto-load config YAML files for v2, 2.1 models; patch latent-diffusion to fix attention on 2.1 models (black boxes without no-half), whatever else I come up with.",
"added": "2022-12-16",
"tags": ["script"]
},
{
"name": "Riffusion",
"url": "https://github.com/enlyth/sd-webui-riffusion.git",
"description": "Use Riffusion model to produce music in gradio. To replicate original interpolation technique, input the prompt travel extension output frames into the riffusion tab.",
"added": "2022-12-19",
"tags": ["tab"]
},
{
"name": "Save Intermediate Images",
"url": "https://github.com/AlUlkesh/sd_save_intermediate_images.git",
"description": "Save intermediate images during the sampling process. You can also make videos from the intermediate images.",
"added": "2022-12-22",
"tags": ["script"]
},
{
"name": "Add image number to grid",
"url": "https://github.com/AlUlkesh/sd_grid_add_image_number.git",
"description": "Add the image's number to its picture in the grid.",
"added": "2023-01-01",
"tags": ["script"]
},
{
"name": "Multiple Hypernetworks",
"url": "https://github.com/antis0007/sd-webui-multiple-hypernetworks.git",
"description": "Adds the ability to apply multiple hypernetworks at once. Apply multiple hypernetworks sequentially, with different weights.",
"added": "2023-01-13",
"tags": ["script"]
},
{
"name": "System Info",
"url": "https://github.com/vladmandic/sd-extension-system-info.git",
"description": "System Info tab for WebUI which shows realtime information of the server. Also supports sending crowdsourced inference data as an option.",
"added": "2023-01-21",
"tags": ["script", "tab"]
},
{
"name": "OpenPose Editor",
"url": "https://github.com/fkunn1326/openpose-editor.git",
"description": "This can add multiple pose characters, detect pose from image, save to PNG, and send to controlnet extension.",
"added": "2023-02-18",
"tags": ["tab"]
},
{
"name": "Stable Horde Worker",
"url": "https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker.git",
"description": "Worker Client for Stable Horde. Generate pictures for other users with your PC. Please see readme for additional instructions.",
"added": "2023-01-10",
"tags": ["tab", "online"]
},
{
"name": "Stable Horde Client",
"url": "https://github.com/natanjunges/stable-diffusion-webui-stable-horde.git",
"description": "Stable Horde Client. Generate pictures using other user's PC. Useful if u have no GPU.",
"added": "2023-01-11",
"tags": ["tab", "online"]
},
{
"name": "Discord Rich Presence",
"url": "https://github.com/kabachuha/discord-rpc-for-automatic1111-webui.git",
"description": "Provides connection to Discord RPC, showing a fancy table in the user profile.",
"added": "2023-01-20",
"tags": ["online"]
},
{
"name": "mine-diffusion",
"url": "https://github.com/fropych/mine-diffusion.git",
"description": "This extension converts images into blocks and creates schematics for easy importing into Minecraft using the Litematica mod.",
"added": "2023-02-11",
"tags": ["tab", "online"]
},
{
"name": "Aesthetic Image Scorer",
"url": "https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer.git",
"description": "Calculates aesthetic score for generated images using CLIP+MLP Aesthetic Score Predictor based on Chad Scorer",
"added": "2022-11-01",
"tags": ["query"]
},
{
"name": "Aesthetic Scorer",
"url": "https://github.com/vladmandic/sd-extension-aesthetic-scorer.git",
"description": "Uses existing CLiP model with an additional small pretrained model to calculate perceived aesthetic score of an image.",
"added": "2023-01-21",
"tags": ["query"]
},
{
"name": "cafe-aesthetic",
"url": "https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic.git",
"description": "Pre-trained model, determines if aesthetic/non-aesthetic, does 5 different style recognition modes, and Waifu confirmation. Also has a tab with Batch processing.",
"added": "2023-01-28",
"tags": ["tab", "query"]
},
{
"name": "Clip Interrogator",
"url": "https://github.com/pharmapsychotic/clip-interrogator-ext.git",
"description": "Clip Interrogator by pharmapsychotic ported to an extension. Features a variety of clip models and interrogate settings.",
"added": "2023-02-21",
"tags": ["tab", "query"]
},
{
"name": "Visualize Cross-Attention",
"url": "https://github.com/benkyoujouzu/stable-diffusion-webui-visualize-cross-attention-extension.git",
"description": "Generates highlighted sectors of a submitted input image, based on input prompts. Use with tokenizer extension. See the readme for more info.",
"added": "2022-11-25",
"tags": ["tab", "science"]
},
{
"name": "DAAM",
"url": "https://github.com/toriato/stable-diffusion-webui-daam.git",
"description": "DAAM stands for Diffusion Attentive Attribution Maps. Enter the attention text (must be a string contained in the prompt) and run. An overlapping image with a heatmap for each attention will be generated along with the original image.",
"added": "2022-12-02",
"tags": ["science"]
},
{
"name": "Dump U-Net",
"url": "https://github.com/hnmr293/stable-diffusion-webui-dumpunet.git",
"description": "View different layers, observe U-Net feature maps. Image generation by giving different prompts for each block of the unet: https://note.com/kohya_ss/n/n93b7c01b0547",
"added": "2023-03-04",
"tags": ["science"]
},
{
"name": "posex",
"url": "https://github.com/hnmr293/posex.git",
"description": "Estimated Image Generator for Pose2Image. This extension allows moving the openpose figure in 3d space.",
"added": "2023-03-04",
"tags": ["script"]
},
{
"name": "LLuL",
"url": "https://github.com/hnmr293/sd-webui-llul.git",
"description": "Local Latent Upscaler. Target an area to selectively enhance details.",
"added": "2023-03-04",
"tags": ["manipulations"]
},
{
"name": "CFG-Schedule-for-Automatic1111-SD",
"url": "https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD.git",
"description": "These scripts allow for dynamic CFG control during generation steps. With the right settings, this could help get the details of high CFG without damaging the generated image even with low denoising in img2img.",
"added": "2023-03-04",
"tags": ["script"]
},
{
"name": "a1111-sd-webui-locon",
"url": "https://github.com/KohakuBlueleaf/a1111-sd-webui-locon.git",
"description": "An extension for loading LoCon networks in webui.",
"added": "2023-03-04",
"tags": ["script"]
},
{
"name": "ebsynth_utility",
"url": "https://github.com/s9roll7/ebsynth_utility.git",
"description": "Extension for creating videos using img2img and ebsynth. Output edited videos using ebsynth. Works with ControlNet extension.",
"added": "2023-03-04",
"tags": ["tab", "animation"]
},
{
"name": "VRAM Estimator",
"url": "https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator.git",
"description": "Runs txt2img, img2img, highres-fix at increasing dimensions and batch sizes until OOM, and outputs data to graph.",
"added": "2023-03-05",
"tags": ["tab"]
},
{
"name": "MultiDiffusion with Tiled VAE",
"url": "https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111.git",
"description": "Seamless Image Fusion, along with vram efficient tiled vae script.",
"added": "2023-03-08",
"tags": ["manipulations"]
},
{
"name": "3D Model Loader",
"url": "https://github.com/jtydhr88/sd-3dmodel-loader.git",
"description": "Load your 3D model/animation inside webui, then send screenshot to txt2img or img2img to ControlNet.",
"added": "2023-03-11",
"tags": ["tab"]
},
{
"name": "Corridor Crawler Outpainting",
"url": "https://github.com/brick2face/corridor-crawler-outpainting.git",
"description": "Generate hallways with the depth-to-image model at 512 resolution. It can be tweaked to work with other models/resolutions.",
"added": "2023-03-11",
"tags": ["tab"]
},
{
"name": "Panorama Viewer",
"url": "https://github.com/GeorgLegato/sd-webui-panorama-viewer.git",
"description": "Provides a tab to display equirectangular images in interactive 3d-view.",
"added": "2023-03-11",
"tags": ["tab"]
},
{
"name": "db-storage1111",
"url": "https://github.com/takoyaro/db-storage1111.git",
"description": "Allows to store pictures and their metadata in a database. (supports MongoDB)",
"added": "2023-03-12",
"tags": ["script"]
},
{
"name": "zh_CN Localization",
"url": "https://github.com/dtlnor/stable-diffusion-webui-localization-zh_CN",
"description": "Simplified Chinese localization, recommend using with Bilingual Localization.",
"added": "2022-11-06",
"tags": ["localization"]
},
{
"name": "zh_TW Localization",
"url": "https://github.com/benlisquare/stable-diffusion-webui-localization-zh_TW",
"description": "Traditional Chinese localization",
"added": "2022-11-09",
"tags": ["localization"]
},
{
"name": "ko_KR Localization",
"url": "https://github.com/36DB/stable-diffusion-webui-localization-ko_KR",
"description": "Korean localization",
"added": "2022-11-06",
"tags": ["localization"]
},
{
"name": "th_TH Localization",
"url": "https://github.com/econDS/thai-localization-for-Automatic-stable-diffusion-webui",
"description": "Thai localization",
"added": "2022-12-30",
"tags": ["localization"]
},
{
"name": "es_ES Localization",
"url": "https://github.com/innovaciones/stable-diffusion-webui-localization-es_ES",
"description": "Spanish localization",
"added": "2022-11-09",
"tags": ["localization"]
},
{
"name": "it_IT Localization",
"url": "https://github.com/Harvester62/stable-diffusion-webui-localization-it_IT",
"description": "Italian localization",
"added": "2022-11-07",
"tags": ["localization"]
},
{
"name": "de_DE Localization",
"url": "https://github.com/Strothis/stable-diffusion-webui-de_DE",
"description": "German localization",
"added": "2022-11-07",
"tags": ["localization"]
},
{
"name": "ja_JP Localization",
"url": "https://github.com/Katsuyuki-Karasawa/stable-diffusion-webui-localization-ja_JP",
"description": "Japanese localization",
"added": "2022-11-07",
"tags": ["localization"]
},
{
"name": "pt_BR Localization",
"url": "https://github.com/M-art-ucci/stable-diffusion-webui-localization-pt_BR",
"description": "Brazillian portuguese localization",
"added": "2022-11-09",
"tags": ["localization"]
},
{
"name": "tr_TR Localization",
"url": "https://github.com/camenduru/stable-diffusion-webui-localization-tr_TR",
"description": "Turkish localization",
"added": "2022-11-12",
"tags": ["localization"]
},
{
"name": "no_NO Localization",
"url": "https://github.com/Cyanz83/stable-diffusion-webui-localization-no_NO",
"description": "Norwegian localization",
"added": "2022-11-16",
"tags": ["localization"]
},
{
"name": "ru_RU Localization",
"url": "https://github.com/ProfaneServitor/stable-diffusion-webui-localization-ru_RU",
"description": "Russian localization",
"added": "2022-11-20",
"tags": ["localization"]
},
{
"name": "fi_FI Localization",
"url": "https://github.com/otsoniemi/stable-diffusion-webui-localization-fi_FI",
"description": "Finnish localization",
"added": "2022-12-28",
"tags": ["localization"]
},
{
"name": "old localizations",
"url": "https://github.com/AUTOMATIC1111/stable-diffusion-webui-old-localizations.git",
"description": "Old unmaintained localizations that used to be a part of main repository",
"added": "2022-11-08",
"tags": ["localization"]
}
]
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>General Info</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>General Info</h1>
<p>Extensions are a more convenient form of user scripts.</p>
<p>Extensions all exist in their own folder inside the extensions folder of webui. You can use git to install an extension like this:</p>
<pre><code>git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients extensions/aesthetic-gradients
</code></pre>
<p>This installs an extension from <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients">https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients</a> into the extensions/aesthetic-gradients directory.</p>
<p>Alternatively you can just copy-paste a directory into extensions.</p>
<p>For developing extensions, see <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions">Developing extensions</a>.</p>
<h1>Security</h1>
<p>As extensions allow the user to install and run arbitrary code, this can be used maliciously, and is disabled by default when running with options that allow remote users to connect to the server (<code>--share</code> or <code>--listen</code>) - you’ll still have the UI, but trying to install anything will result in error. If you want to use those options and still be able to install extensions, use <code>--enable-insecure-extension-access</code> command line flag.</p>
<h1>Extensions</h1>
<h2>MultiDiffusion with Tiled VAE</h2>
<p><a href="https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111">https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111</a></p>
<h3>MultiDiffusion</h3>
<ul>
<li>txt2img panorama generation, as mentioned in MultiDiffusion.</li>
<li>It can cooperate with ControlNet to produce wide images with control.</li>
</ul>
<p>Panorama Example:(links not working as of Jun 2023)
Before: <a href="https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/blob/docs/imgs/ancient_city_origin.jpeg">click for the raw image</a>
After: <a href="https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/blob/docs/imgs/ancient_city.jpeg">click for the raw image</a></p>
<p>ControlNet Canny Output: <a href="https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/raw/docs/imgs/yourname.jpeg?raw=true">https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/raw/docs/imgs/yourname.jpeg?raw=true</a></p>
<h3>Tiled Vae</h3>
<p>The <code>vae_optimize.py</code> script splits the image into tiles, encodes each tile separately, and merges the results. This process allows the VAE to generate large images with limited VRAM (~10 GB for 8K images).</p>
<p>Using this script may allow removal of --lowvram or --medvram arguments, and thus improve image generation times.</p>
<h2>VRAM Estimator</h2>
<p><a href="https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator">https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator</a></p>
<p>Runs txt2img, img2img, highres-fix at increasing dimensions and batch sizes until OOM, and outputs data to graph.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223624383-545aeb31-c001-4ba6-bdb8-23e688130b8f.png" alt="image"></figure>
<h2>Dump U-Net</h2>
<p><a href="https://github.com/hnmr293/stable-diffusion-webui-dumpunet">https://github.com/hnmr293/stable-diffusion-webui-dumpunet</a></p>
<p>View different layers, observe U-Net feature maps. Allows Image generation by giving different prompts for each block of the unet: <a href="https://note.com/kohya_ss/n/n93b7c01b0547">https://note.com/kohya_ss/n/n93b7c01b0547</a></p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223624012-2df926d5-d4c4-44bc-a04f-bed15d43b88f.png" alt="image"></figure>
<h2>posex</h2>
<p><a href="https://github.com/hnmr293/posex">https://github.com/hnmr293/posex</a></p>
<p>Estimated Image Generator for Pose2Image. This extension allows moving the openpose figure in 3d space.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223622234-26907947-a723-4671-ae42-60a0011bfda2.png" alt="image"></figure>
<h2>LLuL</h2>
<p><a href="https://github.com/hnmr293/sd-webui-llul">https://github.com/hnmr293/sd-webui-llul</a></p>
<p>Local Latent Upscaler. Target an area to selectively enhance details.</p>
<p><a href="https://user-images.githubusercontent.com/120772120/221390831-9fbccdf8-5898-4515-b988-d6733e8af3f1.mp4">https://user-images.githubusercontent.com/120772120/221390831-9fbccdf8-5898-4515-b988-d6733e8af3f1.mp4</a></p>
<h2>CFG-Schedule-for-Automatic1111-SD</h2>
<p><a href="https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD">https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD</a></p>
<p>These 2 scripts allow for dynamic CFG control during generation steps. With the right settings, this could help get the details of high CFG without damaging the generated image even with low denoising in img2img.</p>
<p>See their <a href="https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD/wiki/CFG-Auto-script">wiki</a> on how to use.</p>
<h2>a1111-sd-webui-locon</h2>
<p><a href="https://github.com/KohakuBlueleaf/a1111-sd-webui-locon">https://github.com/KohakuBlueleaf/a1111-sd-webui-locon</a>
An extension for loading LoCon networks in webui.</p>
<h2>ebsynth_utility</h2>
<p><a href="https://github.com/s9roll7/ebsynth_utility">https://github.com/s9roll7/ebsynth_utility</a></p>
<p>Extension for creating videos using img2img and ebsynth. Output edited videos using ebsynth. Works with ControlNet extension.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223622872-0575abe9-9a53-4614-b9a5-1333f0b34733.png" alt="image"></figure>
<h2>LoRA Block Weight</h2>
<p>LoRA is a powerful tool, but it is sometimes difficult to use and can affect areas that you do not want it to affect. This script allows you to set the weights block-by-block. Using this script, you may be able to get the image you want.</p>
<p>Used in conjunction with the XY plot, it is possible to examine the impact of each level of the hierarchy.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223573538-d8fdb00d-6c49-47ec-af63-cea691f515d4.png" alt="image"></figure>
<p>Included Presets:</p>
<pre><code>NOT:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ALL:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
INS:1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
IND:1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0
INALL:1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0
MIDD:1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0
OUTD:1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0
OUTS:1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1
OUTALL:1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1
</code></pre>
<h2>Kitchen Theme</h2>
<p><a href="https://github.com/canisminor1990/sd-web-ui-kitchen-theme">https://github.com/canisminor1990/sd-web-ui-kitchen-theme</a></p>
<p>A custom theme for webui.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223572989-e51eb877-74f4-41ec-8204-233221f2e981.png" alt="image"></figure>
<h2>Bilingual Localization</h2>
<p><a href="https://github.com/journey-ad/sd-webui-bilingual-localization">https://github.com/journey-ad/sd-webui-bilingual-localization</a></p>
<p>Bilingual translation, no need to worry about how to find the original button. Compatible with language pack extensions, no need to re-import.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223564624-61594e71-d1dd-4f32-9293-9697b07a7735.png" alt="image"></figure>
<h2>Composable LoRA</h2>
<p><a href="https://github.com/opparco/stable-diffusion-webui-composable-lora">https://github.com/opparco/stable-diffusion-webui-composable-lora</a></p>
<p>Enables using AND keyword(composable diffusion) to limit LoRAs to subprompts. Useful when paired with Latent Couple extension.</p>
<h2>Clip Interrogator</h2>
<p><a href="https://github.com/pharmapsychotic/clip-interrogator-ext">https://github.com/pharmapsychotic/clip-interrogator-ext</a></p>
<p>Clip Interrogator by pharmapsychotic ported to an extension. Features a variety of clip models and interrogate settings.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223572478-093030bf-e25e-42c0-b621-597515deaf69.png" alt="image"></figure>
<h2>Latent-Couple</h2>
<p><a href="https://github.com/opparco/stable-diffusion-webui-two-shot">https://github.com/opparco/stable-diffusion-webui-two-shot</a></p>
<p>An extension of the built-in Composable Diffusion, allows you to determine the region of the latent space that reflects your subprompts.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223571685-95a300f9-b768-4bca-96d4-684aadae9863.png" alt="image"></figure>
<h2>OpenPose Editor</h2>
<p><a href="https://github.com/fkunn1326/openpose-editor">https://github.com/fkunn1326/openpose-editor</a></p>
<p>This can add multiple pose characters, detect pose from image, save to PNG, and send to controlnet extension.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223571127-6c107bd8-7ca4-4774-bdb8-41930863fdcc.png" alt="image"></figure>
<h2>SuperMerger</h2>
<p><a href="https://github.com/hako-mikan/sd-webui-supermerger">https://github.com/hako-mikan/sd-webui-supermerger</a></p>
<p>Merge and run without saving to drive. Sequential XY merge generations; extract and merge LoRA’s, bind LoRA’s to ckpt, merge block weights, and more.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223570729-d25ca5c4-a434-42fd-b85d-7e16a7af1fc8.png" alt="image"></figure>
<h2>Prompt Translator</h2>
<p><a href="https://github.com/butaixianran/Stable-Diffusion-Webui-Prompt-Translator">https://github.com/butaixianran/Stable-Diffusion-Webui-Prompt-Translator</a></p>
<p>A integrated translator for translating prompts to English using Deepl or Baidu.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223565541-43f618ea-e009-41b5-880c-7360a9ebec5f.png" alt="image"></figure>
<h2>Video Loopback</h2>
<p><a href="https://github.com/fishslot/video_loopback_for_webui">https://github.com/fishslot/video_loopback_for_webui</a></p>
<p><a href="https://user-images.githubusercontent.com/122792358/218375476-a4116c74-5a9a-41e2-970a-c3cc09f796ae.mp4">https://user-images.githubusercontent.com/122792358/218375476-a4116c74-5a9a-41e2-970a-c3cc09f796ae.mp4</a></p>
<h2>Mine Diffusion</h2>
<p><a href="https://github.com/fropych/mine-diffusion">https://github.com/fropych/mine-diffusion</a></p>
<p>This extension converts images into blocks and creates schematics for easy importing into Minecraft using the Litematica mod.</p>
<details><summary>Example: (Click to expand:)</summary>
<figure><img src="https://github.com/fropych/mine-diffusion/blob/master/README_images/demo.gif" alt=""></figure>
</details>
<h2>anti-burn</h2>
<p><a href="https://github.com/klimaleksus/stable-diffusion-webui-anti-burn">https://github.com/klimaleksus/stable-diffusion-webui-anti-burn</a></p>
<p>Smoothing generated images by skipping a few very last steps and averaging together some images before them.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223562829-1abe8eed-dca5-4891-88e2-6714966e02bc.png" alt="image"></figure>
<h2>Embedding Merge</h2>
<p><a href="https://github.com/klimaleksus/stable-diffusion-webui-embedding-merge">https://github.com/klimaleksus/stable-diffusion-webui-embedding-merge</a></p>
<p>Merging Textual Inversion embeddings at runtime from string literals.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223562706-af7cc1e6-7b6c-4069-a89f-8087a2dba4da.png" alt="image"></figure>
<h2>gif2gif</h2>
<p>The purpose of this script is to accept an animated gif as input, process frames as img2img typically would, and recombine them back into an animated gif. Intended to provide a fun, fast, gif-to-gif workflow that supports new models and methods such as Controlnet and InstructPix2Pix. Drop in a gif and go. Referenced code from prompts_from_file.</p>
<details><summary>Example: (Click to expand:)</summary>
<figure><img src="https://user-images.githubusercontent.com/93007558/216803715-81dfc9e6-8c9a-47d5-9879-27acfac34eb8.gif" alt=""></figure>
</details>
<h2>cafe-aesthetic</h2>
<p><a href="https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic">https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic</a></p>
<p>Pre-trained model, determines if aesthetic/non-aesthetic, does 5 different style recognition modes, and Waifu confirmation. Also has a tab with Batch processing.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223562229-cba2db0a-3368-4f13-9456-ebe2053c01a3.png" alt="image"></figure>
<h2>Catppuccin themes</h2>
<p><a href="https://github.com/catppuccin/stable-diffusion-webui">https://github.com/catppuccin/stable-diffusion-webui</a></p>
<p>Catppuccin is a community-driven pastel theme that aims to be the middle ground between low and high contrast themes. Adds set of themes which are in compliance with catppucin guidebook.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223562461-13ec3132-4734-4787-a161-b2c408646835.png" alt="image"></figure>
<h2>Dynamic Thresholding</h2>
<p>Dynamic Thresholding adds customizable dynamic thresholding to allow high CFG Scale values without the burning / ‘pop art’ effect.</p>
<h2>Custom Diffusion</h2>
<p><a href="https://github.com/guaneec/custom-diffusion-webui">https://github.com/guaneec/custom-diffusion-webui</a></p>
<p>Custom Diffusion is a form of fine-tuning with TI, instead of tuning the whole model. Similar speed and memory requirements to TI and may give better results in fewer steps.</p>
<h2>Fusion</h2>
<p><a href="https://github.com/ljleb/prompt-fusion-extension">https://github.com/ljleb/prompt-fusion-extension</a></p>
<p>Adds prompt-travel and shift-attention-like interpolations (see exts), but during/within the sampling steps. Always-on + works with existing prompt-editing syntax. Various interpolation modes. See their wiki for more info.</p>
<details><summary>Example: (Click to expand:)</summary>
<figure><img src="https://user-images.githubusercontent.com/32277961/214725976-b72bafc6-0c5d-4491-9c95-b73da41da082.gif" alt=""></figure>
</details>
<h2>Pixelization</h2>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-pixelization">https://github.com/AUTOMATIC1111/stable-diffusion-webui-pixelization</a></p>
<p>Using pre-trained models, produce pixel art out of images in the extras tab.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223563687-cb0eb3fe-0fce-4822-8170-20b719f394fa.png" alt="image"></figure>
<h2>Instruct-pix2pix</h2>
<p><a href="https://github.com/Klace/stable-diffusion-webui-instruct-pix2pix">https://github.com/Klace/stable-diffusion-webui-instruct-pix2pix</a></p>
<p>Adds a tab for doing img2img editing with the instruct-pix2pix model. The author added the feature to webui, so this doesn’t need to be used.</p>
<h2>System Info</h2>
<p><a href="https://github.com/vladmandic/sd-extension-system-info">https://github.com/vladmandic/sd-extension-system-info</a></p>
<p>Creates a top-level <strong>System Info</strong> tab in Automatic WebUI with</p>
<p><em>Note</em>:</p>
<ul>
<li>State &amp; memory info are auto-updated every second if tab is visible<br>
(no updates are performed when tab is not visible)</li>
<li>All other information is updated once upon WebUI load and<br>
can be force refreshed if required</li>
</ul>
<figure><img src="https://raw.githubusercontent.com/vladmandic/sd-extension-system-info/main/system-info.jpg" alt="screenshot"></figure>
<h2>Steps Animation</h2>
<p><a href="https://github.com/vladmandic/sd-extension-steps-animation">https://github.com/vladmandic/sd-extension-steps-animation</a></p>
<p>Extension to create animation sequence from denoised intermediate steps<br>
Registers a script in <strong>txt2img</strong> and <strong>img2img</strong> tabs</p>
<p>Creating animation has minimum impact on overall performance as it does not require separate runs<br>
except adding overhead of saving each intermediate step as image plus few seconds to actually create movie file</p>
<p>Supports <strong>color</strong> and <strong>motion</strong> interpolation to achieve animation of desired duration from any number of interim steps<br>
Resulting movie fiels are typically very small (<em>~1MB being average</em>) due to optimized codec settings</p>
<figure><img src="https://raw.githubusercontent.com/vladmandic/sd-extension-steps-animation/main/steps-animation.jpg" alt="screenshot"></figure>
<h3><a href="https://user-images.githubusercontent.com/57876960/212490617-f0444799-50e5-485e-bc5d-9c24a9146d38.mp4">Example</a></h3>
<h2>Aesthetic Scorer</h2>
<p><a href="https://github.com/vladmandic/sd-extension-aesthetic-scorer">https://github.com/vladmandic/sd-extension-aesthetic-scorer</a></p>
<p>Uses existing CLiP model with an additional small pretrained to calculate perceived aesthetic score of an image</p>
<p>Enable or disable via <code>Settings</code> -&gt; <code>Aesthetic scorer</code></p>
<p>This is an <em>“invisible”</em> extension, it runs in the background before any image save and<br>
appends <strong><code>score</code></strong> as <em>PNG info section</em> and/or <em>EXIF comments</em> field</p>
<h3>Notes</h3>
<ul>
<li>Configuration via <strong>Settings</strong><strong>Aesthetic scorer</strong><br>
<img src="https://raw.githubusercontent.com/vladmandic/sd-extension-aesthetic-scorer/main/aesthetic-scorer.jpg" alt="screenshot"></li>
<li>Extension obeys existing <strong>Move VAE and CLiP to RAM</strong> settings</li>
<li>Models will be auto-downloaded upon first usage (small)</li>
<li>Score values are <code>0..10</code></li>
<li>Supports both <code>CLiP-ViT-L/14</code> and <code>CLiP-ViT-B/16</code></li>
<li>Cross-platform!</li>
</ul>
<h2>Discord Rich Presence</h2>
<p><a href="https://github.com/kabachuha/discord-rpc-for-automatic1111-webui">https://github.com/kabachuha/discord-rpc-for-automatic1111-webui</a></p>
<p>Provides connection to Discord RPC, showing a fancy table in the user profile.</p>
<h2>Promptgen</h2>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen">https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen</a></p>
<p>Use transformers models to generate prompts.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223561862-27815193-acfd-47cb-ae67-fcc435b2c875.png" alt="image"></figure>
<h2>haku-img</h2>
<p><a href="https://github.com/KohakuBlueleaf/a1111-sd-webui-haku-img">https://github.com/KohakuBlueleaf/a1111-sd-webui-haku-img</a></p>
<p>Image utils extension. Allows blending, layering, hue and color adjustments, blurring and sketch effects, and basic pixelization.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223561769-294ee4fa-f857-4dc9-afbf-dfe953e8c6ad.png" alt="image"></figure>
<h2>Merge Block Weighted</h2>
<p><a href="https://github.com/bbc-mc/sdweb-merge-block-weighted-gui">https://github.com/bbc-mc/sdweb-merge-block-weighted-gui</a></p>
<p>Merge models with separate rate for each 25 U-Net block (input, middle, output).</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223561099-c9cb6fab-c3c6-42fb-92fd-6811474d073c.png" alt="image"></figure>
<h2>Stable Horde Worker</h2>
<p><a href="https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker">https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker</a></p>
<p>An unofficial <a href="https://stablehorde.net/">Stable Horde</a> worker bridge as a <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">Stable Diffusion WebUI</a> extension.</p>
<h3>Features</h3>
<p><strong>This extension is still WORKING IN PROGRESS</strong>, and is not ready for production use.</p>
<ul>
<li>Get jobs from Stable Horde, generate images and submit generations</li>
<li>Configurable interval between every jobs</li>
<li>Enable and disable extension whenever</li>
<li>Detect current model and fetch corresponding jobs on the fly</li>
<li>Show generation images in the Stable Diffusion WebUI</li>
<li>Save generation images with png info text to local</li>
</ul>
<h3>Install</h3>
<ul>
<li>
<p>Run the following command in the root directory of your Stable Diffusion WebUI installation:</p>
<pre><code class="language-bash">git <span class="hljs-built_in">clone</span> https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker.git extensions/stable-horde-worker
</code></pre>
</li>
<li>
<p>Launch the Stable Diffusion WebUI, You would see the <code>Stable Horde Worker</code> tab page.</p>
<figure><img src="./screenshots/settings.png" alt="settings"></figure>
</li>
<li>
<p>Register an account on <a href="https://stablehorde.net/">Stable Horde</a> and get your <code>API key</code> if you don’t have one.</p>
<p><strong>Note</strong>: the default anonymous key <code>00000000</code> is not working for a worker, you need to register an account and get your own key.</p>
</li>
<li>
<p>Setup your <code>API key</code> here.</p>
</li>
<li>
<p>Setup <code>Worker name</code> here with a proper name.</p>
</li>
<li>
<p>Make sure <code>Enable</code> is checked.</p>
</li>
<li>
<p>Click the <code>Apply settings</code> buttons.</p>
</li>
</ul>
<h2>Stable Horde</h2>
<h3>Stable Horde Client</h3>
<p><a href="https://github.com/natanjunges/stable-diffusion-webui-stable-horde">https://github.com/natanjunges/stable-diffusion-webui-stable-horde</a></p>
<p>Generate pictures using other user’s PC. You should be able to receive images from the stable horde with anonymous <code>0000000000</code> api key, however it is recommended to get your own - <a href="https://stablehorde.net/register">https://stablehorde.net/register</a></p>
<p>Note: Retrieving Images may take 2 minutes or more, especially if you have no kudos.</p>
<h2>Multiple hypernetworks</h2>
<p><a href="https://github.com/antis0007/sd-webui-multiple-hypernetworks">https://github.com/antis0007/sd-webui-multiple-hypernetworks</a></p>
<p>Extension that allows the use of multiple hypernetworks at once</p>
<figure><img src="https://user-images.githubusercontent.com/32306715/212293588-a8b4d1e9-4099-4a2e-a61a-f549a70f6096.png" alt="image"></figure>
<h2>Hypernetwork-Monkeypatch-Extension</h2>
<p><a href="https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension">https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension</a></p>
<p>Extension that provides additional training features for hypernetwork training, and supports multiple hypernetworks.</p>
<figure><img src="https://user-images.githubusercontent.com/35677394/212069329-7f3d427f-efad-4424-8dca-4bec010ea429.png" alt="image"></figure>
<h2>Ultimate SD Upscaler</h2>
<p><a href="https://github.com/Coyote-A/ultimate-upscale-for-automatic1111">https://github.com/Coyote-A/ultimate-upscale-for-automatic1111</a></p>
<figure><img src="https://user-images.githubusercontent.com/98228077/223559884-5498d495-c5f3-4068-8711-f9f31fb2d435.png" alt="image"></figure>
<p>More advanced options for SD Upscale, less artifacts than original using higher denoise ratio (0.3-0.5).</p>
<h2>Model Converter</h2>
<p><a href="https://github.com/Akegarasu/sd-webui-model-converter">https://github.com/Akegarasu/sd-webui-model-converter</a></p>
<p>Model convert extension, supports convert fp16/bf16 no-ema/ema-only safetensors.</p>
<h2>Kohya-ss Additional Networks</h2>
<p><a href="https://github.com/kohya-ss/sd-webui-additional-networks">https://github.com/kohya-ss/sd-webui-additional-networks</a></p>
<p>Allows the Web UI to use networks (LoRA) trained by their scripts to generate images. Edit safetensors prompt and additional metadata, and use 2.X LoRAs.
<img src="https://user-images.githubusercontent.com/98228077/223559083-9a5dc069-f73e-48d2-a22c-4db7b983ea40.png" alt="image"></p>
<h2>Add image number to grid</h2>
<p><a href="https://github.com/AlUlkesh/sd_grid_add_image_number">https://github.com/AlUlkesh/sd_grid_add_image_number</a></p>
<p>Add the image’s number to its picture in the grid.</p>
<h2>quick-css</h2>
<p><a href="https://github.com/Gerschel/sd-web-ui-quickcss">https://github.com/Gerschel/sd-web-ui-quickcss</a></p>
<p>Extension for quickly selecting and applying custom.css files, for customizing look and placement of elements in ui.</p>
<p><img src="https://user-images.githubusercontent.com/98228077/210076676-5f6a8e72-5352-4860-8f3d-468ab8e31355.png" alt="image"><img src="https://user-images.githubusercontent.com/98228077/210076407-1c904a6c-6913-4954-8f20-36100df99fba.png" alt="image"></p>
<h2>Prompt Generator</h2>
<p><a href="https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator">https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator</a></p>
<p>Adds a tab to the webui that allows the user to generate a prompt from a small base prompt. Based on <a href="https://huggingface.co/FredZhang7/distilgpt2-stable-diffusion-v2">FredZhang7/distilgpt2-stable-diffusion-v2</a>.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/210076951-36f5d90c-b8c4-4b12-b909-582193deeec1.png" alt="image"></figure>
<h2>model-keyword</h2>
<p><a href="https://github.com/mix1009/model-keyword">https://github.com/mix1009/model-keyword</a></p>
<p>Inserts matching keyword(s) to the prompt automatically. Update extension to get the latest model+keyword mappings.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/209717531-e0ae74ab-b753-4ad1-99b2-e1eda3de5433.png" alt="image"></figure>
<h2>sd-model-preview</h2>
<p><a href="https://github.com/Vetchems/sd-model-preview">https://github.com/Vetchems/sd-model-preview</a></p>
<p>Allows you to create a txt file and jpg/png’s with the same name as your model and have this info easily displayed for later reference in webui.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/209715309-3c523945-5345-4e3d-b1a3-14f923e1bb40.png" alt="image"></figure>
<h2>Enhanced-img2img</h2>
<p><a href="https://github.com/OedoSoldier/enhanced-img2img">https://github.com/OedoSoldier/enhanced-img2img</a></p>
<p>An extension with support for batched and better inpainting. See <a href="https://github.com/OedoSoldier/enhanced-img2img#usage">readme</a> for more details.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/217990537-e8bdbc74-7210-4864-8140-a076a342c695.png" alt="image"></figure>
<h2>openOutpaint extension</h2>
<p><a href="https://github.com/zero01101/openOutpaint-webUI-extension">https://github.com/zero01101/openOutpaint-webUI-extension</a></p>
<p>A tab with the full openOutpaint UI. Run with the --api flag.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/209453250-8bd2d766-56b5-4887-97bc-cb0e22f98dde.png" alt="image"></figure>
<h2>Save Intermediate Images</h2>
<p><a href="https://github.com/AlUlkesh/sd_save_intermediate_images">https://github.com/AlUlkesh/sd_save_intermediate_images</a></p>
<p>Implements saving intermediate images, with more advanced features.</p>
<p><img src="https://user-images.githubusercontent.com/98228077/211706803-f747691d-cca8-4692-90ef-f6a2859ed5cb.jpg" alt="noisy">
<img src="https://user-images.githubusercontent.com/98228077/211706801-fc593dbf-67c4-4983-8a80-c88355ffeba2.jpg" alt="not"></p>
<figure><img src="https://user-images.githubusercontent.com/98228077/217990312-15b4eda2-858a-44b7-91a3-b34af7c487b6.png" alt="image"></figure>
<h2>Riffusion</h2>
<p><a href="https://github.com/enlyth/sd-webui-riffusion">https://github.com/enlyth/sd-webui-riffusion</a></p>
<p>Use Riffusion model to produce music in gradio. To replicate <a href="https://www.riffusion.com/about">original</a> interpolation technique, input the <a href="https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel">prompt travel extension</a> output frames into the riffusion tab.</p>
<p><img src="https://user-images.githubusercontent.com/98228077/209539460-f5c23891-b5e6-46c7-b1a5-b7440a3f031b.png" alt="image"><img src="https://user-images.githubusercontent.com/98228077/209539472-031e623e-f7a2-4da9-9711-8bf73d0cfe6e.png" alt="image"></p>
<h2>DH Patch</h2>
<p><a href="https://github.com/d8ahazard/sd_auto_fix">https://github.com/d8ahazard/sd_auto_fix</a></p>
<p>Random patches by D8ahazard. Auto-load config YAML files for v2, 2.1 models; patch latent-diffusion to fix attention on 2.1 models (black boxes without no-half), whatever else I come up with.</p>
<h2>Preset Utilities</h2>
<p><a href="https://github.com/Gerschel/sd_web_ui_preset_utils">https://github.com/Gerschel/sd_web_ui_preset_utils</a></p>
<p>Preset tool for UI. Supports presets for some custom scripts.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/209540881-2a870282-edb6-4c94-869b-5493cdced01f.png" alt="image"></figure>
<h2>Config-Presets</h2>
<p><a href="https://github.com/Zyin055/Config-Presets">https://github.com/Zyin055/Config-Presets</a></p>
<p>Adds a configurable dropdown to allow you to change UI preset settings in the txt2img and img2img tabs.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208332322-24339554-0274-4add-88a7-d33bba1e3823.png" alt="image"></figure>
<h2>Diffusion Defender</h2>
<p><a href="https://github.com/WildBanjos/DiffusionDefender">https://github.com/WildBanjos/DiffusionDefender</a></p>
<p>Prompt blacklist, find and replace, for semi-private and public instances.</p>
<h2>NSFW checker</h2>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-nsfw-censor">https://github.com/AUTOMATIC1111/stable-diffusion-webui-nsfw-censor</a></p>
<p>Replaces NSFW images with black.</p>
<h2>Infinity Grid Generator</h2>
<p><a href="https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script">https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script</a></p>
<p>Build a yaml file with your chosen parameters, and generate infinite-dimensional grids. Built-in ability to add description text to fields. See readme for usage details.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208332269-88983668-ea7e-45a8-a6d5-cd7a9cb64b3a.png" alt="image"></figure>
<h2>embedding-inspector</h2>
<p><a href="https://github.com/tkalayci71/embedding-inspector">https://github.com/tkalayci71/embedding-inspector</a></p>
<p>Inspect any token(a word) or Textual-Inversion embeddings and find out which embeddings are similar. You can mix, modify, or create the embeddings in seconds. Much more intriguing options have since been released, see <a href="https://github.com/tkalayci71/embedding-inspector#whats-new">here.</a></p>
<figure><img src="https://user-images.githubusercontent.com/98228077/209546038-3f4206bf-2c43-4d58-bf83-6318ade393f4.png" alt="image"></figure>
<h2>Prompt Gallery</h2>
<p><a href="https://github.com/dr413677671/PromptGallery-stable-diffusion-webui">https://github.com/dr413677671/PromptGallery-stable-diffusion-webui</a></p>
<p>Build a yaml file filled with prompts of your character, hit generate, and quickly preview them by their word attributes and modifiers.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208332199-7652146c-2428-4f44-9011-66e81bc87426.png" alt="image"></figure>
<h2>DAAM</h2>
<p><a href="https://github.com/toriato/stable-diffusion-webui-daam">https://github.com/toriato/stable-diffusion-webui-daam</a></p>
<p>DAAM stands for Diffusion Attentive Attribution Maps. Enter the attention text (must be a string contained in the prompt) and run. An overlapping image with a heatmap for each attention will be generated along with the original image.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208332173-ffb92131-bd02-4a07-9531-136822d06c86.png" alt="image"></figure>
<h2>Visualize Cross-Attention</h2>
<p><a href="https://github.com/benkyoujouzu/stable-diffusion-webui-visualize-cross-attention-extension">https://github.com/benkyoujouzu/stable-diffusion-webui-visualize-cross-attention-extension</a></p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208332131-6acdae9a-2b25-4e71-8ab0-6e375c7c0419.png" alt="image"></figure>
<p>Generates highlighted sectors of a submitted input image, based on input prompts. Use with tokenizer extension. See the readme for more info.</p>
<h2>ABG_extension</h2>
<p><a href="https://github.com/KutsuyaYuki/ABG_extension">https://github.com/KutsuyaYuki/ABG_extension</a></p>
<p>Automatically remove backgrounds. Uses an onnx model fine-tuned for anime images. Runs on GPU.</p>
<table>
<thead>
<tr>
<th style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423352-e8ea64e7-8522-4c2c-9350-c7cd50c35c7c.png" alt="test"></th>
<th style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423400-720ddde9-258a-4e68-8a93-73b67dad714e.png" alt="00035-4190733039-cow"></th>
<th style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423428-da7c68db-e7d1-45a1-b931-817de9233a67.png" alt="00021-1317075604-samdoesarts portrait"></th>
<th style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423446-79e676ae-460e-4282-a591-b8b986bfd869.png" alt="00025-2023077221-"></th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423467-789c17ad-d7ed-41a9-a039-802cfcae324a.png" alt="img_-0002-3313071906-bust shot of person"></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423493-dcee7860-a09e-41e0-9397-715f52bdcaab.png" alt="img_-0022-4190733039-cow"></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423521-736f33ca-aafb-4f8b-b067-14916ec6955f.png" alt="img_-0008-1317075604-samdoesarts portrait"></td>
<td style="text-align:center"><img src="https://user-images.githubusercontent.com/98228077/209423546-31b2305a-3159-443f-8a98-4da22c29c415.png" alt="img_-0012-2023077221-"></td>
</tr>
</tbody>
</table>
<h2>depthmap2mask</h2>
<p><a href="https://github.com/Extraltodeus/depthmap2mask">https://github.com/Extraltodeus/depthmap2mask</a></p>
<p>Create masks for img2img based on a depth estimation made by MiDaS.</p>
<p><img src="https://user-images.githubusercontent.com/15731540/204050868-eca8db02-2193-4115-a5b8-e8f5c796e035.png" alt="image"><img src="https://user-images.githubusercontent.com/15731540/204050888-41b00335-50b4-4328-8cfd-8fc5e9cec78b.png" alt="image"><img src="https://user-images.githubusercontent.com/15731540/204050899-8757b774-f2da-4c15-bfa7-90d8270e8287.png" alt="image"></p>
<h2>multi-subject-render</h2>
<p><a href="https://github.com/Extraltodeus/multi-subject-render">https://github.com/Extraltodeus/multi-subject-render</a></p>
<p>It is a depth aware extension that can help to create multiple complex subjects on a single image. It generates a background, then multiple foreground subjects, cuts their backgrounds after a depth analysis, paste them onto the background and finally does an img2img for a clean finish.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331952-019dfd64-182d-4695-bdb0-4367c81e4c43.png" alt="image"></figure>
<h2>Depth Maps</h2>
<p><a href="https://github.com/thygate/stable-diffusion-webui-depthmap-script">https://github.com/thygate/stable-diffusion-webui-depthmap-script</a></p>
<p>Creates depthmaps from the generated images. The result can be viewed on 3D or holographic devices like VR headsets or lookingglass display, used in Render or Game- Engines on a plane with a displacement modifier, and maybe even 3D printed.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331747-9acba3f0-3039-485e-96ab-f0cf5619ec3b.png" alt="image"></figure>
<h2>Merge Board</h2>
<p><a href="https://github.com/bbc-mc/sdweb-merge-board">https://github.com/bbc-mc/sdweb-merge-board</a></p>
<p>Multiple lane merge support(up to 10). Save and Load your merging combination as Recipes, which is simple text.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331651-09a0d70e-1906-4f80-8bc1-faf3c0ca8fad.png" alt="image"></figure>
<p>also see:<br>
<a href="https://github.com/Maurdekye/model-kitchen">https://github.com/Maurdekye/model-kitchen</a></p>
<h2>gelbooru-prompt</h2>
<p><a href="https://github.com/antis0007/sd-webui-gelbooru-prompt">https://github.com/antis0007/sd-webui-gelbooru-prompt</a></p>
<p>Fetch tags using your image’s hash.</p>
<h2>booru2prompt</h2>
<p><a href="https://github.com/Malisius/booru2prompt">https://github.com/Malisius/booru2prompt</a></p>
<p>This SD extension allows you to turn posts from various image boorus into stable diffusion prompts. It does so by pulling a list of tags down from their API. You can copy-paste in a link to the post you want yourself, or use the built-in search feature to do it all without leaving SD.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331612-dad61ef7-33dd-4008-9cc7-06b0b0a7cb6d.png" alt="image"></figure>
<p>also see:<br>
<a href="https://github.com/stysmmaker/stable-diffusion-webui-booru-prompt">https://github.com/stysmmaker/stable-diffusion-webui-booru-prompt</a></p>
<h2>WD 1.4 Tagger</h2>
<p><a href="https://github.com/toriato/stable-diffusion-webui-wd14-tagger">https://github.com/toriato/stable-diffusion-webui-wd14-tagger</a></p>
<p>Uses a trained model file, produces WD 1.4 Tags. Model link - <a href="https://mega.nz/file/ptA2jSSB#G4INKHQG2x2pGAVQBn-yd_U5dMgevGF8YYM9CR_R1SY">https://mega.nz/file/ptA2jSSB#G4INKHQG2x2pGAVQBn-yd_U5dMgevGF8YYM9CR_R1SY</a></p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331569-2cf82c5c-f4c3-4181-84bd-2bdced0c2cff.png" alt="image"></figure>
<h2>DreamArtist</h2>
<p><a href="https://github.com/7eu7d7/DreamArtist-sd-webui-extension">https://github.com/7eu7d7/DreamArtist-sd-webui-extension</a></p>
<p>Towards Controllable One-Shot Text-to-Image Generation via Contrastive Prompt-Tuning.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331536-069783ae-32f7-4897-8c1b-94e0ae14f9cd.png" alt="image"></figure>
<h2>Auto TLS-HTTPS</h2>
<p><a href="https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https">https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https</a></p>
<p>Allows you to easily, or even completely automatically start using HTTPS.</p>
<h2>Randomize</h2>
<p><s><a href="https://github.com/stysmmaker/stable-diffusion-webui-randomize">https://github.com/stysmmaker/stable-diffusion-webui-randomize</a></s>
fork: <a href="https://github.com/innightwolfsleep/stable-diffusion-webui-randomize">https://github.com/innightwolfsleep/stable-diffusion-webui-randomize</a></p>
<p>Allows for random parameters during txt2img generation. This script is processed for all generations, regardless of the script selected, meaning this script will function with others as well, such as AUTOMATIC1111/stable-diffusion-webui-wildcards.</p>
<h2>conditioning-highres-fix</h2>
<p><a href="https://github.com/klimaleksus/stable-diffusion-webui-conditioning-highres-fix">https://github.com/klimaleksus/stable-diffusion-webui-conditioning-highres-fix</a></p>
<p>This is Extension for rewriting Inpainting conditioning mask strength value relative to Denoising strength at runtime. This is useful for Inpainting models such as sd-v1-5-inpainting.ckpt</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331374-5a271cf3-cfac-449b-9e09-c63ddc9ca03a.png" alt="image"></figure>
<h2>Detection Detailer</h2>
<p><a href="https://github.com/dustysys/ddetailer">https://github.com/dustysys/ddetailer</a></p>
<p>An object detection and auto-mask extension for Stable Diffusion web UI.</p>
<img src="https://github.com/dustysys/ddetailer/raw/master/misc/ddetailer_example_3.gif"/>
<h2>Sonar</h2>
<p><a href="https://github.com/Kahsolt/stable-diffusion-webui-sonar">https://github.com/Kahsolt/stable-diffusion-webui-sonar</a></p>
<p>Improve the generated image quality, searches for similar (yet even better!) images in the neighborhood of some known image, focuses on single prompt optimization rather than traveling between multiple prompts.</p>
<p><img src="https://user-images.githubusercontent.com/98228077/209545702-c796a3f8-4d8c-4e2b-9b2e-920008ec2f32.png" alt="image"><img src="https://user-images.githubusercontent.com/98228077/209545756-31c94fec-d783-447f-8aac-4a5bba43ea15.png" alt="image"></p>
<h2>prompt travel</h2>
<p><a href="https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel">https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel</a></p>
<p>Extension script for AUTOMATIC1111/stable-diffusion-webui to travel between prompts in latent space.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://github.com/ClashSAN/bloated-gifs/blob/main/prompt_travel.gif" width="512" height="512" />
</details>
<h2>shift-attention</h2>
<p><a href="https://github.com/yownas/shift-attention">https://github.com/yownas/shift-attention</a></p>
<p>Generate a sequence of images shifting attention in the prompt. This script enables you to give a range to the weight of tokens in a prompt and then generate a sequence of images stepping from the first one to the second.</p>
<p><a href="https://user-images.githubusercontent.com/13150150/193368939-c0a57440-1955-417c-898a-ccd102e207a5.mp4">https://user-images.githubusercontent.com/13150150/193368939-c0a57440-1955-417c-898a-ccd102e207a5.mp4</a></p>
<h2>seed travel</h2>
<p><a href="https://github.com/yownas/seed_travel">https://github.com/yownas/seed_travel</a></p>
<p>Small script for AUTOMATIC1111/stable-diffusion-webui to create images that exists between seeds.</p>
<details><summary>Example: (Click to expand:)</summary>
<img src="https://github.com/ClashSAN/bloated-gifs/blob/main/seedtravel.gif" width="512" height="512" />
</details>
<h2>Embeddings editor</h2>
<p><a href="https://github.com/CodeExplode/stable-diffusion-webui-embedding-editor">https://github.com/CodeExplode/stable-diffusion-webui-embedding-editor</a></p>
<p>Allows you to manually edit textual inversion embeddings using sliders.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331138-cdfe8f43-78f7-499e-b746-c42355ee8d6d.png" alt="image"></figure>
<h2>Latent Mirroring</h2>
<p><a href="https://github.com/dfaker/SD-latent-mirroring">https://github.com/dfaker/SD-latent-mirroring</a></p>
<p>Applies mirroring and flips to the latent images to produce anything from subtle balanced compositions to perfect reflections</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331098-3b7fefce-6d38-486d-9543-258f5b2b0fd6.png" alt="image"></figure>
<h2>StylePile</h2>
<p><a href="https://github.com/some9000/StylePile">https://github.com/some9000/StylePile</a></p>
<p>An easy way to mix and match elements to prompts that affect the style of the result.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/208331056-2956d050-a7a4-4b6f-b064-72f6a7d7ee0d.png" alt="image"></figure>
<h2>Push to 🤗 Hugging Face</h2>
<p><a href="https://github.com/camenduru/stable-diffusion-webui-huggingface">https://github.com/camenduru/stable-diffusion-webui-huggingface</a></p>
<figure><img src="https://user-images.githubusercontent.com/54370274/206897701-9e86ce7c-af06-4d95-b9ea-385276c99d3a.jpg" alt="Push Folder to Hugging Face"></figure>
<p>To install it, clone the repo into the <code>extensions</code> directory and restart the web ui:</p>
<p><code>git clone https://github.com/camenduru/stable-diffusion-webui-huggingface</code></p>
<p><code>pip install huggingface-hub</code></p>
<h2>Tokenizer</h2>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer">https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer</a></p>
<p>Adds a tab that lets you preview how CLIP model would tokenize your text.</p>
<figure><img src="https://user-images.githubusercontent.com/20920490/200113798-50b55f5a-45db-4b6f-93c0-ae6be75e5788.png" alt="about"></figure>
<h2>novelai-2-local-prompt</h2>
<p><a href="https://github.com/animerl/novelai-2-local-prompt">https://github.com/animerl/novelai-2-local-prompt</a></p>
<p>Add a button to convert the prompts used in NovelAI for use in the WebUI. In addition, add a button that allows you to recall a previously used prompt.</p>
<figure><img src="https://user-images.githubusercontent.com/113022648/197382468-65f4a96d-48af-4890-8fcf-0ec7c3b9ec3a.png" alt="pic"></figure>
<h2>Booru tag autocompletion</h2>
<p><a href="https://github.com/DominikDoom/a1111-sd-webui-tagcomplete">https://github.com/DominikDoom/a1111-sd-webui-tagcomplete</a></p>
<p>Displays autocompletion hints for tags from “image booru” boards such as Danbooru. Uses local tag CSV files and includes a config for customization.</p>
<figure><img src="https://user-images.githubusercontent.com/20920490/200016417-9451efdb-5d0d-4131-bd9e-39a687be8dd7.png" alt="image"></figure>
<h2>Unprompted</h2>
<p><a href="https://github.com/ThereforeGames/unprompted">https://github.com/ThereforeGames/unprompted</a></p>
<p>Supercharge your prompt workflow with this powerful scripting language!</p>
<figure><img src="https://user-images.githubusercontent.com/95403634/199041569-7c6c5748-e7dc-4068-943f-c2d92745dbb5.png" alt="unprompted_header"></figure>
<p><strong>Unprompted</strong> is a highly modular extension for <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">AUTOMATIC1111’s Stable Diffusion Web UI</a> that allows you to include various shortcodes in your prompts. You can pull text from files, set up your own variables, process text through conditional functions, and so much more - it’s like wildcards on steroids.</p>
<p>While the intended usecase is Stable Diffusion, <strong>this engine is also flexible enough to serve as an all-purpose text generator.</strong></p>
<h2>training-picker</h2>
<p><a href="https://github.com/Maurdekye/training-picker">https://github.com/Maurdekye/training-picker</a></p>
<p>Adds a tab to the webui that allows the user to automatically extract keyframes from video, and manually extract 512x512 crops of those frames for use in model training.</p>
<figure><img src="https://user-images.githubusercontent.com/2313721/199614791-1f573573-a2e2-4358-836d-5655825077e1.png" alt="image"></figure>
<p><strong>Installation</strong></p>
<ul>
<li>Install <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">AUTOMATIC1111’s Stable Diffusion Webui</a></li>
<li>Install <a href="https://ffmpeg.org/">ffmpeg</a> for your operating system</li>
<li>Clone this repository into the extensions folder inside the webui</li>
<li>Drop videos you want to extract cropped frames from into the training-picker/videos folder</li>
</ul>
<h2>auto-sd-paint-ext</h2>
<p><a href="https://github.com/Interpause/auto-sd-paint-ext">https://github.com/Interpause/auto-sd-paint-ext</a></p>
<blockquote>
<p>Extension for AUTOMATIC1111’s webUI with Krita Plugin (other drawing studios soon?)</p>
</blockquote>
<figure><img src="https://user-images.githubusercontent.com/98228077/217986983-d23a334d-50bc-4bb1-ac8b-60f99a3b07b9.png" alt="image"></figure>
<ul>
<li>Optimized workflow (txt2img, img2img, inpaint, upscale) &amp; UI design.</li>
<li>Only drawing studio plugin that exposes the Script API.</li>
</ul>
<p>See <a href="https://github.com/Interpause/auto-sd-paint-ext/issues/41">https://github.com/Interpause/auto-sd-paint-ext/issues/41</a> for planned developments.
See <a href="https://github.com/Interpause/auto-sd-paint-ext/blob/main/CHANGELOG.md">CHANGELOG.md</a> for the full changelog.</p>
<h2>Dataset Tag Editor</h2>
<p><a href="https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor">https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor</a></p>
<p><a href="https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor/blob/main/README-JP.md">日本語 Readme</a></p>
<p>This is an extension to edit captions in training dataset for <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">Stable Diffusion web UI by AUTOMATIC1111</a>.</p>
<p>It works well with text captions in comma-separated style (such as the tags generated by DeepBooru interrogator).</p>
<p>Caption in the filenames of images can be loaded, but edited captions can only be saved in the form of text files.</p>
<figure><img src="https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor/blob/main/ss01.png" alt="picture"></figure>
<h2>Aesthetic Image Scorer</h2>
<p><a href="https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer">https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer</a></p>
<p>Extension for <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">https://github.com/AUTOMATIC1111/stable-diffusion-webui</a></p>
<p>Calculates aesthetic score for generated images using <a href="https://github.com/christophschuhmann/improved-aesthetic-predictor">CLIP+MLP Aesthetic Score Predictor</a> based on <a href="https://github.com/grexzen/SD-Chad/blob/main/chad_scorer.py">Chad Scorer</a></p>
<p>See <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/1831">Discussions</a></p>
<p>Saves score to windows tags with other options planned</p>
<figure><img src="https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer/blob/main/tag_group_by.png" alt="picture"></figure>
<h2>Artists to study</h2>
<p><a href="https://github.com/camenduru/stable-diffusion-webui-artists-to-study">https://github.com/camenduru/stable-diffusion-webui-artists-to-study</a></p>
<p><a href="https://artiststostudy.pages.dev/">https://artiststostudy.pages.dev/</a> adapted to an extension for <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">web ui</a>.</p>
<p>To install it, clone the repo into the <code>extensions</code> directory and restart the web ui:</p>
<p><code>git clone https://github.com/camenduru/stable-diffusion-webui-artists-to-study</code></p>
<p>You can add the artist name to the clipboard by clicking on it. (thanks for the idea @gmaciocci)</p>
<figure><img src="https://user-images.githubusercontent.com/54370274/197829512-e7d30d44-2697-4ecd-b9a7-3665217918c7.jpg" alt="picture"></figure>
<h2>Deforum</h2>
<p><a href="https://github.com/deforum-art/deforum-for-automatic1111-webui">https://github.com/deforum-art/deforum-for-automatic1111-webui</a></p>
<p>The official port of Deforum, an extensive script for 2D and 3D animations, supporting keyframable sequences, dynamic math parameters (even inside the prompts), dynamic masking, depth estimation and warping.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/217986819-67fd1e3c-b007-475c-b8c9-3bf28ee3aa67.png" alt="image"></figure>
<h2>Inspiration</h2>
<p><a href="https://github.com/yfszzx/stable-diffusion-webui-inspiration">https://github.com/yfszzx/stable-diffusion-webui-inspiration</a></p>
<p>Randomly display the pictures of the artist’s or artistic genres typical style, more pictures of this artist or genre is displayed after selecting. So you don’t have to worry about how hard it is to choose the right style of art when you create.</p>
<figure><img src="https://user-images.githubusercontent.com/20920490/197518700-3f753132-8799-4ad0-8cdf-bcdcbf7798aa.png" alt="68747470733a2f2f73362e6a70672e636d2f323032322f31302f32322f504a596f4e4c2e706e67"></figure>
<h2>Image Browser</h2>
<p><a href="https://github.com/AlUlkesh/stable-diffusion-webui-images-browser">https://github.com/AlUlkesh/stable-diffusion-webui-images-browser</a></p>
<p>Provides an interface to browse created images in the web browser, allows for sorting and filtering by EXIF data.</p>
<figure><img src="https://user-images.githubusercontent.com/23466035/217083703-0845da05-3305-4f5a-af53-f3829de6a29d.png" alt="image"></figure>
<h2>Smart Process</h2>
<p><a href="https://github.com/d8ahazard/sd_smartprocess">https://github.com/d8ahazard/sd_smartprocess</a></p>
<p>Intelligent cropping, captioning, and image enhancement.</p>
<figure><img src="https://user-images.githubusercontent.com/1633844/201435094-433d765c-56e8-4573-82d9-71af2b112159.png" alt="image"></figure>
<h2>Dreambooth</h2>
<p><a href="https://github.com/d8ahazard/sd_dreambooth_extension">https://github.com/d8ahazard/sd_dreambooth_extension</a></p>
<p>Dreambooth in the UI. Refer to the project readme for tuning and configuration requirements. Includes <a href="https://github.com/cloneofsimo/lora">LoRA</a> (Low Rank Adaptation)</p>
<p>Based on ShivamShiaro’s repo.</p>
<figure><img src="https://user-images.githubusercontent.com/1633844/201434706-2c2744ba-082e-427e-9f8d-af03de204583.png" alt="image"></figure>
<h2>Dynamic Prompts</h2>
<p><a href="https://github.com/adieyal/sd-dynamic-prompts">https://github.com/adieyal/sd-dynamic-prompts</a></p>
<p>A custom extension for <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">AUTOMATIC1111/stable-diffusion-webui</a> that implements an expressive template language for random or combinatorial prompt generation along with features to support deep wildcard directory structures.</p>
<p>More features and additions are shown in the <a href="https://github.com/adieyal/sd-dynamic-prompts">readme</a>.</p>
<figure><img src="https://github.com/adieyal/sd-dynamic-prompts/raw/main/images/extension.png" alt="image"></figure>
<p>Using this extension, the prompt:</p>
<p><code>A {house|apartment|lodge|cottage} in {summer|winter|autumn|spring} by {2$$artist1|artist2|artist3}</code></p>
<p>Will any of the following prompts:</p>
<ul>
<li>A house in summer by artist1, artist2</li>
<li>A lodge in autumn by artist3, artist1</li>
<li>A cottage in winter by artist2, artist3</li>
<li></li>
</ul>
<p>This is especially useful if you are searching for interesting combinations of artists and styles.</p>
<p>You can also pick a random string from a file. Assuming you have the file seasons.txt in WILDCARD_DIR (see below), then:</p>
<p><code>__seasons__ is coming</code></p>
<p>Might generate the following:</p>
<ul>
<li>Winter is coming</li>
<li>Spring is coming</li>
<li></li>
</ul>
<p>You can also use the same wildcard twice</p>
<p><code>I love __seasons__ better than __seasons__</code></p>
<ul>
<li>I love Winter better than Summer</li>
<li>I love Spring better than Spring</li>
</ul>
<h2>Wildcards</h2>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards">https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards</a></p>
<p>Allows you to use <code>__name__</code> syntax in your prompt to get a random line from a file named <code>name.txt</code> in the wildcards directory.</p>
<h2>Aesthetic Gradients</h2>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients">https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients</a></p>
<p>Create an embedding from one or few pictures and use it to apply their style to generated images.</p>
<figure><img src="https://user-images.githubusercontent.com/20920490/197466300-6b042bcf-5cba-4600-97d7-ad2652875706.png" alt="firefox_FgKg9dx9eF"></figure>
<h2>3D Model&amp;Pose Loader</h2>
<p><a href="https://github.com/jtydhr88/sd-3dmodel-loader">https://github.com/jtydhr88/sd-3dmodel-loader</a></p>
<p>A custom extension that allows you to load your local 3D model/animation inside webui, or edit pose as well, then send screenshot to txt2img or img2img as your ControlNet’s reference image.</p>
<figure><img src="https://user-images.githubusercontent.com/860985/236643711-140579dc-bb74-4a84-ba40-3a64823285ab.png" alt="1"></figure>
<h2>Canvas Editor</h2>
<p><a href="https://github.com/jtydhr88/sd-canvas-editor">https://github.com/jtydhr88/sd-canvas-editor</a></p>
<p>A custom extension for sd-webui that integrated a full capability canvas editor which you can use layer, text, image, elements, etc.</p>
<figure><img src="https://user-images.githubusercontent.com/860985/236643824-946ebdef-83af-4e85-80ea-6ac7d2fb520e.png" alt="overall"></figure>
<h2>One Button Prompt</h2>
<p><a href="https://github.com/AIrjen/OneButtonPrompt">https://github.com/AIrjen/OneButtonPrompt</a></p>
<p>One Button Prompt is a tool/script for automatic1111 for beginners who have problems writing a good prompt, or advanced users who want to get inspired.</p>
<p>It generates an entire prompt from scratch. It is random, but controlled. You simply load up the script and press generate, and let it surprise you.
<img src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/40751091/9491d781-c0ad-4f22-93c4-b361635fc265" alt="One Button Prompt"></p>
<h2>Model Downloader</h2>
<p><a href="https://github.com/Iyashinouta/sd-model-downloader">https://github.com/Iyashinouta/sd-model-downloader</a></p>
<p>SD-Webui extension to Download Model from CivitAI and HuggingFace, Recomended for Cloud Users (a.k.a Google Colab, etc.)
<img src="https://github.com/Iyashinouta/sd-model-downloader/raw/84cfcb9d7b79ff031db9fcb9b2b4805c9293611b/images/instructions.png" alt="Model Downloader"></p>
<h2>SD Telegram</h2>
<p><a href="https://github.com/amputator84/sd_telegram">https://github.com/amputator84/sd_telegram</a></p>
<p>Telegram bot on aiogram to generate images in automatic1111 locally (127.0.0.1:7860 nowebui)</p>
<p>if you want to manage it via telegram bot, install it via extensions.
Further instructions are on github.
The bot uses <a href="https://github.com/akirayimi/sdwebuiapi/">sdwebuiapi</a> and works with a local address.</p>
<p>Able to generate previews, full-size pictures, also send documents and groups.
Able to “compose” prompts, take them from <a href="https://lexica.art/">lexica</a>, there is a stream generation script for all models.
<img src="https://raw.githubusercontent.com/partyfind/sd_bot/master/trash/photo_2023-06-22_15-29-24.jpg" alt="sd_telegram"></p>
<h2>QR Code Generator</h2>
<p><a href="https://github.com/missionfloyd/webui-qrcode-generator">https://github.com/missionfloyd/webui-qrcode-generator</a></p>
<p>Instantly generate QR Codes for ControlNet.
<img src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/4073789/0ef6ff8a-276f-4386-9f24-021923c7dca0" alt="QR Code Generator"></p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# General Info
Extensions are a more convenient form of user scripts.
Extensions all exist in their own folder inside the extensions folder of webui. You can use git to install an extension like this:
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients extensions/aesthetic-gradients
This installs an extension from https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients into the extensions/aesthetic-gradients directory.
Alternatively you can just copy-paste a directory into extensions.
For developing extensions, see [Developing extensions](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions).
# Security
As extensions allow the user to install and run arbitrary code, this can be used maliciously, and is disabled by default when running with options that allow remote users to connect to the server (`--share` or `--listen`) - you'll still have the UI, but trying to install anything will result in error. If you want to use those options and still be able to install extensions, use `--enable-insecure-extension-access` command line flag.
# Extensions
## MultiDiffusion with Tiled VAE
https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111
### MultiDiffusion
- txt2img panorama generation, as mentioned in MultiDiffusion.
- It can cooperate with ControlNet to produce wide images with control.
Panorama Example:(links not working as of Jun 2023)
Before: [click for the raw image](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/blob/docs/imgs/ancient_city_origin.jpeg)
After: [click for the raw image](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/blob/docs/imgs/ancient_city.jpeg)
ControlNet Canny Output: https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111/raw/docs/imgs/yourname.jpeg?raw=true
### Tiled Vae
The `vae_optimize.py` script splits the image into tiles, encodes each tile separately, and merges the results. This process allows the VAE to generate large images with limited VRAM (~10 GB for 8K images).
Using this script may allow removal of --lowvram or --medvram arguments, and thus improve image generation times.
## VRAM Estimator
https://github.com/space-nuko/a1111-stable-diffusion-webui-vram-estimator
Runs txt2img, img2img, highres-fix at increasing dimensions and batch sizes until OOM, and outputs data to graph.
![image](https://user-images.githubusercontent.com/98228077/223624383-545aeb31-c001-4ba6-bdb8-23e688130b8f.png)
## Dump U-Net
https://github.com/hnmr293/stable-diffusion-webui-dumpunet
View different layers, observe U-Net feature maps. Allows Image generation by giving different prompts for each block of the unet: https://note.com/kohya_ss/n/n93b7c01b0547
![image](https://user-images.githubusercontent.com/98228077/223624012-2df926d5-d4c4-44bc-a04f-bed15d43b88f.png)
## posex
https://github.com/hnmr293/posex
Estimated Image Generator for Pose2Image. This extension allows moving the openpose figure in 3d space.
![image](https://user-images.githubusercontent.com/98228077/223622234-26907947-a723-4671-ae42-60a0011bfda2.png)
## LLuL
https://github.com/hnmr293/sd-webui-llul
Local Latent Upscaler. Target an area to selectively enhance details.
https://user-images.githubusercontent.com/120772120/221390831-9fbccdf8-5898-4515-b988-d6733e8af3f1.mp4
## CFG-Schedule-for-Automatic1111-SD
https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD
These 2 scripts allow for dynamic CFG control during generation steps. With the right settings, this could help get the details of high CFG without damaging the generated image even with low denoising in img2img.
See their [wiki](https://github.com/guzuligo/CFG-Schedule-for-Automatic1111-SD/wiki/CFG-Auto-script) on how to use.
## a1111-sd-webui-locon
https://github.com/KohakuBlueleaf/a1111-sd-webui-locon
An extension for loading LoCon networks in webui.
## ebsynth_utility
https://github.com/s9roll7/ebsynth_utility
Extension for creating videos using img2img and ebsynth. Output edited videos using ebsynth. Works with ControlNet extension.
![image](https://user-images.githubusercontent.com/98228077/223622872-0575abe9-9a53-4614-b9a5-1333f0b34733.png)
## LoRA Block Weight
LoRA is a powerful tool, but it is sometimes difficult to use and can affect areas that you do not want it to affect. This script allows you to set the weights block-by-block. Using this script, you may be able to get the image you want.
Used in conjunction with the XY plot, it is possible to examine the impact of each level of the hierarchy.
![image](https://user-images.githubusercontent.com/98228077/223573538-d8fdb00d-6c49-47ec-af63-cea691f515d4.png)
Included Presets:
```
NOT:0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
ALL:1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
INS:1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0
IND:1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0
INALL:1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0
MIDD:1,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0
OUTD:1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0
OUTS:1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1
OUTALL:1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1
```
## Kitchen Theme
https://github.com/canisminor1990/sd-web-ui-kitchen-theme
A custom theme for webui.
![image](https://user-images.githubusercontent.com/98228077/223572989-e51eb877-74f4-41ec-8204-233221f2e981.png)
## Bilingual Localization
https://github.com/journey-ad/sd-webui-bilingual-localization
Bilingual translation, no need to worry about how to find the original button. Compatible with language pack extensions, no need to re-import.
![image](https://user-images.githubusercontent.com/98228077/223564624-61594e71-d1dd-4f32-9293-9697b07a7735.png)
## Composable LoRA
https://github.com/opparco/stable-diffusion-webui-composable-lora
Enables using AND keyword(composable diffusion) to limit LoRAs to subprompts. Useful when paired with Latent Couple extension.
## Clip Interrogator
https://github.com/pharmapsychotic/clip-interrogator-ext
Clip Interrogator by pharmapsychotic ported to an extension. Features a variety of clip models and interrogate settings.
![image](https://user-images.githubusercontent.com/98228077/223572478-093030bf-e25e-42c0-b621-597515deaf69.png)
## Latent-Couple
https://github.com/opparco/stable-diffusion-webui-two-shot
An extension of the built-in Composable Diffusion, allows you to determine the region of the latent space that reflects your subprompts.
![image](https://user-images.githubusercontent.com/98228077/223571685-95a300f9-b768-4bca-96d4-684aadae9863.png)
## OpenPose Editor
https://github.com/fkunn1326/openpose-editor
This can add multiple pose characters, detect pose from image, save to PNG, and send to controlnet extension.
![image](https://user-images.githubusercontent.com/98228077/223571127-6c107bd8-7ca4-4774-bdb8-41930863fdcc.png)
## SuperMerger
https://github.com/hako-mikan/sd-webui-supermerger
Merge and run without saving to drive. Sequential XY merge generations; extract and merge LoRA's, bind LoRA's to ckpt, merge block weights, and more.
![image](https://user-images.githubusercontent.com/98228077/223570729-d25ca5c4-a434-42fd-b85d-7e16a7af1fc8.png)
## Prompt Translator
https://github.com/butaixianran/Stable-Diffusion-Webui-Prompt-Translator
A integrated translator for translating prompts to English using Deepl or Baidu.
![image](https://user-images.githubusercontent.com/98228077/223565541-43f618ea-e009-41b5-880c-7360a9ebec5f.png)
## Video Loopback
https://github.com/fishslot/video_loopback_for_webui
https://user-images.githubusercontent.com/122792358/218375476-a4116c74-5a9a-41e2-970a-c3cc09f796ae.mp4
## Mine Diffusion
https://github.com/fropych/mine-diffusion
This extension converts images into blocks and creates schematics for easy importing into Minecraft using the Litematica mod.
<details><summary>Example: (Click to expand:)</summary>
![](https://github.com/fropych/mine-diffusion/blob/master/README_images/demo.gif)
</details>
## anti-burn
https://github.com/klimaleksus/stable-diffusion-webui-anti-burn
Smoothing generated images by skipping a few very last steps and averaging together some images before them.
![image](https://user-images.githubusercontent.com/98228077/223562829-1abe8eed-dca5-4891-88e2-6714966e02bc.png)
## Embedding Merge
https://github.com/klimaleksus/stable-diffusion-webui-embedding-merge
Merging Textual Inversion embeddings at runtime from string literals.
![image](https://user-images.githubusercontent.com/98228077/223562706-af7cc1e6-7b6c-4069-a89f-8087a2dba4da.png)
## gif2gif
The purpose of this script is to accept an animated gif as input, process frames as img2img typically would, and recombine them back into an animated gif. Intended to provide a fun, fast, gif-to-gif workflow that supports new models and methods such as Controlnet and InstructPix2Pix. Drop in a gif and go. Referenced code from prompts_from_file.
<details><summary>Example: (Click to expand:)</summary>
![](https://user-images.githubusercontent.com/93007558/216803715-81dfc9e6-8c9a-47d5-9879-27acfac34eb8.gif)
</details>
## cafe-aesthetic
https://github.com/p1atdev/stable-diffusion-webui-cafe-aesthetic
Pre-trained model, determines if aesthetic/non-aesthetic, does 5 different style recognition modes, and Waifu confirmation. Also has a tab with Batch processing.
![image](https://user-images.githubusercontent.com/98228077/223562229-cba2db0a-3368-4f13-9456-ebe2053c01a3.png)
## Catppuccin themes
https://github.com/catppuccin/stable-diffusion-webui
Catppuccin is a community-driven pastel theme that aims to be the middle ground between low and high contrast themes. Adds set of themes which are in compliance with catppucin guidebook.
![image](https://user-images.githubusercontent.com/98228077/223562461-13ec3132-4734-4787-a161-b2c408646835.png)
## Dynamic Thresholding
Dynamic Thresholding adds customizable dynamic thresholding to allow high CFG Scale values without the burning / 'pop art' effect.
## Custom Diffusion
https://github.com/guaneec/custom-diffusion-webui
Custom Diffusion is a form of fine-tuning with TI, instead of tuning the whole model. Similar speed and memory requirements to TI and may give better results in fewer steps.
## Fusion
https://github.com/ljleb/prompt-fusion-extension
Adds prompt-travel and shift-attention-like interpolations (see exts), but during/within the sampling steps. Always-on + works with existing prompt-editing syntax. Various interpolation modes. See their wiki for more info.
<details><summary>Example: (Click to expand:)</summary>
![](https://user-images.githubusercontent.com/32277961/214725976-b72bafc6-0c5d-4491-9c95-b73da41da082.gif)
</details>
## Pixelization
https://github.com/AUTOMATIC1111/stable-diffusion-webui-pixelization
Using pre-trained models, produce pixel art out of images in the extras tab.
![image](https://user-images.githubusercontent.com/98228077/223563687-cb0eb3fe-0fce-4822-8170-20b719f394fa.png)
## Instruct-pix2pix
https://github.com/Klace/stable-diffusion-webui-instruct-pix2pix
Adds a tab for doing img2img editing with the instruct-pix2pix model. The author added the feature to webui, so this doesn't need to be used.
## System Info
https://github.com/vladmandic/sd-extension-system-info
Creates a top-level **System Info** tab in Automatic WebUI with
*Note*:
- State & memory info are auto-updated every second if tab is visible
(no updates are performed when tab is not visible)
- All other information is updated once upon WebUI load and
can be force refreshed if required
![screenshot](https://raw.githubusercontent.com/vladmandic/sd-extension-system-info/main/system-info.jpg)
## Steps Animation
https://github.com/vladmandic/sd-extension-steps-animation
Extension to create animation sequence from denoised intermediate steps
Registers a script in **txt2img** and **img2img** tabs
Creating animation has minimum impact on overall performance as it does not require separate runs
except adding overhead of saving each intermediate step as image plus few seconds to actually create movie file
Supports **color** and **motion** interpolation to achieve animation of desired duration from any number of interim steps
Resulting movie fiels are typically very small (*~1MB being average*) due to optimized codec settings
![screenshot](https://raw.githubusercontent.com/vladmandic/sd-extension-steps-animation/main/steps-animation.jpg)
### [Example](https://user-images.githubusercontent.com/57876960/212490617-f0444799-50e5-485e-bc5d-9c24a9146d38.mp4)
## Aesthetic Scorer
https://github.com/vladmandic/sd-extension-aesthetic-scorer
Uses existing CLiP model with an additional small pretrained to calculate perceived aesthetic score of an image
Enable or disable via `Settings` -> `Aesthetic scorer`
This is an *"invisible"* extension, it runs in the background before any image save and
appends **`score`** as *PNG info section* and/or *EXIF comments* field
### Notes
- Configuration via **Settings** &rarr; **Aesthetic scorer**
![screenshot](https://raw.githubusercontent.com/vladmandic/sd-extension-aesthetic-scorer/main/aesthetic-scorer.jpg)
- Extension obeys existing **Move VAE and CLiP to RAM** settings
- Models will be auto-downloaded upon first usage (small)
- Score values are `0..10`
- Supports both `CLiP-ViT-L/14` and `CLiP-ViT-B/16`
- Cross-platform!
## Discord Rich Presence
https://github.com/kabachuha/discord-rpc-for-automatic1111-webui
Provides connection to Discord RPC, showing a fancy table in the user profile.
## Promptgen
https://github.com/AUTOMATIC1111/stable-diffusion-webui-promptgen
Use transformers models to generate prompts.
![image](https://user-images.githubusercontent.com/98228077/223561862-27815193-acfd-47cb-ae67-fcc435b2c875.png)
## haku-img
https://github.com/KohakuBlueleaf/a1111-sd-webui-haku-img
Image utils extension. Allows blending, layering, hue and color adjustments, blurring and sketch effects, and basic pixelization.
![image](https://user-images.githubusercontent.com/98228077/223561769-294ee4fa-f857-4dc9-afbf-dfe953e8c6ad.png)
## Merge Block Weighted
https://github.com/bbc-mc/sdweb-merge-block-weighted-gui
Merge models with separate rate for each 25 U-Net block (input, middle, output).
![image](https://user-images.githubusercontent.com/98228077/223561099-c9cb6fab-c3c6-42fb-92fd-6811474d073c.png)
## Stable Horde Worker
https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker
An unofficial [Stable Horde](https://stablehorde.net/) worker bridge as a [Stable Diffusion WebUI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) extension.
### Features
**This extension is still WORKING IN PROGRESS**, and is not ready for production use.
- Get jobs from Stable Horde, generate images and submit generations
- Configurable interval between every jobs
- Enable and disable extension whenever
- Detect current model and fetch corresponding jobs on the fly
- Show generation images in the Stable Diffusion WebUI
- Save generation images with png info text to local
### Install
- Run the following command in the root directory of your Stable Diffusion WebUI installation:
```bash
git clone https://github.com/sdwebui-w-horde/sd-webui-stable-horde-worker.git extensions/stable-horde-worker
```
- Launch the Stable Diffusion WebUI, You would see the `Stable Horde Worker` tab page.
![settings](./screenshots/settings.png)
- Register an account on [Stable Horde](https://stablehorde.net/) and get your `API key` if you don't have one.
**Note**: the default anonymous key `00000000` is not working for a worker, you need to register an account and get your own key.
- Setup your `API key` here.
- Setup `Worker name` here with a proper name.
- Make sure `Enable` is checked.
- Click the `Apply settings` buttons.
## Stable Horde
### Stable Horde Client
https://github.com/natanjunges/stable-diffusion-webui-stable-horde
Generate pictures using other user's PC. You should be able to receive images from the stable horde with anonymous `0000000000` api key, however it is recommended to get your own - https://stablehorde.net/register
Note: Retrieving Images may take 2 minutes or more, especially if you have no kudos.
## Multiple hypernetworks
https://github.com/antis0007/sd-webui-multiple-hypernetworks
Extension that allows the use of multiple hypernetworks at once
![image](https://user-images.githubusercontent.com/32306715/212293588-a8b4d1e9-4099-4a2e-a61a-f549a70f6096.png)
## Hypernetwork-Monkeypatch-Extension
https://github.com/aria1th/Hypernetwork-MonkeyPatch-Extension
Extension that provides additional training features for hypernetwork training, and supports multiple hypernetworks.
![image](https://user-images.githubusercontent.com/35677394/212069329-7f3d427f-efad-4424-8dca-4bec010ea429.png)
## Ultimate SD Upscaler
https://github.com/Coyote-A/ultimate-upscale-for-automatic1111
![image](https://user-images.githubusercontent.com/98228077/223559884-5498d495-c5f3-4068-8711-f9f31fb2d435.png)
More advanced options for SD Upscale, less artifacts than original using higher denoise ratio (0.3-0.5).
## Model Converter
https://github.com/Akegarasu/sd-webui-model-converter
Model convert extension, supports convert fp16/bf16 no-ema/ema-only safetensors.
## Kohya-ss Additional Networks
https://github.com/kohya-ss/sd-webui-additional-networks
Allows the Web UI to use networks (LoRA) trained by their scripts to generate images. Edit safetensors prompt and additional metadata, and use 2.X LoRAs.
![image](https://user-images.githubusercontent.com/98228077/223559083-9a5dc069-f73e-48d2-a22c-4db7b983ea40.png)
## Add image number to grid
https://github.com/AlUlkesh/sd_grid_add_image_number
Add the image's number to its picture in the grid.
## quick-css
https://github.com/Gerschel/sd-web-ui-quickcss
Extension for quickly selecting and applying custom.css files, for customizing look and placement of elements in ui.
![image](https://user-images.githubusercontent.com/98228077/210076676-5f6a8e72-5352-4860-8f3d-468ab8e31355.png)![image](https://user-images.githubusercontent.com/98228077/210076407-1c904a6c-6913-4954-8f20-36100df99fba.png)
## Prompt Generator
https://github.com/imrayya/stable-diffusion-webui-Prompt_Generator
Adds a tab to the webui that allows the user to generate a prompt from a small base prompt. Based on [FredZhang7/distilgpt2-stable-diffusion-v2](https://huggingface.co/FredZhang7/distilgpt2-stable-diffusion-v2).
![image](https://user-images.githubusercontent.com/98228077/210076951-36f5d90c-b8c4-4b12-b909-582193deeec1.png)
## model-keyword
https://github.com/mix1009/model-keyword
Inserts matching keyword(s) to the prompt automatically. Update extension to get the latest model+keyword mappings.
![image](https://user-images.githubusercontent.com/98228077/209717531-e0ae74ab-b753-4ad1-99b2-e1eda3de5433.png)
## sd-model-preview
https://github.com/Vetchems/sd-model-preview
Allows you to create a txt file and jpg/png's with the same name as your model and have this info easily displayed for later reference in webui.
![image](https://user-images.githubusercontent.com/98228077/209715309-3c523945-5345-4e3d-b1a3-14f923e1bb40.png)
## Enhanced-img2img
https://github.com/OedoSoldier/enhanced-img2img
An extension with support for batched and better inpainting. See [readme](https://github.com/OedoSoldier/enhanced-img2img#usage) for more details.
![image](https://user-images.githubusercontent.com/98228077/217990537-e8bdbc74-7210-4864-8140-a076a342c695.png)
## openOutpaint extension
https://github.com/zero01101/openOutpaint-webUI-extension
A tab with the full openOutpaint UI. Run with the --api flag.
![image](https://user-images.githubusercontent.com/98228077/209453250-8bd2d766-56b5-4887-97bc-cb0e22f98dde.png)
## Save Intermediate Images
https://github.com/AlUlkesh/sd_save_intermediate_images
Implements saving intermediate images, with more advanced features.
![noisy](https://user-images.githubusercontent.com/98228077/211706803-f747691d-cca8-4692-90ef-f6a2859ed5cb.jpg)
![not](https://user-images.githubusercontent.com/98228077/211706801-fc593dbf-67c4-4983-8a80-c88355ffeba2.jpg)
![image](https://user-images.githubusercontent.com/98228077/217990312-15b4eda2-858a-44b7-91a3-b34af7c487b6.png)
## Riffusion
https://github.com/enlyth/sd-webui-riffusion
Use Riffusion model to produce music in gradio. To replicate [original](https://www.riffusion.com/about) interpolation technique, input the [prompt travel extension](https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel) output frames into the riffusion tab.
![image](https://user-images.githubusercontent.com/98228077/209539460-f5c23891-b5e6-46c7-b1a5-b7440a3f031b.png)![image](https://user-images.githubusercontent.com/98228077/209539472-031e623e-f7a2-4da9-9711-8bf73d0cfe6e.png)
## DH Patch
https://github.com/d8ahazard/sd_auto_fix
Random patches by D8ahazard. Auto-load config YAML files for v2, 2.1 models; patch latent-diffusion to fix attention on 2.1 models (black boxes without no-half), whatever else I come up with.
## Preset Utilities
https://github.com/Gerschel/sd_web_ui_preset_utils
Preset tool for UI. Supports presets for some custom scripts.
![image](https://user-images.githubusercontent.com/98228077/209540881-2a870282-edb6-4c94-869b-5493cdced01f.png)
## Config-Presets
https://github.com/Zyin055/Config-Presets
Adds a configurable dropdown to allow you to change UI preset settings in the txt2img and img2img tabs.
![image](https://user-images.githubusercontent.com/98228077/208332322-24339554-0274-4add-88a7-d33bba1e3823.png)
## Diffusion Defender
https://github.com/WildBanjos/DiffusionDefender
Prompt blacklist, find and replace, for semi-private and public instances.
## NSFW checker
https://github.com/AUTOMATIC1111/stable-diffusion-webui-nsfw-censor
Replaces NSFW images with black.
## Infinity Grid Generator
https://github.com/mcmonkeyprojects/sd-infinity-grid-generator-script
Build a yaml file with your chosen parameters, and generate infinite-dimensional grids. Built-in ability to add description text to fields. See readme for usage details.
![image](https://user-images.githubusercontent.com/98228077/208332269-88983668-ea7e-45a8-a6d5-cd7a9cb64b3a.png)
## embedding-inspector
https://github.com/tkalayci71/embedding-inspector
Inspect any token(a word) or Textual-Inversion embeddings and find out which embeddings are similar. You can mix, modify, or create the embeddings in seconds. Much more intriguing options have since been released, see [here.](https://github.com/tkalayci71/embedding-inspector#whats-new)
![image](https://user-images.githubusercontent.com/98228077/209546038-3f4206bf-2c43-4d58-bf83-6318ade393f4.png)
## Prompt Gallery
https://github.com/dr413677671/PromptGallery-stable-diffusion-webui
Build a yaml file filled with prompts of your character, hit generate, and quickly preview them by their word attributes and modifiers.
![image](https://user-images.githubusercontent.com/98228077/208332199-7652146c-2428-4f44-9011-66e81bc87426.png)
## DAAM
https://github.com/toriato/stable-diffusion-webui-daam
DAAM stands for Diffusion Attentive Attribution Maps. Enter the attention text (must be a string contained in the prompt) and run. An overlapping image with a heatmap for each attention will be generated along with the original image.
![image](https://user-images.githubusercontent.com/98228077/208332173-ffb92131-bd02-4a07-9531-136822d06c86.png)
## Visualize Cross-Attention
https://github.com/benkyoujouzu/stable-diffusion-webui-visualize-cross-attention-extension
![image](https://user-images.githubusercontent.com/98228077/208332131-6acdae9a-2b25-4e71-8ab0-6e375c7c0419.png)
Generates highlighted sectors of a submitted input image, based on input prompts. Use with tokenizer extension. See the readme for more info.
## ABG_extension
https://github.com/KutsuyaYuki/ABG_extension
Automatically remove backgrounds. Uses an onnx model fine-tuned for anime images. Runs on GPU.
| ![test](https://user-images.githubusercontent.com/98228077/209423352-e8ea64e7-8522-4c2c-9350-c7cd50c35c7c.png) | ![00035-4190733039-cow](https://user-images.githubusercontent.com/98228077/209423400-720ddde9-258a-4e68-8a93-73b67dad714e.png) | ![00021-1317075604-samdoesarts portrait](https://user-images.githubusercontent.com/98228077/209423428-da7c68db-e7d1-45a1-b931-817de9233a67.png) | ![00025-2023077221-](https://user-images.githubusercontent.com/98228077/209423446-79e676ae-460e-4282-a591-b8b986bfd869.png) |
| :---: | :---: | :---: | :---: |
| ![img_-0002-3313071906-bust shot of person](https://user-images.githubusercontent.com/98228077/209423467-789c17ad-d7ed-41a9-a039-802cfcae324a.png) | ![img_-0022-4190733039-cow](https://user-images.githubusercontent.com/98228077/209423493-dcee7860-a09e-41e0-9397-715f52bdcaab.png) | ![img_-0008-1317075604-samdoesarts portrait](https://user-images.githubusercontent.com/98228077/209423521-736f33ca-aafb-4f8b-b067-14916ec6955f.png) | ![img_-0012-2023077221-](https://user-images.githubusercontent.com/98228077/209423546-31b2305a-3159-443f-8a98-4da22c29c415.png) |
## depthmap2mask
https://github.com/Extraltodeus/depthmap2mask
Create masks for img2img based on a depth estimation made by MiDaS.
![image](https://user-images.githubusercontent.com/15731540/204050868-eca8db02-2193-4115-a5b8-e8f5c796e035.png)![image](https://user-images.githubusercontent.com/15731540/204050888-41b00335-50b4-4328-8cfd-8fc5e9cec78b.png)![image](https://user-images.githubusercontent.com/15731540/204050899-8757b774-f2da-4c15-bfa7-90d8270e8287.png)
## multi-subject-render
https://github.com/Extraltodeus/multi-subject-render
It is a depth aware extension that can help to create multiple complex subjects on a single image. It generates a background, then multiple foreground subjects, cuts their backgrounds after a depth analysis, paste them onto the background and finally does an img2img for a clean finish.
![image](https://user-images.githubusercontent.com/98228077/208331952-019dfd64-182d-4695-bdb0-4367c81e4c43.png)
## Depth Maps
https://github.com/thygate/stable-diffusion-webui-depthmap-script
Creates depthmaps from the generated images. The result can be viewed on 3D or holographic devices like VR headsets or lookingglass display, used in Render or Game- Engines on a plane with a displacement modifier, and maybe even 3D printed.
![image](https://user-images.githubusercontent.com/98228077/208331747-9acba3f0-3039-485e-96ab-f0cf5619ec3b.png)
## Merge Board
https://github.com/bbc-mc/sdweb-merge-board
Multiple lane merge support(up to 10). Save and Load your merging combination as Recipes, which is simple text.
![image](https://user-images.githubusercontent.com/98228077/208331651-09a0d70e-1906-4f80-8bc1-faf3c0ca8fad.png)
also see:\
https://github.com/Maurdekye/model-kitchen
## gelbooru-prompt
https://github.com/antis0007/sd-webui-gelbooru-prompt
Fetch tags using your image's hash.
## booru2prompt
https://github.com/Malisius/booru2prompt
This SD extension allows you to turn posts from various image boorus into stable diffusion prompts. It does so by pulling a list of tags down from their API. You can copy-paste in a link to the post you want yourself, or use the built-in search feature to do it all without leaving SD.
![image](https://user-images.githubusercontent.com/98228077/208331612-dad61ef7-33dd-4008-9cc7-06b0b0a7cb6d.png)
also see:\
https://github.com/stysmmaker/stable-diffusion-webui-booru-prompt
## WD 1.4 Tagger
https://github.com/toriato/stable-diffusion-webui-wd14-tagger
Uses a trained model file, produces WD 1.4 Tags. Model link - https://mega.nz/file/ptA2jSSB#G4INKHQG2x2pGAVQBn-yd_U5dMgevGF8YYM9CR_R1SY
![image](https://user-images.githubusercontent.com/98228077/208331569-2cf82c5c-f4c3-4181-84bd-2bdced0c2cff.png)
## DreamArtist
https://github.com/7eu7d7/DreamArtist-sd-webui-extension
Towards Controllable One-Shot Text-to-Image Generation via Contrastive Prompt-Tuning.
![image](https://user-images.githubusercontent.com/98228077/208331536-069783ae-32f7-4897-8c1b-94e0ae14f9cd.png)
## Auto TLS-HTTPS
https://github.com/papuSpartan/stable-diffusion-webui-auto-tls-https
Allows you to easily, or even completely automatically start using HTTPS.
## Randomize
~~https://github.com/stysmmaker/stable-diffusion-webui-randomize~~
fork: https://github.com/innightwolfsleep/stable-diffusion-webui-randomize
Allows for random parameters during txt2img generation. This script is processed for all generations, regardless of the script selected, meaning this script will function with others as well, such as AUTOMATIC1111/stable-diffusion-webui-wildcards.
## conditioning-highres-fix
https://github.com/klimaleksus/stable-diffusion-webui-conditioning-highres-fix
This is Extension for rewriting Inpainting conditioning mask strength value relative to Denoising strength at runtime. This is useful for Inpainting models such as sd-v1-5-inpainting.ckpt
![image](https://user-images.githubusercontent.com/98228077/208331374-5a271cf3-cfac-449b-9e09-c63ddc9ca03a.png)
## Detection Detailer
https://github.com/dustysys/ddetailer
An object detection and auto-mask extension for Stable Diffusion web UI.
<img src="https://github.com/dustysys/ddetailer/raw/master/misc/ddetailer_example_3.gif"/>
## Sonar
https://github.com/Kahsolt/stable-diffusion-webui-sonar
Improve the generated image quality, searches for similar (yet even better!) images in the neighborhood of some known image, focuses on single prompt optimization rather than traveling between multiple prompts.
![image](https://user-images.githubusercontent.com/98228077/209545702-c796a3f8-4d8c-4e2b-9b2e-920008ec2f32.png)![image](https://user-images.githubusercontent.com/98228077/209545756-31c94fec-d783-447f-8aac-4a5bba43ea15.png)
## prompt travel
https://github.com/Kahsolt/stable-diffusion-webui-prompt-travel
Extension script for AUTOMATIC1111/stable-diffusion-webui to travel between prompts in latent space.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://github.com/ClashSAN/bloated-gifs/blob/main/prompt_travel.gif" width="512" height="512" />
</details>
## shift-attention
https://github.com/yownas/shift-attention
Generate a sequence of images shifting attention in the prompt. This script enables you to give a range to the weight of tokens in a prompt and then generate a sequence of images stepping from the first one to the second.
https://user-images.githubusercontent.com/13150150/193368939-c0a57440-1955-417c-898a-ccd102e207a5.mp4
## seed travel
https://github.com/yownas/seed_travel
Small script for AUTOMATIC1111/stable-diffusion-webui to create images that exists between seeds.
<details><summary>Example: (Click to expand:)</summary>
<img src="https://github.com/ClashSAN/bloated-gifs/blob/main/seedtravel.gif" width="512" height="512" />
</details>
## Embeddings editor
https://github.com/CodeExplode/stable-diffusion-webui-embedding-editor
Allows you to manually edit textual inversion embeddings using sliders.
![image](https://user-images.githubusercontent.com/98228077/208331138-cdfe8f43-78f7-499e-b746-c42355ee8d6d.png)
## Latent Mirroring
https://github.com/dfaker/SD-latent-mirroring
Applies mirroring and flips to the latent images to produce anything from subtle balanced compositions to perfect reflections
![image](https://user-images.githubusercontent.com/98228077/208331098-3b7fefce-6d38-486d-9543-258f5b2b0fd6.png)
## StylePile
https://github.com/some9000/StylePile
An easy way to mix and match elements to prompts that affect the style of the result.
![image](https://user-images.githubusercontent.com/98228077/208331056-2956d050-a7a4-4b6f-b064-72f6a7d7ee0d.png)
## Push to 🤗 Hugging Face
https://github.com/camenduru/stable-diffusion-webui-huggingface
![Push Folder to Hugging Face](https://user-images.githubusercontent.com/54370274/206897701-9e86ce7c-af06-4d95-b9ea-385276c99d3a.jpg)
To install it, clone the repo into the `extensions` directory and restart the web ui:
`git clone https://github.com/camenduru/stable-diffusion-webui-huggingface`
`pip install huggingface-hub`
## Tokenizer
https://github.com/AUTOMATIC1111/stable-diffusion-webui-tokenizer
Adds a tab that lets you preview how CLIP model would tokenize your text.
![about](https://user-images.githubusercontent.com/20920490/200113798-50b55f5a-45db-4b6f-93c0-ae6be75e5788.png)
## novelai-2-local-prompt
https://github.com/animerl/novelai-2-local-prompt
Add a button to convert the prompts used in NovelAI for use in the WebUI. In addition, add a button that allows you to recall a previously used prompt.
![pic](https://user-images.githubusercontent.com/113022648/197382468-65f4a96d-48af-4890-8fcf-0ec7c3b9ec3a.png)
## Booru tag autocompletion
https://github.com/DominikDoom/a1111-sd-webui-tagcomplete
Displays autocompletion hints for tags from "image booru" boards such as Danbooru. Uses local tag CSV files and includes a config for customization.
![image](https://user-images.githubusercontent.com/20920490/200016417-9451efdb-5d0d-4131-bd9e-39a687be8dd7.png)
## Unprompted
https://github.com/ThereforeGames/unprompted
Supercharge your prompt workflow with this powerful scripting language!
![unprompted_header](https://user-images.githubusercontent.com/95403634/199041569-7c6c5748-e7dc-4068-943f-c2d92745dbb5.png)
**Unprompted** is a highly modular extension for [AUTOMATIC1111's Stable Diffusion Web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui) that allows you to include various shortcodes in your prompts. You can pull text from files, set up your own variables, process text through conditional functions, and so much more - it's like wildcards on steroids.
While the intended usecase is Stable Diffusion, **this engine is also flexible enough to serve as an all-purpose text generator.**
## training-picker
https://github.com/Maurdekye/training-picker
Adds a tab to the webui that allows the user to automatically extract keyframes from video, and manually extract 512x512 crops of those frames for use in model training.
![image](https://user-images.githubusercontent.com/2313721/199614791-1f573573-a2e2-4358-836d-5655825077e1.png)
**Installation**
- Install [AUTOMATIC1111's Stable Diffusion Webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui)
- Install [ffmpeg](https://ffmpeg.org/) for your operating system
- Clone this repository into the extensions folder inside the webui
- Drop videos you want to extract cropped frames from into the training-picker/videos folder
## auto-sd-paint-ext
https://github.com/Interpause/auto-sd-paint-ext
>Extension for AUTOMATIC1111's webUI with Krita Plugin (other drawing studios soon?)
![image](https://user-images.githubusercontent.com/98228077/217986983-d23a334d-50bc-4bb1-ac8b-60f99a3b07b9.png)
- Optimized workflow (txt2img, img2img, inpaint, upscale) & UI design.
- Only drawing studio plugin that exposes the Script API.
See https://github.com/Interpause/auto-sd-paint-ext/issues/41 for planned developments.
See [CHANGELOG.md](https://github.com/Interpause/auto-sd-paint-ext/blob/main/CHANGELOG.md) for the full changelog.
## Dataset Tag Editor
https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor
[日本語 Readme](https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor/blob/main/README-JP.md)
This is an extension to edit captions in training dataset for [Stable Diffusion web UI by AUTOMATIC1111](https://github.com/AUTOMATIC1111/stable-diffusion-webui).
It works well with text captions in comma-separated style (such as the tags generated by DeepBooru interrogator).
Caption in the filenames of images can be loaded, but edited captions can only be saved in the form of text files.
![picture](https://github.com/toshiaki1729/stable-diffusion-webui-dataset-tag-editor/blob/main/ss01.png)
## Aesthetic Image Scorer
https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer
Extension for https://github.com/AUTOMATIC1111/stable-diffusion-webui
Calculates aesthetic score for generated images using [CLIP+MLP Aesthetic Score Predictor](https://github.com/christophschuhmann/improved-aesthetic-predictor) based on [Chad Scorer](https://github.com/grexzen/SD-Chad/blob/main/chad_scorer.py)
See [Discussions](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/1831)
Saves score to windows tags with other options planned
![picture](https://github.com/tsngo/stable-diffusion-webui-aesthetic-image-scorer/blob/main/tag_group_by.png)
## Artists to study
https://github.com/camenduru/stable-diffusion-webui-artists-to-study
https://artiststostudy.pages.dev/ adapted to an extension for [web ui](https://github.com/AUTOMATIC1111/stable-diffusion-webui).
To install it, clone the repo into the `extensions` directory and restart the web ui:
`git clone https://github.com/camenduru/stable-diffusion-webui-artists-to-study`
You can add the artist name to the clipboard by clicking on it. (thanks for the idea @gmaciocci)
![picture](https://user-images.githubusercontent.com/54370274/197829512-e7d30d44-2697-4ecd-b9a7-3665217918c7.jpg)
## Deforum
https://github.com/deforum-art/deforum-for-automatic1111-webui
The official port of Deforum, an extensive script for 2D and 3D animations, supporting keyframable sequences, dynamic math parameters (even inside the prompts), dynamic masking, depth estimation and warping.
![image](https://user-images.githubusercontent.com/98228077/217986819-67fd1e3c-b007-475c-b8c9-3bf28ee3aa67.png)
## Inspiration
https://github.com/yfszzx/stable-diffusion-webui-inspiration
Randomly display the pictures of the artist's or artistic genres typical style, more pictures of this artist or genre is displayed after selecting. So you don't have to worry about how hard it is to choose the right style of art when you create.
![68747470733a2f2f73362e6a70672e636d2f323032322f31302f32322f504a596f4e4c2e706e67](https://user-images.githubusercontent.com/20920490/197518700-3f753132-8799-4ad0-8cdf-bcdcbf7798aa.png)
## Image Browser
https://github.com/AlUlkesh/stable-diffusion-webui-images-browser
Provides an interface to browse created images in the web browser, allows for sorting and filtering by EXIF data.
![image](https://user-images.githubusercontent.com/23466035/217083703-0845da05-3305-4f5a-af53-f3829de6a29d.png)
## Smart Process
https://github.com/d8ahazard/sd_smartprocess
Intelligent cropping, captioning, and image enhancement.
![image](https://user-images.githubusercontent.com/1633844/201435094-433d765c-56e8-4573-82d9-71af2b112159.png)
## Dreambooth
https://github.com/d8ahazard/sd_dreambooth_extension
Dreambooth in the UI. Refer to the project readme for tuning and configuration requirements. Includes [LoRA](https://github.com/cloneofsimo/lora) (Low Rank Adaptation)
Based on ShivamShiaro's repo.
![image](https://user-images.githubusercontent.com/1633844/201434706-2c2744ba-082e-427e-9f8d-af03de204583.png)
## Dynamic Prompts
https://github.com/adieyal/sd-dynamic-prompts
A custom extension for [AUTOMATIC1111/stable-diffusion-webui](https://github.com/AUTOMATIC1111/stable-diffusion-webui) that implements an expressive template language for random or combinatorial prompt generation along with features to support deep wildcard directory structures.
More features and additions are shown in the [readme](https://github.com/adieyal/sd-dynamic-prompts).
![image](https://github.com/adieyal/sd-dynamic-prompts/raw/main/images/extension.png)
Using this extension, the prompt:
`A {house|apartment|lodge|cottage} in {summer|winter|autumn|spring} by {2$$artist1|artist2|artist3}`
Will any of the following prompts:
- A house in summer by artist1, artist2
- A lodge in autumn by artist3, artist1
- A cottage in winter by artist2, artist3
- ...
This is especially useful if you are searching for interesting combinations of artists and styles.
You can also pick a random string from a file. Assuming you have the file seasons.txt in WILDCARD_DIR (see below), then:
`__seasons__ is coming`
Might generate the following:
- Winter is coming
- Spring is coming
- ...
You can also use the same wildcard twice
`I love __seasons__ better than __seasons__`
- I love Winter better than Summer
- I love Spring better than Spring
## Wildcards
https://github.com/AUTOMATIC1111/stable-diffusion-webui-wildcards
Allows you to use `__name__` syntax in your prompt to get a random line from a file named `name.txt` in the wildcards directory.
## Aesthetic Gradients
https://github.com/AUTOMATIC1111/stable-diffusion-webui-aesthetic-gradients
Create an embedding from one or few pictures and use it to apply their style to generated images.
![firefox_FgKg9dx9eF](https://user-images.githubusercontent.com/20920490/197466300-6b042bcf-5cba-4600-97d7-ad2652875706.png)
## 3D Model&Pose Loader
https://github.com/jtydhr88/sd-3dmodel-loader
A custom extension that allows you to load your local 3D model/animation inside webui, or edit pose as well, then send screenshot to txt2img or img2img as your ControlNet's reference image.
![1](https://user-images.githubusercontent.com/860985/236643711-140579dc-bb74-4a84-ba40-3a64823285ab.png)
## Canvas Editor
https://github.com/jtydhr88/sd-canvas-editor
A custom extension for sd-webui that integrated a full capability canvas editor which you can use layer, text, image, elements, etc.
![overall](https://user-images.githubusercontent.com/860985/236643824-946ebdef-83af-4e85-80ea-6ac7d2fb520e.png)
## One Button Prompt
https://github.com/AIrjen/OneButtonPrompt
One Button Prompt is a tool/script for automatic1111 for beginners who have problems writing a good prompt, or advanced users who want to get inspired.
It generates an entire prompt from scratch. It is random, but controlled. You simply load up the script and press generate, and let it surprise you.
![One Button Prompt](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/40751091/9491d781-c0ad-4f22-93c4-b361635fc265)
## Model Downloader
https://github.com/Iyashinouta/sd-model-downloader
SD-Webui extension to Download Model from CivitAI and HuggingFace, Recomended for Cloud Users (a.k.a Google Colab, etc.)
![Model Downloader](https://github.com/Iyashinouta/sd-model-downloader/raw/84cfcb9d7b79ff031db9fcb9b2b4805c9293611b/images/instructions.png)
## SD Telegram
https://github.com/amputator84/sd_telegram
Telegram bot on aiogram to generate images in automatic1111 locally (127.0.0.1:7860 nowebui)
if you want to manage it via telegram bot, install it via extensions.
Further instructions are on github.
The bot uses [sdwebuiapi](https://github.com/akirayimi/sdwebuiapi/) and works with a local address.
Able to generate previews, full-size pictures, also send documents and groups.
Able to "compose" prompts, take them from [lexica](https://lexica.art/), there is a stream generation script for all models.
![sd_telegram](https://raw.githubusercontent.com/partyfind/sd_bot/master/trash/photo_2023-06-22_15-29-24.jpg)
## QR Code Generator
https://github.com/missionfloyd/webui-qrcode-generator
Instantly generate QR Codes for ControlNet.
![QR Code Generator](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/4073789/0ef6ff8a-276f-4386-9f24-021923c7dca0)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>SD-XL</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>This is a feature showcase page for <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui">Stable Diffusion web UI</a>.</p>
<p>All examples are non-cherrypicked unless specified otherwise.</p>
<h1>SD-XL</h1>
<h2>SD-XL BASE</h2>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/11757">[PR]</a> | <a href="https://github.com/Stability-AI/generative-models">[Stability-AI Github]</a></p>
<h3>Info</h3>
<p>This is a model designed for generating quality 1024×1024-sized images. It is not meant to generate good pictures at 512×512.</p>
<p>It’s tested to produce same (or very close) images as Stability-AI’s repo (need to set Random number generator source = CPU in settings)</p>
<figure><img src="https://user-images.githubusercontent.com/20920490/253218112-c7c02951-0c1c-47f8-98a4-4fbdcb028712.png" alt="img"></figure>
<pre><code>- textual inversion should not work, embeddings need to be created specifically for SDXL.
- train tab will not work.
- DDIM, PLMS, UniPC samplers do not work for SDXL
</code></pre>
<pre><code>- --lowvram, --medvram works
- attention optimizations work
- SDXL Loras work
- works at minimum 4gb gpu (30XX)
</code></pre>
<blockquote>
<p>NOTE: Initial loading of these models require those with 24gb cpu memory (RAM) and under to setup a large pagefile. This may change in the future.</p>
</blockquote>
<h3>Downloading:</h3>
<ol>
<li><a href="https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors">sd_xl_base_1.0</a></li>
</ol>
<blockquote>
<p>The base model’s VAE has problems running in fp16. <a href="https://github.com/madebyollin">madebyollin</a> has kindly trained a vae to mostly remedy this:</p>
</blockquote>
<ol start="2">
<li><a href="https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl_vae.safetensors">sdxl-vae-fp16-fix</a></li>
</ol>
<p>(Please use both of these to avoid slow speeds, and GPU out-of-vram issues.)</p>
<h1>SD2 Variation Models</h1>
<p><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8958">PR</a>, (<a href="https://github.com/Stability-AI/stablediffusion/blob/main/doc/UNCLIP.MD">more info.</a>)</p>
<p>support for <a href="https://huggingface.co/stabilityai/stable-diffusion-2-1-unclip">stable-diffusion-2-1-unclip</a> checkpoints that are used for generating image variations.</p>
<p>It works in the same way as the current support for the SD2.0 depth model, in that you run it from the img2img tab, it extracts information from the input image (in this case, CLIP or OpenCLIP embeddings), and feeds those into the model in addition to the text prompt. Normally you would do this with denoising strength set to 1.0, since you don’t actually want the normal img2img behaviour to have any influence on the generated image.</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/231526001-adef8278-4670-4a78-bd95-04ec51c01b40.png" alt="image"></figure>
<h1>InstructPix2Pix</h1>
<p><a href="https://www.timothybrooks.com/instruct-pix2pix">Website</a>. <a href="http://instruct-pix2pix.eecs.berkeley.edu/instruct-pix2pix-00-22000.ckpt">Checkpoint</a>. The checkpoint is fully supported in img2img tab. No additional actions are required. Previously an <a href="https://github.com/Klace/stable-diffusion-webui-instruct-pix2pix">extension</a> by a contributor was required to generate pictures: it’s no longer required, but should still work. Most of img2img implementation is by the same person.</p>
<p>To reproduce results of the original repo, use denoising of 1.0, Euler a sampler, and edit the config in <code>configs/instruct-pix2pix.yaml</code> to say:</p>
<pre><code> use_ema: true
load_ema: true
</code></pre>
<p>instead of:</p>
<pre><code> use_ema: false
</code></pre>
<figure><img src="https://user-images.githubusercontent.com/20920490/216767957-3c6bf787-5b79-45df-aa9e-ce86b1d9e40f.png" alt="firefox_Yj09cbmDZ1"></figure>
<h1>Extra networks</h1>
<p>A single button with a picture of a card on it. It unifies multiple extra ways to extend your generation into one UI.</p>
<p>Find it next to the big Generate button:
<img src="https://user-images.githubusercontent.com/20920490/214776880-2fe558e1-6f63-432f-b0c6-675e1d1a0822.png" alt="firefox_QOnhgmmSi5"></p>
<p>Extra networks provides a set of cards, each corresponding to a file with a part of model you either train or obtain from somewhere. Clicking the card adds the model to prompt, where it will affect generation.</p>
<table>
<thead>
<tr>
<th>Extra network</th>
<th>Directory</th>
<th>File types</th>
<th>How to use in prompt</th>
</tr>
</thead>
<tbody>
<tr>
<td>Textual Inversion</td>
<td><code>embeddings</code></td>
<td><code>*.pt</code>, images</td>
<td>embedding’s filename</td>
</tr>
<tr>
<td>LoRA</td>
<td><code>models/Lora</code></td>
<td><code>*.pt</code>, <code>*.safetensors</code></td>
<td><code>&lt;lora:filename:multiplier&gt;</code></td>
</tr>
<tr>
<td>Hypernetworks</td>
<td><code>models/hypernetworks</code></td>
<td><code>*.pt</code>, <code>*.ckpt</code>, <code>*.safetensors</code></td>
<td><code>&lt;hypernet:filename:multiplier&gt;</code></td>
</tr>
</tbody>
</table>
<h2>Textual Inversion</h2>
<p>A method to fine tune weights for a token in CLIP, the language model used by Stable Diffusion, from summer 2021. <a href="https://textual-inversion.github.io/">Author’s site</a>. Long explanation: <a href="Textual-Inversion">Textual Inversion</a></p>
<h2>LoRA</h2>
<p>A method to fine tune weights for CLIP and Unet, the language model and the actual image de-noiser used by Stable Diffusion, published in 2021. <a href="https://arxiv.org/abs/2106.09685">Paper</a>. A good way to train LoRA is to use <a href="https://github.com/kohya-ss/sd-scripts">kohya-ss</a>.</p>
<p>Support for LoRA is built-in into the Web UI, but there is an <a href="https://github.com/kohya-ss/sd-webui-additional-networks">extension</a> with original implementation by kohya-ss.</p>
<p>Currently, LoRA networks for Stable Diffusion 2.0+ models are not supported by Web UI.</p>
<p>LoRA is added to the prompt by putting the following text into any location: <code>&lt;lora:filename:multiplier&gt;</code>, where <code>filename</code> is the name of file with LoRA on disk, excluding extension, and <code>multiplier</code> is a number, generally from 0 to 1, that lets you choose how strongly LoRA will affect the output. LoRA cannot be added to the negative prompt.</p>
<p>The text for adding LoRA to the prompt, <code>&lt;lora:filename:multiplier&gt;</code>, is only used to enable LoRA, and is erased from prompt afterwards, so you can’t do tricks with prompt editing like <code>[&lt;lora:one:1.0&gt;|&lt;lora:two:1.0&gt;]</code>. A batch with multiple different prompts will only use the LoRA from the first prompt.</p>
<h2>Hypernetworks</h2>
<p>A method to fine tune weights for CLIP and Unet, the language model and the actual image de-noiser used by Stable Diffusion, generously donated to the world by our friends at Novel AI in autumn 2022. Works in the same way as LoRA except for sharing weights for some layers. Multiplier can be used to choose how strongly the hypernetwork will affect the output.</p>
<p>Same rules for adding hypernetworks to the prompt apply as for LoRA: <code>&lt;hypernet:filename:multiplier&gt;</code>.</p>
<h1>Alt-Diffusion</h1>
<p>A model trained to accept inputs in different languages.
<a href="https://arxiv.org/abs/2211.06679">More info</a>.
<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5238">PR</a>.</p>
<ul>
<li><a href="https://huggingface.co/webui/AltDiffusion-m9/tree/main">Download</a> the checkpoint from huggingface. Click the down arrow to download.</li>
<li>Put the file into <code>models/Stable-Diffusion</code></li>
</ul>
<details><summary>Notes: (Click to expand:)</summary>
<p>Mechanically, attention/emphasis mechanism is supported, but seems to have much less effect, probably due to how Alt-Diffusion is implemented.</p>
<p>Clip skip is not supported, the setting is ignored.</p>
<ul>
<li>It is recommended to run with <code>--xformers.</code> Adding additional memory-saving flags such as <code>--xformers --medvram</code> does not work.</li>
</ul>
</details>
<h1>Stable Diffusion 2.0</h1>
<ol>
<li>Download your checkpoint file from huggingface. Click the down arrow to download.</li>
<li>Put the file into <code>models/Stable-Diffusion</code></li>
</ol>
<ul>
<li>768 (2.0) - (<a href="https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/768-v-ema.safetensors">model</a>)</li>
<li>768 (2.1) - (<a href="https://huggingface.co/webui/stable-diffusion-2-1/tree/main">model</a>)</li>
<li>512 (2.0) - (<a href="https://huggingface.co/stabilityai/stable-diffusion-2-base/blob/main/512-base-ema.safetensors">model</a>)</li>
</ul>
<details><summary>Notes: (Click to expand:)</summary>
<p>If 2.0 or 2.1 is generating black images, enable full precision with <code>--no-half</code> or try using the <code>--xformers</code> optimization.</p>
<p><em><strong>Note:</strong></em> SD 2.0 and 2.1 are more sensitive to FP16 numerical instability (as noted by themselves <a href="https://github.com/Stability-AI/stablediffusion/commit/c12d960d1ee4f9134c2516862ef991ec52d3f59e">here</a>) due to their new cross attention module.</p>
<p>On fp16: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5503#issuecomment-1341495770">comment</a> to enable, in webui-user.bat:</p>
<pre><code>@echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=your command line options
set STABLE_DIFFUSION_COMMIT_HASH=&quot;c12d960d1ee4f9134c2516862ef991ec52d3f59e&quot;
set ATTN_PRECISION=fp16
call webui.bat
</code></pre>
</details>
<h2>Depth Guided Model</h2>
<p>The depth-guided model will only work in img2img tab.
<a href="https://github.com/Stability-AI/stablediffusion#depth-conditional-stable-diffusion">More info</a>. <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5542">PR</a>.</p>
<ul>
<li>512 depth (2.0) - (<a href="https://huggingface.co/webui/stable-diffusion-2-depth/tree/main">model+yaml</a>) - <code>.safetensors</code></li>
<li>512 depth (2.0) - (<a href="https://huggingface.co/stabilityai/stable-diffusion-2-depth/tree/main">model</a>, <a href="https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-midas-inference.yaml">yaml</a>)</li>
</ul>
<h2>Inpainting Model SD2</h2>
<p>Model specifically designed for inpainting trained on SD 2.0 512 base.</p>
<ul>
<li>512 inpainting (2.0) - (<a href="https://huggingface.co/webui/stable-diffusion-2-inpainting/tree/main">model+yaml</a>) - <code>.safetensors</code></li>
</ul>
<p><code>inpainting_mask_weight</code> or inpainting conditioning mask strength works on this too.</p>
<h1>Outpainting</h1>
<p>Outpainting extends the original image and inpaints the created empty space.</p>
<p>Example:</p>
<table>
<thead>
<tr>
<th>Original</th>
<th>Outpainting</th>
<th>Outpainting again</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/outpainting-1.png" alt=""></td>
<td><img src="images/outpainting-2.png" alt=""></td>
<td><img src="images/outpainting-3.png" alt=""></td>
</tr>
</tbody>
</table>
<p>Original image by Anonymous user from 4chan. Thank you, Anonymous user.</p>
<p>You can find the feature in the img2img tab at the bottom, under Script -&gt; Poor man’s outpainting.</p>
<p>Outpainting, unlike normal image generation, seems to profit very much from large step count. A recipe for a good outpainting is a good prompt that matches the picture, sliders for denoising and CFG scale set to max, and step count of 50 to 100 with Euler ancestral or DPM2 ancestral samplers.</p>
<table>
<thead>
<tr>
<th>81 steps, Euler A</th>
<th>30 steps, Euler A</th>
<th>10 steps, Euler A</th>
<th>80 steps, Euler A</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/inpainting-81-euler-a.png" alt=""></td>
<td><img src="images/inpainting-30-euler-a.png" alt=""></td>
<td><img src="images/inpainting-10-euler-a.png" alt=""></td>
<td><img src="images/inpainting-80-dpm2-a.png" alt=""></td>
</tr>
</tbody>
</table>
<h1>Inpainting</h1>
<p>In img2img tab, draw a mask over a part of the image, and that part will be in-painted.</p>
<figure><img src="images/inpainting.png" alt=""></figure>
<p>Options for inpainting:</p>
<ul>
<li>draw a mask yourself in the web editor</li>
<li>erase a part of the picture in an external editor and upload a transparent picture. Any even slightly transparent areas will become part of the mask. Be aware that <a href="https://docs.krita.org/en/reference_manual/layers_and_masks/split_alpha.html#how-to-save-a-png-texture-and-keep-color-values-in-fully-transparent-areas">some editors</a> save completely transparent areas as black by default.</li>
<li>change mode (to the bottom right of the picture) to “Upload mask” and choose a separate black and white image for the mask (white=inpaint).</li>
</ul>
<h2>Inpainting model</h2>
<p>RunwayML has trained an additional model specifically designed for inpainting. This model accepts additional inputs - the initial image without noise plus the mask - and seems to be much better at the job.</p>
<p>Download and extra info for the model is here: <a href="https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion">https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion</a></p>
<p>To use the model, you must rename the checkpoint so that its filename ends in <code>inpainting.ckpt</code>, for example, <code>1.5-inpainting.ckpt</code>.</p>
<p>After that just select the checkpoint as you’d usually select any checkpoint and you’re good to go.</p>
<h2>Masked content</h2>
<p>The masked content field determines content is placed to put into the masked regions before they are inpainted. This does not represent final output, it’s only a look at what’s going on mid-process.</p>
<table>
<thead>
<tr>
<th>mask</th>
<th>fill</th>
<th>original</th>
<th>latent noise</th>
<th>latent nothing</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/inpainting-initial-content-mask.png" alt=""></td>
<td><img src="images/inpainting-initial-content-fill.png" alt=""></td>
<td><img src="images/inpainting-initial-content-original.png" alt=""></td>
<td><img src="images/inpainting-initial-content-latent-noise.png" alt=""></td>
<td><img src="images/inpainting-initial-content-latent-nothing.png" alt=""></td>
</tr>
</tbody>
</table>
<h2>Inpaint area</h2>
<p>Normally, inpainting resizes the image to the target resolution specified in the UI. With <code>Inpaint area: Only masked</code> enabled, only the masked region is resized, and after processing it is pasted back to the original picture.
This allows you to work with large pictures and render the inpainted object at a much larger resolution.</p>
<table>
<thead>
<tr>
<th>Input</th>
<th>Inpaint area: Whole picture</th>
<th>Inpaint area: Only masked</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/inpaint-whole-mask.png" alt=""></td>
<td><img src="images/inpaint-whole-no.png" alt=""></td>
<td><img src="images/inpaint-whole-yes.png" alt=""></td>
</tr>
</tbody>
</table>
<h2>Masking mode</h2>
<p>There are two options for masked mode:</p>
<ul>
<li>Inpaint masked - the region under the mask is inpainted</li>
<li>Inpaint not masked - under the mask is unchanged, everything else is inpainted</li>
</ul>
<h2>Alpha mask</h2>
<table>
<thead>
<tr>
<th>Input</th>
<th>Output</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/inpaint-mask.png" alt=""></td>
<td><img src="images/inpaint-mask2.png" alt=""></td>
</tr>
</tbody>
</table>
<h2>Color Sketch</h2>
<p>Basic coloring tool for the img2img tab. Chromium-based browsers support a dropper tool.
<img src="https://user-images.githubusercontent.com/98228077/214700734-2260f6f0-0fdf-46db-a2c6-71e5ec60e43b.png" alt="color-sketch_NewUI">
(this is on firefox)</p>
<h1>Prompt matrix</h1>
<p>Separate multiple prompts using the <code>|</code> character, and the system will produce an image for every combination of them.
For example, if you use <code>a busy city street in a modern city|illustration|cinematic lighting</code> prompt, there are four combinations possible (first part of the prompt is always kept):</p>
<ul>
<li><code>a busy city street in a modern city</code></li>
<li><code>a busy city street in a modern city, illustration</code></li>
<li><code>a busy city street in a modern city, cinematic lighting</code></li>
<li><code>a busy city street in a modern city, illustration, cinematic lighting</code></li>
</ul>
<p>Four images will be produced, in this order, all with the same seed and each with a corresponding prompt:
<img src="images/prompt-matrix.png" alt=""></p>
<p>Another example, this time with 5 prompts and 16 variations:
<img src="images/prompt_matrix.jpg" alt=""></p>
<p>You can find the feature at the bottom, under Script -&gt; Prompt matrix.</p>
<h1>Stable Diffusion upscale</h1>
<p>Upscale image using RealESRGAN/ESRGAN and then go through tiles of the result, improving them with img2img.
It also has an option to let you do the upscaling part yourself in an external program, and just go through tiles with img2img.</p>
<p>Original idea by: <a href="https://github.com/jquesnelle/txt2imghd">https://github.com/jquesnelle/txt2imghd</a>. This is an independent implementation.</p>
<p>To use this feature, select <code>SD upscale from the scripts dropdown selection</code> (img2img tab).</p>
<figure><img src="https://user-images.githubusercontent.com/39339941/193300082-be3b8864-3c28-44b7-bb75-f893f92269b6.png" alt="chrome_dl8hcMPYcx"></figure>
<p>The input image will be upscaled to twice the original
width and height, and UI’s width and height sliders specify the size of individual tiles. Because of overlap, the size of the tile can be very important: 512x512 image needs nine 512x512 tiles (because of overlap), but only
four 640x640 tiles.</p>
<p>Recommended parameters for upscaling:</p>
<ul>
<li>Sampling method: Euler a</li>
<li>Denoising strength: 0.2, can go up to 0.4 if you feel adventurous
<ul>
<li>A larger denoising strength is problematic due to the fact SD upscale works in tiles, as the diffusion process is then unable to give attention to the image as a whole.</li>
</ul>
</li>
</ul>
<table>
<thead>
<tr>
<th>Original</th>
<th>RealESRGAN</th>
<th>Topaz Gigapixel</th>
<th>SD upscale</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/sd-upscale-robot-original.png" alt=""></td>
<td><img src="images/sd-upscale-robot-realesrgan.png" alt=""></td>
<td><img src="images/sd-upscale-robot-esrgan-topaz-gigapixel.png" alt=""></td>
<td><img src="images/sd-upscale-robot-sd-upscale.png" alt=""></td>
</tr>
<tr>
<td><img src="images/sd-upscale-castle-original.png" alt=""></td>
<td><img src="images/sd-upscale-castle-realesrgan.png" alt=""></td>
<td><img src="images/sd-upscale-castle-esrgan-topaz-gigapixel.png" alt=""></td>
<td><img src="images/sd-upscale-castle-sd-upscale.png" alt=""></td>
</tr>
<tr>
<td><img src="images/sd-upscale-city-original.png" alt=""></td>
<td><img src="images/sd-upscale-city-realesrgan.png" alt=""></td>
<td><img src="images/sd-upscale-city-esrgan-topaz-gigapixel.png" alt=""></td>
<td><img src="images/sd-upscale-city-sd-upscale.png" alt=""></td>
</tr>
</tbody>
</table>
<h1>Infinite prompt length</h1>
<p>Typing past standard 75 tokens that Stable Diffusion usually accepts increases prompt size limit from 75 to 150. Typing past that increases prompt size further. This is done by breaking the prompt into chunks of 75 tokens, processing each independently using CLIP’s Transformers neural network, and then concatenating the result before feeding into the next component of stable diffusion, the Unet.</p>
<p>For example, a prompt with 120 tokens would be separated into two chunks: first with 75 tokens, second with 45. Both would be padded to 75 tokens and extended with start/end tokens to 77. After passing those two chunks though CLIP, we’ll have two tensors with shape of <code>(1, 77, 768)</code>. Concatenating those results in <code>(1, 154, 768)</code> tensor that is then passed to Unet without issue.</p>
<h2>BREAK keyword</h2>
<p>Adding a <code>BREAK</code> keyword (must be uppercase) fills the current chunks with padding characters. Adding more text after <code>BREAK</code> text will start a new chunk.</p>
<h1>Attention/emphasis</h1>
<p>Using <code>()</code> in the prompt increases the model’s attention to enclosed words, and <code>[]</code> decreases it. You can combine multiple modifiers:</p>
<figure><img src="images/attention-3.jpg" alt=""></figure>
<p>Cheat sheet:</p>
<ul>
<li><code>a (word)</code> - increase attention to <code>word</code> by a factor of 1.1</li>
<li><code>a ((word))</code> - increase attention to <code>word</code> by a factor of 1.21 (= 1.1 * 1.1)</li>
<li><code>a [word]</code> - decrease attention to <code>word</code> by a factor of 1.1</li>
<li><code>a (word:1.5)</code> - increase attention to <code>word</code> by a factor of 1.5</li>
<li><code>a (word:0.25)</code> - decrease attention to <code>word</code> by a factor of 4 (= 1 / 0.25)</li>
<li><code>a \(word\)</code> - use literal <code>()</code> characters in prompt</li>
</ul>
<p>With <code>()</code>, a weight can be specified like this: <code>(text:1.4)</code>. If the weight is not specified, it is assumed to be 1.1. Specifying weight only works with <code>()</code> not with <code>[]</code>.</p>
<p>If you want to use any of the literal <code>()[]</code> characters in the prompt, use the backslash to escape them: <code>anime_\(character\)</code>.</p>
<p>On 2022-09-29, a new implementation was added that supports escape characters and numerical weights. A downside of the new implementation is that the old one was not perfect and sometimes ate characters: “a (((farm))), daytime”, for example, would become “a farm daytime” without the comma. This behavior is not shared by the new implementation which preserves all text correctly, and this means that your saved seeds may produce different pictures. For now, there is an option in settings to use the old implementation.</p>
<p>NAI uses my implementation from before 2022-09-29, except they have 1.05 as the multiplier and use <code>{}</code> instead of <code>()</code>. So the conversion applies:</p>
<ul>
<li>their <code>{word}</code> = our <code>(word:1.05)</code></li>
<li>their <code>{{word}}</code> = our <code>(word:1.1025)</code></li>
<li>their <code>[word]</code> = our <code>(word:0.952)</code> (0.952 = 1/1.05)</li>
<li>their <code>[[word]]</code> = our <code>(word:0.907)</code> (0.907 = 1/1.05/1.05)</li>
</ul>
<h1>Loopback</h1>
<p>Selecting the loopback script in img2img allows you to automatically feed output image as input for the next batch. Equivalent to saving output image and replacing the input image with it. Batch count setting controls how many iterations of
this you get.</p>
<p>Usually, when doing this, you would choose one of many images for the next iteration yourself, so the usefulness
of this feature may be questionable, but I’ve managed to get some very nice outputs with it that I wasn’t able
to get otherwise.</p>
<p>Example: (cherrypicked result)</p>
<figure><img src="images/loopback.jpg" alt=""></figure>
<p>Original image by Anonymous user from 4chan. Thank you, Anonymous user.</p>
<h1>X/Y/Z plot</h1>
<p>Creates multiple grids of images with varying parameters. X and Y are used as the rows and columns, while the Z grid is used as a batch dimension.</p>
<figure><img src="https://user-images.githubusercontent.com/23466035/215288902-d8e13152-ba22-443f-9cf9-44108eba36fb.png" alt="xyz-grid"></figure>
<p>Select which parameters should be shared by rows, columns and batch by using X type, Y type and Z Type fields, and input those parameters separated by comma into X/Y/Z values fields. For integer, and floating point numbers, and ranges are supported. Examples:</p>
<ul>
<li>Simple ranges:
<ul>
<li><code>1-5</code> = 1, 2, 3, 4, 5</li>
</ul>
</li>
<li>Ranges with increment in bracket:
<ul>
<li><code>1-5 (+2)</code> = 1, 3, 5</li>
<li><code>10-5 (-3)</code> = 10, 7</li>
<li><code>1-3 (+0.5)</code> = 1, 1.5, 2, 2.5, 3</li>
</ul>
</li>
<li>Ranges with the count in square brackets:
<ul>
<li><code>1-10 [5]</code> = 1, 3, 5, 7, 10</li>
<li><code>0.0-1.0 [6]</code> = 0.0, 0.2, 0.4, 0.6, 0.8, 1.0</li>
</ul>
</li>
</ul>
<h3>Prompt S/R</h3>
<p>Prompt S/R is one of more difficult to understand modes of operation for X/Y Plot. S/R stands for search/replace, and that’s what it does - you input a list of words or phrases, it takes the first from the list and treats it as keyword, and replaces all instances of that keyword with other entries from the list.</p>
<p>For example, with prompt <code>a man holding an apple, 8k clean</code>, and Prompt S/R <code>an apple, a watermelon, a gun</code> you will get three prompts:</p>
<ul>
<li><code>a man holding an apple, 8k clean</code></li>
<li><code>a man holding a watermelon, 8k clean</code></li>
<li><code>a man holding a gun, 8k clean</code></li>
</ul>
<p>The list uses the same syntax as a line in a CSV file, so if you want to include commas into your entries you have to put text in quotes and make sure there is no space between quotes and separating commas:</p>
<ul>
<li><code>darkness, light, green, heat</code> - 4 items - <code>darkness</code>, <code>light</code>, <code>green</code>, <code>heat</code></li>
<li><code>darkness, &quot;light, green&quot;, heat</code> - WRONG - 4 items - <code>darkness</code>, <code>&quot;light</code>, <code>green&quot;</code>, <code>heat</code></li>
<li><code>darkness,&quot;light, green&quot;,heat</code> - RIGHT - 3 items - <code>darkness</code>, <code>light, green</code>, <code>heat</code></li>
</ul>
<h1>Prompts from file or textbox</h1>
<p>With this script it is possible to create a list of jobs which will be executed sequentially.</p>
<p>Example input:</p>
<pre><code>--prompt &quot;photo of sunset&quot;
--prompt &quot;photo of sunset&quot; --negative_prompt &quot;orange, pink, red, sea, water, lake&quot; --width 1024 --height 768 --sampler_name &quot;DPM++ 2M Karras&quot; --steps 10 --batch_size 2 --cfg_scale 3 --seed 9
--prompt &quot;photo of winter mountains&quot; --steps 7 --sampler_name &quot;DDIM&quot;
--prompt &quot;photo of winter mountains&quot; --width 1024
</code></pre>
<p>Example output:</p>
<figure><img src="https://user-images.githubusercontent.com/32306715/216720287-c523b900-916b-4f39-985c-4107d4b5460d.png" alt="image"></figure>
<p>Following parameters are supported:</p>
<pre><code> &quot;sd_model&quot;, &quot;outpath_samples&quot;, &quot;outpath_grids&quot;, &quot;prompt_for_display&quot;, &quot;prompt&quot;, &quot;negative_prompt&quot;, &quot;styles&quot;, &quot;seed&quot;, &quot;subseed_strength&quot;, &quot;subseed&quot;,
&quot;seed_resize_from_h&quot;, &quot;seed_resize_from_w&quot;, &quot;sampler_index&quot;, &quot;sampler_name&quot;, &quot;batch_size&quot;, &quot;n_iter&quot;, &quot;steps&quot;, &quot;cfg_scale&quot;, &quot;width&quot;, &quot;height&quot;,
&quot;restore_faces&quot;, &quot;tiling&quot;, &quot;do_not_save_samples&quot;, &quot;do_not_save_grid&quot;
</code></pre>
<h1>Resizing</h1>
<p>There are three options for resizing input images in img2img mode:</p>
<ul>
<li>Just resize - simply resizes the source image to the target resolution, resulting in an incorrect aspect ratio</li>
<li>Crop and resize - resize source image preserving aspect ratio so that entirety of target resolution is occupied by it, and crop parts that stick out</li>
<li>Resize and fill - resize source image preserving aspect ratio so that it entirely fits target resolution, and fill empty space by rows/columns from the source image</li>
</ul>
<p>Example:
<img src="images/resizing.jpg" alt=""></p>
<h1>Sampling method selection</h1>
<p>Pick out of multiple sampling methods for txt2img:</p>
<figure><img src="images/sampling.jpg" alt=""></figure>
<h1>Seed resize</h1>
<p>This function allows you to generate images from known seeds at different resolutions. Normally, when you change resolution,
the image changes entirely, even if you keep all other parameters including seed. With seed resizing you specify the resolution of the original image, and the model will very likely produce something looking very similar to it, even at a different resolution.
In the example below, the leftmost picture is 512x512, and others are produced with exact same parameters but with larger vertical
resolution.</p>
<table>
<thead>
<tr>
<th>Info</th>
<th>Image</th>
</tr>
</thead>
<tbody>
<tr>
<td>Seed resize not enabled</td>
<td><img src="images/seed-noresize.png" alt=""></td>
</tr>
<tr>
<td>Seed resized from 512x512</td>
<td><img src="images/seed-resize.png" alt=""></td>
</tr>
</tbody>
</table>
<p>Ancestral samplers are a little worse at this than the rest.</p>
<p>You can find this feature by clicking the “Extra” checkbox near the seed.</p>
<h1>Variations</h1>
<p>A Variation strength slider and Variation seed field allow you to specify how much the existing picture should be altered to look like a different one. At maximum strength, you will get pictures with the Variation seed, at minimum - pictures with the original Seed (except for when using ancestral samplers).</p>
<figure><img src="images/seed-variations.jpg" alt=""></figure>
<p>You can find this feature by clicking the “Extra” checkbox near the seed.</p>
<h1>Styles</h1>
<p>Press the “Save prompt as style” button to write your current prompt to styles.csv, the file with a collection of styles. A dropbox to the right of the prompt will allow you to choose any style out of previously saved, and automatically append it to your input.
To delete a style, manually delete it from styles.csv and restart the program.</p>
<p>if you use the special string <code>{prompt}</code> in your style, it will substitute anything currently in the prompt into that position, rather than appending the style to your prompt.</p>
<h1>Negative prompt</h1>
<p>Allows you to use another prompt of things the model should avoid when generating the picture. This works by using the negative prompt for unconditional conditioning in the sampling process instead of an empty string.</p>
<p>Advanced explanation: <a href="Negative-prompt">Negative prompt</a></p>
<table>
<thead>
<tr>
<th>Original</th>
<th>Negative: purple</th>
<th>Negative: tentacles</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/negative-base.png" alt=""></td>
<td><img src="images/negative-purple.png" alt=""></td>
<td><img src="images/negative-tentacles.png" alt=""></td>
</tr>
</tbody>
</table>
<h1>CLIP interrogator</h1>
<p>Originally by: <a href="https://github.com/pharmapsychotic/clip-interrogator">https://github.com/pharmapsychotic/clip-interrogator</a></p>
<p>CLIP interrogator allows you to retrieve the prompt from an image. The prompt won’t allow you to reproduce this exact image (and sometimes it won’t even be close), but it can be a good start.</p>
<figure><img src="images/CLIP-interrogate.png" alt=""></figure>
<p>The first time you run CLIP interrogator it will download a few gigabytes of models.</p>
<p>CLIP interrogator has two parts: one is a BLIP model that creates a text description from the picture.
Other is a CLIP model that will pick few lines relevant to the picture out of a list. By default, there is only one list - a list of artists (from <code>artists.csv</code>). You can add more lists by doing the following:</p>
<ul>
<li>create <code>interrogate</code> directory in the same place as webui</li>
<li>put text files in it with a relevant description on each line</li>
</ul>
<p>For example of what text files to use, see <a href="https://github.com/pharmapsychotic/clip-interrogator/tree/main/clip_interrogator/data">https://github.com/pharmapsychotic/clip-interrogator/tree/main/clip_interrogator/data</a>.
In fact, you can just take files from there and use them - just skip artists.txt because you already have a list of artists in <code>artists.csv</code> (or use that too, who’s going to stop you). Each file adds one line of text to the final description.
If you add “.top3.” to filename, for example, <code>flavors.top3.txt</code>, the three most relevant lines from this file will be added to the prompt (other numbers also work).</p>
<p>There are settings relevant to this feature:</p>
<ul>
<li><code>Interrogate: keep models in VRAM</code> - do not unload Interrogate models from memory after using them. For users with a lot of VRAM.</li>
<li><code>Interrogate: use artists from artists.csv</code> - adds artist from <code>artists.csv</code> when interrogating. Can be useful to disable when you have your list of artists in <code>interrogate</code> directory</li>
<li><code>Interrogate: num_beams for BLIP</code> - parameter that affects how detailed descriptions from BLIP model are (the first part of generated prompt)</li>
<li><code>Interrogate: minimum description length</code> - minimum length for BLIP model’s text</li>
<li><code>Interrogate: maximum descripton length</code> - maximum length for BLIP model’s text</li>
<li><code>Interrogate: maximum number of lines in text file</code> - interrogator will only consider this many first lines in a file. Set to 0, the default is 1500, which is about as much as a 4GB videocard can handle.</li>
</ul>
<h1>Prompt editing</h1>
<figure><img src="https://user-images.githubusercontent.com/20920490/190426933-9748708b-6db0-4cb0-8cb9-3285053916b8.jpg" alt="xy_grid-0022-646033397"></figure>
<p>Prompt editing allows you to start sampling one picture, but in the middle swap to something else. The base syntax for this is:</p>
<pre><code>[from:to:when]
</code></pre>
<p>Where <code>from</code> and <code>to</code> are arbitrary texts, and <code>when</code> is a number that defines how late in the sampling cycle should the switch be made. The later it is, the less power the model has to draw the <code>to</code> text in place of <code>from</code> text. If <code>when</code> is a number between 0 and 1, it’s a fraction of the number of steps after which to make the switch. If it’s an integer greater than zero, it’s just the step after which to make the switch.</p>
<p>Nesting one prompt editing inside another does work.</p>
<p>Additionally:</p>
<ul>
<li><code>[to:when]</code> - adds <code>to</code> to the prompt after a fixed number of steps (<code>when</code>)</li>
<li><code>[from::when]</code> - removes <code>from</code> from the prompt after a fixed number of steps (<code>when</code>)</li>
</ul>
<p>Example:
<code>a [fantasy:cyberpunk:16] landscape</code></p>
<ul>
<li>At start, the model will be drawing <code>a fantasy landscape</code>.</li>
<li>After step 16, it will switch to drawing <code>a cyberpunk landscape</code>, continuing from where it stopped with fantasy.</li>
</ul>
<p>Here’s a more complex example with multiple edits:
<code>fantasy landscape with a [mountain:lake:0.25] and [an oak:a christmas tree:0.75][ in foreground::0.6][ in background:0.25] [shoddy:masterful:0.5]</code> (sampler has 100 steps)</p>
<ul>
<li>at start, <code>fantasy landscape with a mountain and an oak in foreground shoddy</code></li>
<li>after step 25, <code>fantasy landscape with a lake and an oak in foreground in background shoddy</code></li>
<li>after step 50, <code>fantasy landscape with a lake and an oak in foreground in background masterful</code></li>
<li>after step 60, <code>fantasy landscape with a lake and an oak in background masterful</code></li>
<li>after step 75, <code>fantasy landscape with a lake and a christmas tree in background masterful</code></li>
</ul>
<p>The picture at the top was made with the prompt:</p>
<p><code>Official portrait of a smiling world war ii general, [male:female:0.99], cheerful, happy, detailed face, 20th century, highly detailed, cinematic lighting, digital art painting by Greg Rutkowski</code></p>
<p>And the number 0.99 is replaced with whatever you see in column labels on the image.</p>
<p>The last column in the picture is [male:female:0.0], which essentially means that you are asking the model to draw a female from the start, without starting with a male general, and that is why it looks so different from others.</p>
<p><strong>Note</strong>: This syntax does <em>not</em> work with extra networks, such as LoRA. See <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/10897#discussioncomment-6055184">this discussion post</a> for details. For similar functionality, see the <a href="https://github.com/cheald/sd-webui-loractl">sd-webui-loractrl extension</a>.</p>
<h2>Alternating Words</h2>
<p>Convenient Syntax for swapping every other step.</p>
<pre><code>[cow|horse] in a field
</code></pre>
<p>On step 1, prompt is “cow in a field.” Step 2 is “horse in a field.” Step 3 is “cow in a field” and so on.</p>
<figure><img src="https://user-images.githubusercontent.com/39339941/197556926-49ceb72b-daf3-4208-86f3-c2e7e9cd775a.gif" alt="Alternating Words"></figure>
<p>See more advanced example below. On step 8, the chain loops back from “man” to “cow.”</p>
<pre><code>[cow|cow|horse|man|siberian tiger|ox|man] in a field
</code></pre>
<p>Prompt editing was first implemented by Doggettx in <a href="https://www.reddit.com/r/StableDiffusion/comments/xas2os/simple_prompt2prompt_implementation_with_prompt/">this reddit post</a>.</p>
<p><strong>Note</strong>: This syntax does <em>not</em> work with extra networks, such as LoRA. See <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/10897#discussioncomment-6055184">this discussion post</a> for details. For similar functionality, see the <a href="https://github.com/cheald/sd-webui-loractl">sd-webui-loractrl extension</a>.</p>
<h1>Hires. fix</h1>
<p>A convenience option to partially render your image at a lower resolution, upscale it, and then add details at a high resolution. By default, txt2img makes horrible images at very high resolutions, and this makes it possible to avoid using the small picture’s composition. Enabled by checking the “Hires. fix” checkbox on the txt2img page.</p>
<table>
<thead>
<tr>
<th>Without</th>
<th>With</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="https://user-images.githubusercontent.com/20920490/191177752-ad983e62-8e1c-4197-8f3b-3165a6a6c31d.png" alt="00262-836728130"></td>
<td><img src="https://user-images.githubusercontent.com/20920490/191177785-395a951e-0d2e-4db7-9645-4c5af9321772.png" alt="00261-836728130"></td>
</tr>
<tr>
<td><img src="https://user-images.githubusercontent.com/20920490/191178018-25dcd98d-6c45-4c31-ab7a-3de6c51c52e3.png" alt="00345-950170121"></td>
<td><img src="https://user-images.githubusercontent.com/20920490/191178048-3eba3db4-e5be-4617-9bfe-2cb36cebaafc.png" alt="00341-950170121"></td>
</tr>
</tbody>
</table>
<p>Small picture is rendered at whatever resolution you set using width/height sliders.
Large picture’s dimensions are controlled by three sliders: “Scale by” multiplier (Hires upscale), “Resize width to” and/or “Resize height to” (Hires resize).</p>
<ul>
<li>If “Resize width to” and “Resize height to” are 0, “Scale by” is used.</li>
<li>If “Resize width to” is 0, “Resize height to” is calculated from width and height.</li>
<li>If “Resize height to” is 0, “Resize width to” is calculated from width and height.</li>
<li>If both “Resize width to” and “Resize height to” are non-zero, image is upscaled to be at least those dimensions, and some parts are cropped.</li>
</ul>
<h2>Upscalers</h2>
<p>A dropdown allows you to to select the kind of upscaler to use for resizing the image. In addition to all upscalers you have available on extras tab, there is an option to upscale a latent space image, which is what stable diffusion works with internally - for a 3x512x512 RGB image, its latent space representation would be 4x64x64. To see what each latent space upscaler does, you can set Denoising strength to 0 and Hires steps to 1 - you’ll get a very good approximation of what stable diffusion would be working with on upscaled image.</p>
<p>Below are examples of how different latent upscale modes look.</p>
<table>
<thead>
<tr>
<th>Original</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="https://user-images.githubusercontent.com/20920490/210657893-0660c637-9f26-405e-83c9-3030e45fd5b0.png" alt="00084-2395363541"></td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th>Latent, Latent (antialiased)</th>
<th>Latent (bicubic), Latent (bicubic, antialiased)</th>
<th>Latent (nearest)</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="https://user-images.githubusercontent.com/20920490/210658048-d90ae87d-4534-4ca4-878b-9aaa4f43f901.png" alt="00071-2395363541"></td>
<td><img src="https://user-images.githubusercontent.com/20920490/210658501-c6a64c58-9343-470a-9f0b-6ae76c806725.png" alt="00073-2395363541"></td>
<td><img src="https://user-images.githubusercontent.com/20920490/210658607-ac5b5f30-af6a-4158-b968-9d1fdd6faf50.png" alt="00077-2395363541"></td>
</tr>
</tbody>
</table>
<p>Antialiased variations were PRd in by a contributor and seem to be the same as non-antialiased.</p>
<h1>Composable Diffusion</h1>
<p>A method to allow the combination of multiple prompts.
combine prompts using an uppercase AND</p>
<pre><code>a cat AND a dog
</code></pre>
<p>Supports weights for prompts: <code>a cat :1.2 AND a dog AND a penguin :2.2</code>
The default weight value is 1.
It can be quite useful for combining multiple embeddings to your result: <code>creature_embedding in the woods:0.7 AND arcane_embedding:0.5 AND glitch_embedding:0.2</code></p>
<p>Using a value lower than 0.1 will barely have an effect. <code>a cat AND a dog:0.03</code> will produce basically the same output as <code>a cat</code></p>
<p>This could be handy for generating fine-tuned recursive variations, by continuing to append more prompts to your total. <code>creature_embedding on log AND frog:0.13 AND yellow eyes:0.08</code></p>
<h1>Interrupt</h1>
<p>Press the Interrupt button to stop current processing.</p>
<h1>4GB videocard support</h1>
<p>Optimizations for GPUs with low VRAM. This should make it possible to generate 512x512 images on videocards with 4GB memory.</p>
<p><code>--lowvram</code> is a reimplementation of an optimization idea by <a href="https://github.com/basujindal/stable-diffusion">basujindal</a>.
Model is separated into modules, and only one module is kept in GPU memory; when another module needs to run, the previous is removed from GPU memory. The nature of this optimization makes the processing run slower – about 10 times slower
compared to normal operation on my RTX 3090.</p>
<p><code>--medvram</code> is another optimization that should reduce VRAM usage significantly by not processing conditional and
unconditional denoising in the same batch.</p>
<p>This implementation of optimization does not require any modification to the original Stable Diffusion code.</p>
<h1>Face restoration</h1>
<p>Lets you improve faces in pictures using either <a href="https://github.com/TencentARC/GFPGAN">GFPGAN</a> or <a href="https://github.com/sczhou/CodeFormer">CodeFormer</a>. There is a checkbox in every tab to use face restoration,
and also a separate tab that just allows you to use face restoration on any picture, with a slider that controls how visible
the effect is. You can choose between the two methods in settings.</p>
<table>
<thead>
<tr>
<th>Original</th>
<th>GFPGAN</th>
<th>CodeFormer</th>
</tr>
</thead>
<tbody>
<tr>
<td><img src="images/facefix.png" alt=""></td>
<td><img src="images/facefix-gfpgan.png" alt=""></td>
<td><img src="images/facefix-codeformer.png" alt=""></td>
</tr>
</tbody>
</table>
<h1>Checkpoint Merger</h1>
<p>Guide generously donated by an anonymous benefactor.</p>
<figure><img src="https://user-images.githubusercontent.com/20920490/215274766-7d78df50-bb01-4e7b-84b6-04fed94b92ef.png" alt="1674918832052087"></figure>
<p>Full guide with other info is here: <a href="https://imgur.com/a/VjFi5uM">https://imgur.com/a/VjFi5uM</a></p>
<h1>Saving</h1>
<p>Click the Save button under the output section, and generated images will be saved to a directory specified in settings;
generation parameters will be appended to a csv file in the same directory.</p>
<h1>Loading</h1>
<p>Gradio’s loading graphic has a very negative effect on the processing speed of the neural network.
My RTX 3090 makes images about 10% faster when the tab with gradio is not active. By default, the UI now hides loading progress animation and replaces it with static “Loading…” text, which achieves the same effect. Use the <code>--no-progressbar-hiding</code> commandline option to revert this and show loading animations.</p>
<h1>Caching Models</h1>
<figure><img src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/98228077/aaee8ca8-eb9e-4f22-8b7b-dfce51211e63" alt="image"></figure>
<p>If you want faster swapping between models, increase the counter in settings. Webui will keep models you’ve swapped from in ram.</p>
<p>Make sure you set the appropriate number according to your remaining available ram.</p>
<h1>Prompt validation</h1>
<p>Stable Diffusion has a limit for input text length. If your prompt is too long, you will get a warning in the text output field, showing which parts of your text were truncated and ignored by the model.</p>
<h1>PNG info</h1>
<p>Adds information about generation parameters to PNG as a text chunk. You can view this information later using any software that supports viewing PNG chunk info, for example: <a href="https://www.nayuki.io/page/png-file-chunk-inspector">https://www.nayuki.io/page/png-file-chunk-inspector</a></p>
<h1>Settings</h1>
<p>A tab with settings, allows you to use UI to edit more than half of parameters that previously were commandline. Settings are saved to <code>config.js</code>. Settings that remain as commandline options are ones that are required at startup.</p>
<h1>Filenames format</h1>
<p>The <code>Images filename pattern</code> field in the Settings tab allows customization of generated txt2img and img2img images filenames. This pattern defines the generation parameters you want to include in filenames and their order. The supported tags are:</p>
<p><code>[seed], [steps], [cfg], [width], [height], [styles], [sampler], [model_hash], [model_name], [date], [datetime], [job_timestamp], [prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [prompt_words], [batch_number], [generation_number], [hasprompt], [clip_skip], [denoising]</code></p>
<p>This list will evolve though, with new additions. You can get an up-to-date list of supported tags by hovering your mouse over the “Images filename pattern” label in the UI.</p>
<p>Example of a pattern: <code>[seed]-[steps]-[cfg]-[sampler]-[prompt_spaces]</code></p>
<p>Note about “prompt” tags: <code>[prompt]</code> will add underscores between the prompt words, while <code>[prompt_spaces]</code> will keep the prompt intact (easier to copy/paste into the UI again). <code>[prompt_words]</code> is a simplified and cleaned-up version of your prompt, already used to generate subdirectories names, with only the words of your prompt (no punctuation).</p>
<p>If you leave this field empty, the default pattern will be applied (<code>[seed]-[prompt_spaces]</code>).</p>
<p>Please note that the tags are actually replaced inside the pattern. It means that you can also add non-tags words to this pattern, to make filenames even more explicit. For example: <code>s=[seed],p=[prompt_spaces]</code></p>
<h1>User scripts</h1>
<p>If the program is launched with <code>--allow-code</code> option, an extra text input field for script code is available at the bottom of the page, under Scripts -&gt; Custom code. It allows you to input python code that will do the work with the image.</p>
<p>In code, access parameters from web UI using the <code>p</code> variable, and provide outputs for web UI using the <code>display(images, seed, info)</code> function. All globals from the script are also accessible.</p>
<p>A simple script that would just process the image and output it normally:</p>
<pre><code class="language-python"><span class="hljs-keyword">import</span> modules.processing
processed = modules.processing.process_images(p)
print(<span class="hljs-string">"Seed was: "</span> + str(processed.seed))
display(processed.images, processed.seed, processed.info)
</code></pre>
<h1>UI config</h1>
<p>You can change parameters for UI elements in <code>ui-config.json</code>, it is created automatically when the program first starts. Some options:</p>
<ul>
<li>radio groups: default selection</li>
<li>sliders: default value, min, max, step</li>
<li>checkboxes: checked state</li>
<li>text and number inputs: default values</li>
</ul>
<p>Checkboxes that would usually expand a hidden section will not initially do so when set as UI config entries.</p>
<h1>ESRGAN</h1>
<p>It’s possible to use ESRGAN models on the Extras tab, as well as in SD upscale. <a href="https://arxiv.org/abs/1809.00219">Paper</a> here.</p>
<p>To use ESRGAN models, put them into ESRGAN directory in the same location as <a href="http://webui.py">webui.py</a>.
A file will be loaded as a model if it has .pth extension. Grab models from the <a href="https://upscale.wiki/wiki/Model_Database">Model Database</a>.</p>
<p>Not all models from the database are supported. All 2x models are most likely not supported.</p>
<h1>img2img alternative test</h1>
<p>Deconstructs an input image using a reverse of the Euler diffuser to create the noise pattern used to construct the input prompt.</p>
<p>As an example, you can use this image. Select the img2img alternative test from the <em>scripts</em> section.</p>
<figure><img src="https://user-images.githubusercontent.com/1633844/191771623-6293ec7b-c1c0-425c-9fe9-9d03313761fb.png" alt="alt_src"></figure>
<p>Adjust your settings for the reconstruction process:</p>
<ul>
<li>Use a brief description of the scene: “A smiling woman with brown hair.” Describing features you want to change helps. Set this as your starting prompt, and ‘Original Input Prompt’ in the script settings.</li>
<li>You <em>MUST</em> use the Euler sampling method, as this script is built on it.</li>
<li>Sampling steps: 50-60. This MUCH match the decode steps value in the script, or you’ll have a bad time. Use 50 for this demo.</li>
<li>CFG scale: 2 or lower. For this demo, use 1.8. (Hint, you can edit ui-config.json to change “img2img/CFG Scale/step” to .1 instead of .5.</li>
<li>Denoising strength - this <em>does</em> matter, contrary to what the old docs said. Set it to 1.</li>
<li>Width/Height - Use the width/height of the input image.</li>
<li>Seed…you can ignore this. The reverse Euler is generating the noise for the image now.</li>
<li>Decode cfg scale - Somewhere lower than 1 is the sweet spot. For the demo, use 1.</li>
<li>Decode steps - as mentioned above, this should match your sampling steps. 50 for the demo, consider increasing to 60 for more detailed images.</li>
</ul>
<p>Once all of the above are dialed in, you should be able to hit “Generate” and get back a result that is a <em>very</em> close approximation to the original.</p>
<p>After validating that the script is re-generating the source photo with a good degree of accuracy, you can try to change the details of the prompt. Larger variations of the original will likely result in an image with an entirely different composition than the source.</p>
<p>Example outputs using the above settings and prompts below (Red hair/pony not pictured)</p>
<figure><img src="https://user-images.githubusercontent.com/1633844/191776138-c77bf232-1981-47c9-a4d3-ae155631f5c8.png" alt="demo"></figure>
<p>“A smiling woman with blue hair.” Works.
“A frowning woman with brown hair.” Works.
“A frowning woman with red hair.” Works.
“A frowning woman with red hair riding a horse.” Seems to replace the woman entirely, and now we have a ginger pony.</p>
<h1>user.css</h1>
<p>Create a file named <code>user.css</code> near <code>webui.py</code> and put custom CSS code into it. For example, this makes the gallery taller:</p>
<pre><code class="language-css"><span class="hljs-selector-id">#txt2img_gallery</span>, <span class="hljs-selector-id">#img2img_gallery</span>{
<span class="hljs-attribute">min-height</span>: <span class="hljs-number">768px</span>;
}
</code></pre>
<p>A useful tip is you can append <code>/?__theme=dark</code> to your webui url to enable a built in <em>dark theme</em>
<br>e.g. (<code>http://127.0.0.1:7860/?__theme=dark</code>)</p>
<p>Alternatively, you can add the <code>--theme=dark</code> to the <code>set COMMANDLINE_ARGS=</code> in <code>webui-user.bat</code><br>
e.g. <code>set COMMANDLINE_ARGS=--theme=dark</code></p>
<figure><img src="https://user-images.githubusercontent.com/39339941/197560013-51e535d6-7cef-4946-ab6b-747e1c76b007.png" alt="chrome_O1kvfKs1es"></figure>
<h1>notification.mp3</h1>
<p>If an audio file named <code>notification.mp3</code> is present in webui’s root folder, it will be played when the generation process completes.</p>
<p>As a source of inspiration:</p>
<ul>
<li><a href="https://pixabay.com/sound-effects/search/ding/?duration=0-30">https://pixabay.com/sound-effects/search/ding/?duration=0-30</a></li>
<li><a href="https://pixabay.com/sound-effects/search/notification/?duration=0-30">https://pixabay.com/sound-effects/search/notification/?duration=0-30</a></li>
</ul>
<h1>Tweaks</h1>
<h2>Clip Skip</h2>
<p>This is a slider in settings, and it controls how early the processing of prompt by CLIP network should be stopped.</p>
<p>A more detailed explanation:</p>
<p>CLIP is a very advanced neural network that transforms your prompt text into a numerical representation. Neural networks work very well with this numerical representation and that’s why devs of SD chose CLIP as one of 3 models involved in stable diffusion’s method of producing images. As CLIP is a neural network, it means that it has a lot of layers. Your prompt is digitized in a simple way, and then fed through layers. You get numerical representation of the prompt after the 1st layer, you feed that into the second layer, you feed the result of that into third, etc, until you get to the last layer, and that’s the output of CLIP that is used in stable diffusion. This is the slider value of 1. But you can stop early, and use the output of the next to last layer - that’s slider value of 2. The earlier you stop, the less layers of neural network have worked on the prompt.</p>
<p>Some models were trained with this kind of tweak, so setting this value helps produce better results on those models.</p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
This is a feature showcase page for [Stable Diffusion web UI](https://github.com/AUTOMATIC1111/stable-diffusion-webui).
All examples are non-cherrypicked unless specified otherwise.
# SD-XL
## SD-XL BASE
[[PR]](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/11757) | [[Stability-AI Github]](https://github.com/Stability-AI/generative-models)
### Info
This is a model designed for generating quality 1024×1024-sized images. It is not meant to generate good pictures at 512×512.
It's tested to produce same (or very close) images as Stability-AI's repo (need to set Random number generator source = CPU in settings)
![img](https://user-images.githubusercontent.com/20920490/253218112-c7c02951-0c1c-47f8-98a4-4fbdcb028712.png)
```
- textual inversion should not work, embeddings need to be created specifically for SDXL.
- train tab will not work.
- DDIM, PLMS, UniPC samplers do not work for SDXL
```
```
- --lowvram, --medvram works
- attention optimizations work
- SDXL Loras work
- works at minimum 4gb gpu (30XX)
```
>NOTE: Initial loading of these models require those with 24gb cpu memory (RAM) and under to setup a large pagefile. This may change in the future.
### Downloading:
1. [sd_xl_base_1.0](https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/blob/main/sd_xl_base_1.0.safetensors)
>The base model's VAE has problems running in fp16. [madebyollin](https://github.com/madebyollin) has kindly trained a vae to mostly remedy this:
2. [sdxl-vae-fp16-fix](https://huggingface.co/madebyollin/sdxl-vae-fp16-fix/blob/main/sdxl_vae.safetensors)
(Please use both of these to avoid slow speeds, and GPU out-of-vram issues.)
# SD2 Variation Models
[PR](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8958), ([more info.](https://github.com/Stability-AI/stablediffusion/blob/main/doc/UNCLIP.MD))
support for [stable-diffusion-2-1-unclip](https://huggingface.co/stabilityai/stable-diffusion-2-1-unclip) checkpoints that are used for generating image variations.
It works in the same way as the current support for the SD2.0 depth model, in that you run it from the img2img tab, it extracts information from the input image (in this case, CLIP or OpenCLIP embeddings), and feeds those into the model in addition to the text prompt. Normally you would do this with denoising strength set to 1.0, since you don't actually want the normal img2img behaviour to have any influence on the generated image.
![image](https://user-images.githubusercontent.com/98228077/231526001-adef8278-4670-4a78-bd95-04ec51c01b40.png)
# InstructPix2Pix
[Website](https://www.timothybrooks.com/instruct-pix2pix). [Checkpoint](http://instruct-pix2pix.eecs.berkeley.edu/instruct-pix2pix-00-22000.ckpt). The checkpoint is fully supported in img2img tab. No additional actions are required. Previously an [extension](https://github.com/Klace/stable-diffusion-webui-instruct-pix2pix) by a contributor was required to generate pictures: it's no longer required, but should still work. Most of img2img implementation is by the same person.
To reproduce results of the original repo, use denoising of 1.0, Euler a sampler, and edit the config in `configs/instruct-pix2pix.yaml` to say:
```
use_ema: true
load_ema: true
```
instead of:
```
use_ema: false
```
![firefox_Yj09cbmDZ1](https://user-images.githubusercontent.com/20920490/216767957-3c6bf787-5b79-45df-aa9e-ce86b1d9e40f.png)
# Extra networks
A single button with a picture of a card on it. It unifies multiple extra ways to extend your generation into one UI.
Find it next to the big Generate button:
![firefox_QOnhgmmSi5](https://user-images.githubusercontent.com/20920490/214776880-2fe558e1-6f63-432f-b0c6-675e1d1a0822.png)
Extra networks provides a set of cards, each corresponding to a file with a part of model you either train or obtain from somewhere. Clicking the card adds the model to prompt, where it will affect generation.
| Extra network | Directory | File types | How to use in prompt |
|-------------------|---------------|-----------------------------------|--------------------------|
| Textual Inversion | `embeddings` | `*.pt`, images | embedding's filename |
| LoRA | `models/Lora` | `*.pt`, `*.safetensors` | `<lora:filename:multiplier>` |
| Hypernetworks | `models/hypernetworks` | `*.pt`, `*.ckpt`, `*.safetensors` | `<hypernet:filename:multiplier>` |
## Textual Inversion
A method to fine tune weights for a token in CLIP, the language model used by Stable Diffusion, from summer 2021. [Author's site](https://textual-inversion.github.io/). Long explanation: [Textual Inversion](Textual-Inversion)
## LoRA
A method to fine tune weights for CLIP and Unet, the language model and the actual image de-noiser used by Stable Diffusion, published in 2021. [Paper](https://arxiv.org/abs/2106.09685). A good way to train LoRA is to use [kohya-ss](https://github.com/kohya-ss/sd-scripts).
Support for LoRA is built-in into the Web UI, but there is an [extension](https://github.com/kohya-ss/sd-webui-additional-networks) with original implementation by kohya-ss.
Currently, LoRA networks for Stable Diffusion 2.0+ models are not supported by Web UI.
LoRA is added to the prompt by putting the following text into any location: `<lora:filename:multiplier>`, where `filename` is the name of file with LoRA on disk, excluding extension, and `multiplier` is a number, generally from 0 to 1, that lets you choose how strongly LoRA will affect the output. LoRA cannot be added to the negative prompt.
The text for adding LoRA to the prompt, `<lora:filename:multiplier>`, is only used to enable LoRA, and is erased from prompt afterwards, so you can't do tricks with prompt editing like `[<lora:one:1.0>|<lora:two:1.0>]`. A batch with multiple different prompts will only use the LoRA from the first prompt.
## Hypernetworks
A method to fine tune weights for CLIP and Unet, the language model and the actual image de-noiser used by Stable Diffusion, generously donated to the world by our friends at Novel AI in autumn 2022. Works in the same way as LoRA except for sharing weights for some layers. Multiplier can be used to choose how strongly the hypernetwork will affect the output.
Same rules for adding hypernetworks to the prompt apply as for LoRA: `<hypernet:filename:multiplier>`.
# Alt-Diffusion
A model trained to accept inputs in different languages.
[More info](https://arxiv.org/abs/2211.06679).
[PR](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5238).
- [Download](https://huggingface.co/webui/AltDiffusion-m9/tree/main) the checkpoint from huggingface. Click the down arrow to download.
- Put the file into `models/Stable-Diffusion`
<details><summary>Notes: (Click to expand:)</summary>
Mechanically, attention/emphasis mechanism is supported, but seems to have much less effect, probably due to how Alt-Diffusion is implemented.
Clip skip is not supported, the setting is ignored.
- It is recommended to run with `--xformers.` Adding additional memory-saving flags such as `--xformers --medvram` does not work.
</details>
# Stable Diffusion 2.0
1. Download your checkpoint file from huggingface. Click the down arrow to download.
2. Put the file into `models/Stable-Diffusion`
- 768 (2.0) - ([model](https://huggingface.co/stabilityai/stable-diffusion-2/blob/main/768-v-ema.safetensors))
- 768 (2.1) - ([model](https://huggingface.co/webui/stable-diffusion-2-1/tree/main))
- 512 (2.0) - ([model](https://huggingface.co/stabilityai/stable-diffusion-2-base/blob/main/512-base-ema.safetensors))
<details><summary>Notes: (Click to expand:)</summary>
If 2.0 or 2.1 is generating black images, enable full precision with `--no-half` or try using the `--xformers` optimization.
_**Note:**_ SD 2.0 and 2.1 are more sensitive to FP16 numerical instability (as noted by themselves [here](https://github.com/Stability-AI/stablediffusion/commit/c12d960d1ee4f9134c2516862ef991ec52d3f59e)) due to their new cross attention module.
On fp16: [comment](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5503#issuecomment-1341495770) to enable, in webui-user.bat:
@echo off
set PYTHON=
set GIT=
set VENV_DIR=
set COMMANDLINE_ARGS=your command line options
set STABLE_DIFFUSION_COMMIT_HASH="c12d960d1ee4f9134c2516862ef991ec52d3f59e"
set ATTN_PRECISION=fp16
call webui.bat
</details>
## Depth Guided Model
The depth-guided model will only work in img2img tab.
[More info](https://github.com/Stability-AI/stablediffusion#depth-conditional-stable-diffusion). [PR](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5542).
- 512 depth (2.0) - ([model+yaml](https://huggingface.co/webui/stable-diffusion-2-depth/tree/main)) - `.safetensors`
- 512 depth (2.0) - ([model](https://huggingface.co/stabilityai/stable-diffusion-2-depth/tree/main), [yaml](https://raw.githubusercontent.com/Stability-AI/stablediffusion/main/configs/stable-diffusion/v2-midas-inference.yaml))
## Inpainting Model SD2
Model specifically designed for inpainting trained on SD 2.0 512 base.
- 512 inpainting (2.0) - ([model+yaml](https://huggingface.co/webui/stable-diffusion-2-inpainting/tree/main)) - `.safetensors`
`inpainting_mask_weight` or inpainting conditioning mask strength works on this too.
# Outpainting
Outpainting extends the original image and inpaints the created empty space.
Example:
| Original | Outpainting | Outpainting again |
|------------------------------|------------------------------|------------------------------|
| ![](images/outpainting-1.png) | ![](images/outpainting-2.png) | ![](images/outpainting-3.png) |
Original image by Anonymous user from 4chan. Thank you, Anonymous user.
You can find the feature in the img2img tab at the bottom, under Script -> Poor man's outpainting.
Outpainting, unlike normal image generation, seems to profit very much from large step count. A recipe for a good outpainting is a good prompt that matches the picture, sliders for denoising and CFG scale set to max, and step count of 50 to 100 with Euler ancestral or DPM2 ancestral samplers.
| 81 steps, Euler A | 30 steps, Euler A | 10 steps, Euler A | 80 steps, Euler A |
|-------------------------------------|---------------------------------------|--------------------------------------|-------------------------------------|
| ![](images/inpainting-81-euler-a.png) | ![](images/inpainting-30-euler-a.png) | ![](images/inpainting-10-euler-a.png) | ![](images/inpainting-80-dpm2-a.png) |
# Inpainting
In img2img tab, draw a mask over a part of the image, and that part will be in-painted.
![](images/inpainting.png)
Options for inpainting:
- draw a mask yourself in the web editor
- erase a part of the picture in an external editor and upload a transparent picture. Any even slightly transparent areas will become part of the mask. Be aware that [some editors](https://docs.krita.org/en/reference_manual/layers_and_masks/split_alpha.html#how-to-save-a-png-texture-and-keep-color-values-in-fully-transparent-areas) save completely transparent areas as black by default.
- change mode (to the bottom right of the picture) to "Upload mask" and choose a separate black and white image for the mask (white=inpaint).
## Inpainting model
RunwayML has trained an additional model specifically designed for inpainting. This model accepts additional inputs - the initial image without noise plus the mask - and seems to be much better at the job.
Download and extra info for the model is here: https://github.com/runwayml/stable-diffusion#inpainting-with-stable-diffusion
To use the model, you must rename the checkpoint so that its filename ends in `inpainting.ckpt`, for example, `1.5-inpainting.ckpt`.
After that just select the checkpoint as you'd usually select any checkpoint and you're good to go.
## Masked content
The masked content field determines content is placed to put into the masked regions before they are inpainted. This does not represent final output, it's only a look at what's going on mid-process.
| mask | fill | original | latent noise | latent nothing |
|-------------------------------------------------|-------------------------------------------------|-----------------------------------------------------|---------------------------------------------------------|-----------------------------------------------------------|
| ![](images/inpainting-initial-content-mask.png) | ![](images/inpainting-initial-content-fill.png) | ![](images/inpainting-initial-content-original.png) | ![](images/inpainting-initial-content-latent-noise.png) | ![](images/inpainting-initial-content-latent-nothing.png) |
## Inpaint area
Normally, inpainting resizes the image to the target resolution specified in the UI. With `Inpaint area: Only masked` enabled, only the masked region is resized, and after processing it is pasted back to the original picture.
This allows you to work with large pictures and render the inpainted object at a much larger resolution.
| Input | Inpaint area: Whole picture | Inpaint area: Only masked |
|-------------------------------------|----------------------------------|-----------------------------------|
| ![](images/inpaint-whole-mask.png) | ![](images/inpaint-whole-no.png) | ![](images/inpaint-whole-yes.png) |
## Masking mode
There are two options for masked mode:
- Inpaint masked - the region under the mask is inpainted
- Inpaint not masked - under the mask is unchanged, everything else is inpainted
## Alpha mask
| Input | Output |
|------------------------------|-------------------------------|
| ![](images/inpaint-mask.png) | ![](images/inpaint-mask2.png) |
## Color Sketch
Basic coloring tool for the img2img tab. Chromium-based browsers support a dropper tool.
![color-sketch_NewUI](https://user-images.githubusercontent.com/98228077/214700734-2260f6f0-0fdf-46db-a2c6-71e5ec60e43b.png)
(this is on firefox)
# Prompt matrix
Separate multiple prompts using the `|` character, and the system will produce an image for every combination of them.
For example, if you use `a busy city street in a modern city|illustration|cinematic lighting` prompt, there are four combinations possible (first part of the prompt is always kept):
- `a busy city street in a modern city`
- `a busy city street in a modern city, illustration`
- `a busy city street in a modern city, cinematic lighting`
- `a busy city street in a modern city, illustration, cinematic lighting`
Four images will be produced, in this order, all with the same seed and each with a corresponding prompt:
![](images/prompt-matrix.png)
Another example, this time with 5 prompts and 16 variations:
![](images/prompt_matrix.jpg)
You can find the feature at the bottom, under Script -> Prompt matrix.
# Stable Diffusion upscale
Upscale image using RealESRGAN/ESRGAN and then go through tiles of the result, improving them with img2img.
It also has an option to let you do the upscaling part yourself in an external program, and just go through tiles with img2img.
Original idea by: https://github.com/jquesnelle/txt2imghd. This is an independent implementation.
To use this feature, select `SD upscale from the scripts dropdown selection` (img2img tab).
![chrome_dl8hcMPYcx](https://user-images.githubusercontent.com/39339941/193300082-be3b8864-3c28-44b7-bb75-f893f92269b6.png)
The input image will be upscaled to twice the original
width and height, and UI's width and height sliders specify the size of individual tiles. Because of overlap, the size of the tile can be very important: 512x512 image needs nine 512x512 tiles (because of overlap), but only
four 640x640 tiles.
Recommended parameters for upscaling:
- Sampling method: Euler a
- Denoising strength: 0.2, can go up to 0.4 if you feel adventurous
- A larger denoising strength is problematic due to the fact SD upscale works in tiles, as the diffusion process is then unable to give attention to the image as a whole.
| Original | RealESRGAN | Topaz Gigapixel | SD upscale |
|-------------------------------------------|---------------------------------------------|---------------------------------------------------------|---------------------------------------------|
| ![](images/sd-upscale-robot-original.png) | ![](images/sd-upscale-robot-realesrgan.png) | ![](images/sd-upscale-robot-esrgan-topaz-gigapixel.png) | ![](images/sd-upscale-robot-sd-upscale.png) |
| ![](images/sd-upscale-castle-original.png) | ![](images/sd-upscale-castle-realesrgan.png) | ![](images/sd-upscale-castle-esrgan-topaz-gigapixel.png) | ![](images/sd-upscale-castle-sd-upscale.png) |
| ![](images/sd-upscale-city-original.png) | ![](images/sd-upscale-city-realesrgan.png) | ![](images/sd-upscale-city-esrgan-topaz-gigapixel.png) | ![](images/sd-upscale-city-sd-upscale.png) |
# Infinite prompt length
Typing past standard 75 tokens that Stable Diffusion usually accepts increases prompt size limit from 75 to 150. Typing past that increases prompt size further. This is done by breaking the prompt into chunks of 75 tokens, processing each independently using CLIP's Transformers neural network, and then concatenating the result before feeding into the next component of stable diffusion, the Unet.
For example, a prompt with 120 tokens would be separated into two chunks: first with 75 tokens, second with 45. Both would be padded to 75 tokens and extended with start/end tokens to 77. After passing those two chunks though CLIP, we'll have two tensors with shape of `(1, 77, 768)`. Concatenating those results in `(1, 154, 768)` tensor that is then passed to Unet without issue.
## BREAK keyword
Adding a `BREAK` keyword (must be uppercase) fills the current chunks with padding characters. Adding more text after `BREAK` text will start a new chunk.
# Attention/emphasis
Using `()` in the prompt increases the model's attention to enclosed words, and `[]` decreases it. You can combine multiple modifiers:
![](images/attention-3.jpg)
Cheat sheet:
- `a (word)` - increase attention to `word` by a factor of 1.1
- `a ((word))` - increase attention to `word` by a factor of 1.21 (= 1.1 * 1.1)
- `a [word]` - decrease attention to `word` by a factor of 1.1
- `a (word:1.5)` - increase attention to `word` by a factor of 1.5
- `a (word:0.25)` - decrease attention to `word` by a factor of 4 (= 1 / 0.25)
- `a \(word\)` - use literal `()` characters in prompt
With `()`, a weight can be specified like this: `(text:1.4)`. If the weight is not specified, it is assumed to be 1.1. Specifying weight only works with `()` not with `[]`.
If you want to use any of the literal `()[]` characters in the prompt, use the backslash to escape them: `anime_\(character\)`.
On 2022-09-29, a new implementation was added that supports escape characters and numerical weights. A downside of the new implementation is that the old one was not perfect and sometimes ate characters: "a (((farm))), daytime", for example, would become "a farm daytime" without the comma. This behavior is not shared by the new implementation which preserves all text correctly, and this means that your saved seeds may produce different pictures. For now, there is an option in settings to use the old implementation.
NAI uses my implementation from before 2022-09-29, except they have 1.05 as the multiplier and use `{}` instead of `()`. So the conversion applies:
- their `{word}` = our `(word:1.05)`
- their `{{word}}` = our `(word:1.1025)`
- their `[word]` = our `(word:0.952)` (0.952 = 1/1.05)
- their `[[word]]` = our `(word:0.907)` (0.907 = 1/1.05/1.05)
# Loopback
Selecting the loopback script in img2img allows you to automatically feed output image as input for the next batch. Equivalent to saving output image and replacing the input image with it. Batch count setting controls how many iterations of
this you get.
Usually, when doing this, you would choose one of many images for the next iteration yourself, so the usefulness
of this feature may be questionable, but I've managed to get some very nice outputs with it that I wasn't able
to get otherwise.
Example: (cherrypicked result)
![](images/loopback.jpg)
Original image by Anonymous user from 4chan. Thank you, Anonymous user.
# X/Y/Z plot
Creates multiple grids of images with varying parameters. X and Y are used as the rows and columns, while the Z grid is used as a batch dimension.
![xyz-grid](https://user-images.githubusercontent.com/23466035/215288902-d8e13152-ba22-443f-9cf9-44108eba36fb.png)
Select which parameters should be shared by rows, columns and batch by using X type, Y type and Z Type fields, and input those parameters separated by comma into X/Y/Z values fields. For integer, and floating point numbers, and ranges are supported. Examples:
- Simple ranges:
- `1-5` = 1, 2, 3, 4, 5
- Ranges with increment in bracket:
- `1-5 (+2)` = 1, 3, 5
- `10-5 (-3)` = 10, 7
- `1-3 (+0.5)` = 1, 1.5, 2, 2.5, 3
- Ranges with the count in square brackets:
- `1-10 [5]` = 1, 3, 5, 7, 10
- `0.0-1.0 [6]` = 0.0, 0.2, 0.4, 0.6, 0.8, 1.0
### Prompt S/R
Prompt S/R is one of more difficult to understand modes of operation for X/Y Plot. S/R stands for search/replace, and that's what it does - you input a list of words or phrases, it takes the first from the list and treats it as keyword, and replaces all instances of that keyword with other entries from the list.
For example, with prompt `a man holding an apple, 8k clean`, and Prompt S/R `an apple, a watermelon, a gun` you will get three prompts:
- `a man holding an apple, 8k clean`
- `a man holding a watermelon, 8k clean`
- `a man holding a gun, 8k clean`
The list uses the same syntax as a line in a CSV file, so if you want to include commas into your entries you have to put text in quotes and make sure there is no space between quotes and separating commas:
- `darkness, light, green, heat` - 4 items - `darkness`, `light`, `green`, `heat`
- `darkness, "light, green", heat` - WRONG - 4 items - `darkness`, `"light`, `green"`, `heat`
- `darkness,"light, green",heat` - RIGHT - 3 items - `darkness`, `light, green`, `heat`
# Prompts from file or textbox
With this script it is possible to create a list of jobs which will be executed sequentially.
Example input:
```
--prompt "photo of sunset"
--prompt "photo of sunset" --negative_prompt "orange, pink, red, sea, water, lake" --width 1024 --height 768 --sampler_name "DPM++ 2M Karras" --steps 10 --batch_size 2 --cfg_scale 3 --seed 9
--prompt "photo of winter mountains" --steps 7 --sampler_name "DDIM"
--prompt "photo of winter mountains" --width 1024
```
Example output:
![image](https://user-images.githubusercontent.com/32306715/216720287-c523b900-916b-4f39-985c-4107d4b5460d.png)
Following parameters are supported:
```
"sd_model", "outpath_samples", "outpath_grids", "prompt_for_display", "prompt", "negative_prompt", "styles", "seed", "subseed_strength", "subseed",
"seed_resize_from_h", "seed_resize_from_w", "sampler_index", "sampler_name", "batch_size", "n_iter", "steps", "cfg_scale", "width", "height",
"restore_faces", "tiling", "do_not_save_samples", "do_not_save_grid"
```
# Resizing
There are three options for resizing input images in img2img mode:
- Just resize - simply resizes the source image to the target resolution, resulting in an incorrect aspect ratio
- Crop and resize - resize source image preserving aspect ratio so that entirety of target resolution is occupied by it, and crop parts that stick out
- Resize and fill - resize source image preserving aspect ratio so that it entirely fits target resolution, and fill empty space by rows/columns from the source image
Example:
![](images/resizing.jpg)
# Sampling method selection
Pick out of multiple sampling methods for txt2img:
![](images/sampling.jpg)
# Seed resize
This function allows you to generate images from known seeds at different resolutions. Normally, when you change resolution,
the image changes entirely, even if you keep all other parameters including seed. With seed resizing you specify the resolution of the original image, and the model will very likely produce something looking very similar to it, even at a different resolution.
In the example below, the leftmost picture is 512x512, and others are produced with exact same parameters but with larger vertical
resolution.
| Info | Image |
|---------------------------|-------------------------------|
| Seed resize not enabled | ![](images/seed-noresize.png) |
| Seed resized from 512x512 | ![](images/seed-resize.png) |
Ancestral samplers are a little worse at this than the rest.
You can find this feature by clicking the "Extra" checkbox near the seed.
# Variations
A Variation strength slider and Variation seed field allow you to specify how much the existing picture should be altered to look like a different one. At maximum strength, you will get pictures with the Variation seed, at minimum - pictures with the original Seed (except for when using ancestral samplers).
![](images/seed-variations.jpg)
You can find this feature by clicking the "Extra" checkbox near the seed.
# Styles
Press the "Save prompt as style" button to write your current prompt to styles.csv, the file with a collection of styles. A dropbox to the right of the prompt will allow you to choose any style out of previously saved, and automatically append it to your input.
To delete a style, manually delete it from styles.csv and restart the program.
if you use the special string `{prompt}` in your style, it will substitute anything currently in the prompt into that position, rather than appending the style to your prompt.
# Negative prompt
Allows you to use another prompt of things the model should avoid when generating the picture. This works by using the negative prompt for unconditional conditioning in the sampling process instead of an empty string.
Advanced explanation: [Negative prompt](Negative-prompt)
| Original | Negative: purple | Negative: tentacles |
|-------------------------------|---------------------------------|------------------------------------|
| ![](images/negative-base.png) | ![](images/negative-purple.png) | ![](images/negative-tentacles.png) |
# CLIP interrogator
Originally by: https://github.com/pharmapsychotic/clip-interrogator
CLIP interrogator allows you to retrieve the prompt from an image. The prompt won't allow you to reproduce this exact image (and sometimes it won't even be close), but it can be a good start.
![](images/CLIP-interrogate.png)
The first time you run CLIP interrogator it will download a few gigabytes of models.
CLIP interrogator has two parts: one is a BLIP model that creates a text description from the picture.
Other is a CLIP model that will pick few lines relevant to the picture out of a list. By default, there is only one list - a list of artists (from `artists.csv`). You can add more lists by doing the following:
- create `interrogate` directory in the same place as webui
- put text files in it with a relevant description on each line
For example of what text files to use, see https://github.com/pharmapsychotic/clip-interrogator/tree/main/clip_interrogator/data.
In fact, you can just take files from there and use them - just skip artists.txt because you already have a list of artists in `artists.csv` (or use that too, who's going to stop you). Each file adds one line of text to the final description.
If you add ".top3." to filename, for example, `flavors.top3.txt`, the three most relevant lines from this file will be added to the prompt (other numbers also work).
There are settings relevant to this feature:
- `Interrogate: keep models in VRAM` - do not unload Interrogate models from memory after using them. For users with a lot of VRAM.
- `Interrogate: use artists from artists.csv` - adds artist from `artists.csv` when interrogating. Can be useful to disable when you have your list of artists in `interrogate` directory
- `Interrogate: num_beams for BLIP` - parameter that affects how detailed descriptions from BLIP model are (the first part of generated prompt)
- `Interrogate: minimum description length` - minimum length for BLIP model's text
- `Interrogate: maximum descripton length` - maximum length for BLIP model's text
- `Interrogate: maximum number of lines in text file` - interrogator will only consider this many first lines in a file. Set to 0, the default is 1500, which is about as much as a 4GB videocard can handle.
# Prompt editing
![xy_grid-0022-646033397](https://user-images.githubusercontent.com/20920490/190426933-9748708b-6db0-4cb0-8cb9-3285053916b8.jpg)
Prompt editing allows you to start sampling one picture, but in the middle swap to something else. The base syntax for this is:
```
[from:to:when]
```
Where `from` and `to` are arbitrary texts, and `when` is a number that defines how late in the sampling cycle should the switch be made. The later it is, the less power the model has to draw the `to` text in place of `from` text. If `when` is a number between 0 and 1, it's a fraction of the number of steps after which to make the switch. If it's an integer greater than zero, it's just the step after which to make the switch.
Nesting one prompt editing inside another does work.
Additionally:
- `[to:when]` - adds `to` to the prompt after a fixed number of steps (`when`)
- `[from::when]` - removes `from` from the prompt after a fixed number of steps (`when`)
Example:
`a [fantasy:cyberpunk:16] landscape`
- At start, the model will be drawing `a fantasy landscape`.
- After step 16, it will switch to drawing `a cyberpunk landscape`, continuing from where it stopped with fantasy.
Here's a more complex example with multiple edits:
`fantasy landscape with a [mountain:lake:0.25] and [an oak:a christmas tree:0.75][ in foreground::0.6][ in background:0.25] [shoddy:masterful:0.5]` (sampler has 100 steps)
- at start, `fantasy landscape with a mountain and an oak in foreground shoddy`
- after step 25, `fantasy landscape with a lake and an oak in foreground in background shoddy`
- after step 50, `fantasy landscape with a lake and an oak in foreground in background masterful`
- after step 60, `fantasy landscape with a lake and an oak in background masterful`
- after step 75, `fantasy landscape with a lake and a christmas tree in background masterful`
The picture at the top was made with the prompt:
`Official portrait of a smiling world war ii general, [male:female:0.99], cheerful, happy, detailed face, 20th century, highly detailed, cinematic lighting, digital art painting by Greg Rutkowski`
And the number 0.99 is replaced with whatever you see in column labels on the image.
The last column in the picture is [male:female:0.0], which essentially means that you are asking the model to draw a female from the start, without starting with a male general, and that is why it looks so different from others.
**Note**: This syntax does _not_ work with extra networks, such as LoRA. See [this discussion post](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/10897#discussioncomment-6055184) for details. For similar functionality, see the [sd-webui-loractrl extension](https://github.com/cheald/sd-webui-loractl).
## Alternating Words
Convenient Syntax for swapping every other step.
[cow|horse] in a field
On step 1, prompt is "cow in a field." Step 2 is "horse in a field." Step 3 is "cow in a field" and so on.
![Alternating Words](https://user-images.githubusercontent.com/39339941/197556926-49ceb72b-daf3-4208-86f3-c2e7e9cd775a.gif)
See more advanced example below. On step 8, the chain loops back from "man" to "cow."
[cow|cow|horse|man|siberian tiger|ox|man] in a field
Prompt editing was first implemented by Doggettx in [this reddit post](https://www.reddit.com/r/StableDiffusion/comments/xas2os/simple_prompt2prompt_implementation_with_prompt/).
**Note**: This syntax does _not_ work with extra networks, such as LoRA. See [this discussion post](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/10897#discussioncomment-6055184) for details. For similar functionality, see the [sd-webui-loractrl extension](https://github.com/cheald/sd-webui-loractl).
# Hires. fix
A convenience option to partially render your image at a lower resolution, upscale it, and then add details at a high resolution. By default, txt2img makes horrible images at very high resolutions, and this makes it possible to avoid using the small picture's composition. Enabled by checking the "Hires. fix" checkbox on the txt2img page.
| Without | With |
|-------------------------------|---------------------------------|
| ![00262-836728130](https://user-images.githubusercontent.com/20920490/191177752-ad983e62-8e1c-4197-8f3b-3165a6a6c31d.png) | ![00261-836728130](https://user-images.githubusercontent.com/20920490/191177785-395a951e-0d2e-4db7-9645-4c5af9321772.png) |
| ![00345-950170121](https://user-images.githubusercontent.com/20920490/191178018-25dcd98d-6c45-4c31-ab7a-3de6c51c52e3.png) | ![00341-950170121](https://user-images.githubusercontent.com/20920490/191178048-3eba3db4-e5be-4617-9bfe-2cb36cebaafc.png) |
Small picture is rendered at whatever resolution you set using width/height sliders.
Large picture's dimensions are controlled by three sliders: "Scale by" multiplier (Hires upscale), "Resize width to" and/or "Resize height to" (Hires resize).
* If "Resize width to" and "Resize height to" are 0, "Scale by" is used.
* If "Resize width to" is 0, "Resize height to" is calculated from width and height.
* If "Resize height to" is 0, "Resize width to" is calculated from width and height.
* If both "Resize width to" and "Resize height to" are non-zero, image is upscaled to be at least those dimensions, and some parts are cropped.
## Upscalers
A dropdown allows you to to select the kind of upscaler to use for resizing the image. In addition to all upscalers you have available on extras tab, there is an option to upscale a latent space image, which is what stable diffusion works with internally - for a 3x512x512 RGB image, its latent space representation would be 4x64x64. To see what each latent space upscaler does, you can set Denoising strength to 0 and Hires steps to 1 - you'll get a very good approximation of what stable diffusion would be working with on upscaled image.
Below are examples of how different latent upscale modes look.
| Original |
|------------------------------|
| ![00084-2395363541](https://user-images.githubusercontent.com/20920490/210657893-0660c637-9f26-405e-83c9-3030e45fd5b0.png) |
| Latent, Latent (antialiased) | Latent (bicubic), Latent (bicubic, antialiased) | Latent (nearest) |
|------------------------------|------------------------------|------------------------------|
| ![00071-2395363541](https://user-images.githubusercontent.com/20920490/210658048-d90ae87d-4534-4ca4-878b-9aaa4f43f901.png) | ![00073-2395363541](https://user-images.githubusercontent.com/20920490/210658501-c6a64c58-9343-470a-9f0b-6ae76c806725.png) | ![00077-2395363541](https://user-images.githubusercontent.com/20920490/210658607-ac5b5f30-af6a-4158-b968-9d1fdd6faf50.png) |
Antialiased variations were PRd in by a contributor and seem to be the same as non-antialiased.
# Composable Diffusion
A method to allow the combination of multiple prompts.
combine prompts using an uppercase AND
a cat AND a dog
Supports weights for prompts: `a cat :1.2 AND a dog AND a penguin :2.2`
The default weight value is 1.
It can be quite useful for combining multiple embeddings to your result: `creature_embedding in the woods:0.7 AND arcane_embedding:0.5 AND glitch_embedding:0.2`
Using a value lower than 0.1 will barely have an effect. `a cat AND a dog:0.03` will produce basically the same output as `a cat`
This could be handy for generating fine-tuned recursive variations, by continuing to append more prompts to your total. `creature_embedding on log AND frog:0.13 AND yellow eyes:0.08`
# Interrupt
Press the Interrupt button to stop current processing.
# 4GB videocard support
Optimizations for GPUs with low VRAM. This should make it possible to generate 512x512 images on videocards with 4GB memory.
`--lowvram` is a reimplementation of an optimization idea by [basujindal](https://github.com/basujindal/stable-diffusion).
Model is separated into modules, and only one module is kept in GPU memory; when another module needs to run, the previous is removed from GPU memory. The nature of this optimization makes the processing run slower -- about 10 times slower
compared to normal operation on my RTX 3090.
`--medvram` is another optimization that should reduce VRAM usage significantly by not processing conditional and
unconditional denoising in the same batch.
This implementation of optimization does not require any modification to the original Stable Diffusion code.
# Face restoration
Lets you improve faces in pictures using either [GFPGAN](https://github.com/TencentARC/GFPGAN) or [CodeFormer](https://github.com/sczhou/CodeFormer). There is a checkbox in every tab to use face restoration,
and also a separate tab that just allows you to use face restoration on any picture, with a slider that controls how visible
the effect is. You can choose between the two methods in settings.
| Original | GFPGAN | CodeFormer |
|-------------------------|--------------------------------|------------------------------------|
| ![](images/facefix.png) | ![](images/facefix-gfpgan.png) | ![](images/facefix-codeformer.png) |
# Checkpoint Merger
Guide generously donated by an anonymous benefactor.
![1674918832052087](https://user-images.githubusercontent.com/20920490/215274766-7d78df50-bb01-4e7b-84b6-04fed94b92ef.png)
Full guide with other info is here: https://imgur.com/a/VjFi5uM
# Saving
Click the Save button under the output section, and generated images will be saved to a directory specified in settings;
generation parameters will be appended to a csv file in the same directory.
# Loading
Gradio's loading graphic has a very negative effect on the processing speed of the neural network.
My RTX 3090 makes images about 10% faster when the tab with gradio is not active. By default, the UI now hides loading progress animation and replaces it with static "Loading..." text, which achieves the same effect. Use the `--no-progressbar-hiding` commandline option to revert this and show loading animations.
# Caching Models
![image](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/98228077/aaee8ca8-eb9e-4f22-8b7b-dfce51211e63)
If you want faster swapping between models, increase the counter in settings. Webui will keep models you've swapped from in ram.
Make sure you set the appropriate number according to your remaining available ram.
# Prompt validation
Stable Diffusion has a limit for input text length. If your prompt is too long, you will get a warning in the text output field, showing which parts of your text were truncated and ignored by the model.
# PNG info
Adds information about generation parameters to PNG as a text chunk. You can view this information later using any software that supports viewing PNG chunk info, for example: https://www.nayuki.io/page/png-file-chunk-inspector
# Settings
A tab with settings, allows you to use UI to edit more than half of parameters that previously were commandline. Settings are saved to `config.js`. Settings that remain as commandline options are ones that are required at startup.
# Filenames format
The `Images filename pattern` field in the Settings tab allows customization of generated txt2img and img2img images filenames. This pattern defines the generation parameters you want to include in filenames and their order. The supported tags are:
`[seed], [steps], [cfg], [width], [height], [styles], [sampler], [model_hash], [model_name], [date], [datetime], [job_timestamp], [prompt_hash], [prompt], [prompt_no_styles], [prompt_spaces], [prompt_words], [batch_number], [generation_number], [hasprompt], [clip_skip], [denoising]`
This list will evolve though, with new additions. You can get an up-to-date list of supported tags by hovering your mouse over the "Images filename pattern" label in the UI.
Example of a pattern: `[seed]-[steps]-[cfg]-[sampler]-[prompt_spaces]`
Note about "prompt" tags: `[prompt]` will add underscores between the prompt words, while `[prompt_spaces]` will keep the prompt intact (easier to copy/paste into the UI again). `[prompt_words]` is a simplified and cleaned-up version of your prompt, already used to generate subdirectories names, with only the words of your prompt (no punctuation).
If you leave this field empty, the default pattern will be applied (`[seed]-[prompt_spaces]`).
Please note that the tags are actually replaced inside the pattern. It means that you can also add non-tags words to this pattern, to make filenames even more explicit. For example: `s=[seed],p=[prompt_spaces]`
# User scripts
If the program is launched with `--allow-code` option, an extra text input field for script code is available at the bottom of the page, under Scripts -> Custom code. It allows you to input python code that will do the work with the image.
In code, access parameters from web UI using the `p` variable, and provide outputs for web UI using the `display(images, seed, info)` function. All globals from the script are also accessible.
A simple script that would just process the image and output it normally:
```python
import modules.processing
processed = modules.processing.process_images(p)
print("Seed was: " + str(processed.seed))
display(processed.images, processed.seed, processed.info)
```
# UI config
You can change parameters for UI elements in `ui-config.json`, it is created automatically when the program first starts. Some options:
- radio groups: default selection
- sliders: default value, min, max, step
- checkboxes: checked state
- text and number inputs: default values
Checkboxes that would usually expand a hidden section will not initially do so when set as UI config entries.
# ESRGAN
It's possible to use ESRGAN models on the Extras tab, as well as in SD upscale. [Paper](https://arxiv.org/abs/1809.00219) here.
To use ESRGAN models, put them into ESRGAN directory in the same location as webui.py.
A file will be loaded as a model if it has .pth extension. Grab models from the [Model Database](https://upscale.wiki/wiki/Model_Database).
Not all models from the database are supported. All 2x models are most likely not supported.
# img2img alternative test
Deconstructs an input image using a reverse of the Euler diffuser to create the noise pattern used to construct the input prompt.
As an example, you can use this image. Select the img2img alternative test from the *scripts* section.
![alt_src](https://user-images.githubusercontent.com/1633844/191771623-6293ec7b-c1c0-425c-9fe9-9d03313761fb.png)
Adjust your settings for the reconstruction process:
- Use a brief description of the scene: "A smiling woman with brown hair." Describing features you want to change helps. Set this as your starting prompt, and 'Original Input Prompt' in the script settings.
- You *MUST* use the Euler sampling method, as this script is built on it.
- Sampling steps: 50-60. This MUCH match the decode steps value in the script, or you'll have a bad time. Use 50 for this demo.
- CFG scale: 2 or lower. For this demo, use 1.8. (Hint, you can edit ui-config.json to change "img2img/CFG Scale/step" to .1 instead of .5.
- Denoising strength - this *does* matter, contrary to what the old docs said. Set it to 1.
- Width/Height - Use the width/height of the input image.
- Seed...you can ignore this. The reverse Euler is generating the noise for the image now.
- Decode cfg scale - Somewhere lower than 1 is the sweet spot. For the demo, use 1.
- Decode steps - as mentioned above, this should match your sampling steps. 50 for the demo, consider increasing to 60 for more detailed images.
Once all of the above are dialed in, you should be able to hit "Generate" and get back a result that is a *very* close approximation to the original.
After validating that the script is re-generating the source photo with a good degree of accuracy, you can try to change the details of the prompt. Larger variations of the original will likely result in an image with an entirely different composition than the source.
Example outputs using the above settings and prompts below (Red hair/pony not pictured)
![demo](https://user-images.githubusercontent.com/1633844/191776138-c77bf232-1981-47c9-a4d3-ae155631f5c8.png)
"A smiling woman with blue hair." Works.
"A frowning woman with brown hair." Works.
"A frowning woman with red hair." Works.
"A frowning woman with red hair riding a horse." Seems to replace the woman entirely, and now we have a ginger pony.
# user.css
Create a file named `user.css` near `webui.py` and put custom CSS code into it. For example, this makes the gallery taller:
```css
#txt2img_gallery, #img2img_gallery{
min-height: 768px;
}
```
A useful tip is you can append `/?__theme=dark` to your webui url to enable a built in *dark theme*
<br>e.g. (`http://127.0.0.1:7860/?__theme=dark`)
Alternatively, you can add the `--theme=dark` to the `set COMMANDLINE_ARGS=` in `webui-user.bat`<br>
e.g. `set COMMANDLINE_ARGS=--theme=dark`
![chrome_O1kvfKs1es](https://user-images.githubusercontent.com/39339941/197560013-51e535d6-7cef-4946-ab6b-747e1c76b007.png)
# notification.mp3
If an audio file named `notification.mp3` is present in webui's root folder, it will be played when the generation process completes.
As a source of inspiration:
* https://pixabay.com/sound-effects/search/ding/?duration=0-30
* https://pixabay.com/sound-effects/search/notification/?duration=0-30
# Tweaks
## Clip Skip
This is a slider in settings, and it controls how early the processing of prompt by CLIP network should be stopped.
A more detailed explanation:
CLIP is a very advanced neural network that transforms your prompt text into a numerical representation. Neural networks work very well with this numerical representation and that's why devs of SD chose CLIP as one of 3 models involved in stable diffusion's method of producing images. As CLIP is a neural network, it means that it has a lot of layers. Your prompt is digitized in a simple way, and then fed through layers. You get numerical representation of the prompt after the 1st layer, you feed that into the second layer, you feed the result of that into third, etc, until you get to the last layer, and that's the output of CLIP that is used in stable diffusion. This is the slider value of 1. But you can stop early, and use the output of the next to last layer - that's slider value of 2. The earlier you stop, the less layers of neural network have worked on the prompt.
Some models were trained with this kind of tweak, so setting this value helps produce better results on those models.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Guides-and-Tutorials.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><ul>
<li><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/How-to-make-your-own-Inpainting-model">How to make your own Inpainting model</a></li>
<li><a href="https://www.youtube.com/playlist?list=PL_pbwdIyffsmclLl0O144nQRnezKlNdx3">SECourses’s Stable Diffusion Tutorials Playlist</a></li>
</ul>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
- [How to make your own Inpainting model](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/How-to-make-your-own-Inpainting-model)
- [SECourses's Stable Diffusion Tutorials Playlist](https://www.youtube.com/playlist?list=PL_pbwdIyffsmclLl0O144nQRnezKlNdx3)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Home.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p><strong>Stable Diffusion web UI</strong> is a browser interface for Stable Diffusion based on Gradio library.</p>
<ul>
<li><a href="Features">Features</a>
<ul>
<li><a href="Textual-Inversion">Textual Inversion</a></li>
<li><a href="Negative-prompt">Negative prompt</a></li>
</ul>
</li>
<li><a href="Seed-breaking-changes">Seed breaking changes</a></li>
<li><a href="Dependencies">Dependencies</a>
<ul>
<li><a href="Xformers">Xformers</a></li>
</ul>
</li>
<li><a href="Install-and-Run-on-NVidia-GPUs">Installation and run on NVidia GPUs</a></li>
<li><a href="Install-and-Run-on-AMD-GPUs">Install and run on AMD GPUs</a></li>
<li><a href="Installation-on-Apple-Silicon">Install and run on Apple Silicon</a></li>
<li><a href="Command-Line-Arguments-and-Settings">Command Line Arguments and Settings</a></li>
<li><a href="Optimizations">Optimizations</a></li>
<li><a href="Custom-Scripts">Custom scripts</a>
<ul>
<li><a href="Developing-custom-scripts">Developing custom scripts</a></li>
</ul>
</li>
<li><a href="Extensions">Extensions</a>
<ul>
<li><a href="Developing-extensions">Developing extensions</a></li>
</ul>
</li>
<li><a href="Troubleshooting">Troubleshooting</a></li>
<li><a href="Contributing">Contributing</a></li>
<li><a href="Online-Services">Online Services</a></li>
<li><a href="Localization">Localization</a></li>
<li><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Custom-Images-Filename-Name-and-Subdirectory">Custom Filename Name and Subdirectory</a></li>
<li><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Change-model-folder-location">Change model folder location e.g. external disk</a></li>
<li><a href="API">API</a></li>
<li><a href="Tests">Tests</a></li>
<li><a href="Guides-and-Tutorials">Guides and Tutorials</a></li>
</ul>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
**Stable Diffusion web UI** is a browser interface for Stable Diffusion based on Gradio library 1.
- [Features](Features)
- [Textual Inversion](Textual-Inversion)
- [Negative prompt](Negative-prompt)
- [Seed breaking changes](Seed-breaking-changes)
- [Dependencies](Dependencies)
- [Xformers](Xformers)
- [Installation and run on NVidia GPUs](Install-and-Run-on-NVidia-GPUs)
- [Install and run on AMD GPUs](Install-and-Run-on-AMD-GPUs)
- [Install and run on Apple Silicon](Installation-on-Apple-Silicon)
- [Command Line Arguments and Settings](Command-Line-Arguments-and-Settings)
- [Optimizations](Optimizations)
- [Custom scripts](Custom-Scripts)
- [Developing custom scripts](Developing-custom-scripts)
- [Extensions](Extensions)
- [Developing extensions](Developing-extensions)
- [Troubleshooting](Troubleshooting)
- [Contributing](Contributing)
- [Online Services](Online-Services)
- [Localization](Localization)
- [Custom Filename Name and Subdirectory](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Custom-Images-Filename-Name-and-Subdirectory)
- [Change model folder location e.g. external disk](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Change-model-folder-location)
- [API](API)
- [Tests](Tests)
- [Guides and Tutorials](Guides-and-Tutorials)
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>How-to-make-your-own-Inpainting-model.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>Making your own inpainting model is very simple:</p>
<figure><img src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/40751091/4bdbab38-9237-48ea-9698-a036a5c96585" alt="screenshot"></figure>
<ol>
<li>Go to Checkpoint Merger</li>
<li>Select “Add Difference”</li>
<li>Set “Multiplier” to 1.0</li>
<li>Set “A” to the official inpaint model (<a href="https://huggingface.co/runwayml/stable-diffusion-inpainting/tree/main">SD-v1.5-Inpainting</a>)</li>
<li>Set “B” to your model</li>
<li>Set “C” to the standard base model (<a href="https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main">SD-v1.5</a>)</li>
<li>Set name as whatever you want, probably (your model)_inpainting</li>
<li>Set other values as preferred, ie probably select “Safetensors” and “Save as float16”</li>
<li>Hit merge</li>
<li>Use your new model in img2img inpainting tab</li>
</ol>
<p>The way this works is it literally just takes the inpainting model, and copies over your model’s unique data to it.
Notice that the formula is A + (B - C), which you can interpret as equivalent to (A - C) + B. Because ‘A’ is 1.5-inpaint and ‘C’ is 1.5, A - C is inpainting logic and nothing more. so the formula is (Inpainting logic) + (Your Model).</p>
<h3>Wider Application</h3>
<p>This “add-the-difference” merging can be applied to almost all the <strong>mechanically unique</strong> models webui can load. <br>
Check them out on the <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features">Features</a> page!</p>
<p>#1 Your existing <strong>finetuned model</strong> will need to match the <strong>unique model’s</strong> architecture, either: Stable Diffusion 2, or 1.</p>
<p>#2 You also need to put the unique model against the base model.
Find out what was the base model from their github.</p>
<p>Q: what was altdiffusion-m9 using as base model? <br>
A: the stable diffusion 1.4 model</p>
<p>Q: what was instructpix2pix using as base model? <br>
A: the stable diffusion 1.5 model</p>
<p>The networks/properties of these models can be used with any finetune, just like how the famous controlnet networks apply, only these are not separated from the model.</p>
<details><summary> Notes: </summary>
<p><em>You might realize Controlnet networks can already do many of these things.</em></p>
<p>So, here are some things maybe worth trying:</p>
<p>-darker/brighter lighting with noise offset model <br>
-make similar pictures to 512x512 in smaller 256 or 320 dimensions with miniSD model <br>
-prompt more deterministic across input languages with altdiffusion-m9 model (changes clip model)</p>
</details></div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
Making your own inpainting model is very simple:
![screenshot](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/40751091/4bdbab38-9237-48ea-9698-a036a5c96585)
1. Go to Checkpoint Merger
2. Select "Add Difference"
3. Set "Multiplier" to 1.0
4. Set "A" to the official inpaint model ([SD-v1.5-Inpainting](https://huggingface.co/runwayml/stable-diffusion-inpainting/tree/main))
5. Set "B" to your model
6. Set "C" to the standard base model ([SD-v1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5/tree/main))
7. Set name as whatever you want, probably (your model)_inpainting
8. Set other values as preferred, ie probably select "Safetensors" and "Save as float16"
9. Hit merge
10. Use your new model in img2img inpainting tab
The way this works is it literally just takes the inpainting model, and copies over your model's unique data to it.
Notice that the formula is A + (B - C), which you can interpret as equivalent to (A - C) + B. Because 'A' is 1.5-inpaint and 'C' is 1.5, A - C is inpainting logic and nothing more. so the formula is (Inpainting logic) + (Your Model).
### Wider Application
This "add-the-difference" merging can be applied to almost all the **mechanically unique** models webui can load. \
Check them out on the [Features](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features) page!
#1 Your existing **finetuned model** will need to match the **unique model's** architecture, either: Stable Diffusion 2, or 1.
#2 You also need to put the unique model against the base model.
Find out what was the base model from their github.
Q: what was altdiffusion-m9 using as base model? \
A: the stable diffusion 1.4 model
Q: what was instructpix2pix using as base model? \
A: the stable diffusion 1.5 model
The networks/properties of these models can be used with any finetune, just like how the famous controlnet networks apply, only these are not separated from the model.
<details><summary> Notes: </summary>
_You might realize Controlnet networks can already do many of these things._
So, here are some things maybe worth trying:
-darker/brighter lighting with noise offset model \
-make similar pictures to 512x512 in smaller 256 or 320 dimensions with miniSD model \
-prompt more deterministic across input languages with altdiffusion-m9 model (changes clip model)
</details>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Windows</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>Windows</h1>
<p>Windows+AMD support has <strong>not</strong> officially been made for webui, <br>
but you can install lshqqytiger’s fork of webui that uses <strong>Direct-ml</strong>.</p>
<p>-Training currently doesn’t work, yet a variety of features/extensions do, such as LoRAs and controlnet. Report issues at <a href="https://github.com/lshqqytiger/stable-diffusion-webui-directml/issues">https://github.com/lshqqytiger/stable-diffusion-webui-directml/issues</a></p>
<ol>
<li>Install <a href="https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe">Python 3.10.6</a> (ticking <strong>Add to PATH</strong>), and <a href="https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe">git</a></li>
<li>paste this line in cmd/terminal: <code>git clone https://github.com/lshqqytiger/stable-diffusion-webui-directml &amp;&amp; cd stable-diffusion-webui-directml &amp;&amp; git submodule init &amp;&amp; git submodule update</code> <br>
<sup>(you can move the program folder somewhere else.)</sup></li>
<li>Double-click webui-user.bat</li>
<li>If it looks like it is stuck when installing or running, press enter in the terminal and it should continue.</li>
</ol>
<details>
If you have 4-6gb vram, try adding these flags to `webui-user.bat` like so:
<ul>
<li>
<p><code>COMMANDLINE_ARGS=--opt-sub-quad-attention --lowvram --disable-nan-check</code></p>
</li>
<li>
<p>You can add --autolaunch to auto open the url for you.</p>
</li>
<li>
<p>Rename your edited <strong>webui-user.bat</strong> file to <strong>webui.settings.bat</strong> to avoid your settings get overwrite after git pull for update.</p>
</li>
</ul>
</details>
<p>(The rest <strong>below are installation guides for linux</strong> with rocm.)</p>
<h1>Automatic Installation</h1>
<p><sup>(As of <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/6709">1/15/23</a> you can just run <code>webui.sh</code> and pytorch+rocm should be automatically installed for you.)</sup></p>
<ol>
<li>Enter these commands, which will install webui to your current directory:</li>
</ol>
<pre><code>sudo apt install git python3.10-venv -y
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui &amp;&amp; cd stable-diffusion-webui
python3.10 -m venv venv
</code></pre>
<ol start="2">
<li>
<p>Install and run with:</p>
<p>./webui.sh {your_arguments*}</p>
</li>
</ol>
<p>*For many AMD GPUs, you <strong>must</strong> add <code>--precision full --no-half</code> or <code>--upcast-sampling</code> arguments to avoid NaN errors or crashing.
If <code>--upcast-sampling</code> works as a fix with your card, you should have 2x speed (fp16) compared to running in full precision.</p>
<details>
<ul>
<li>
<p>Some cards like the Radeon RX 6000 Series and the RX 500 Series will already run fp16 perfectly fine (noted <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5468">here</a>.)</p>
</li>
<li>
<p>If your card is unable to run SD with the latest pytorch+rocm core package, you can try installing previous versions, by following a more manual installation guide below.</p>
</li>
</ul>
</details>
<h1>Running natively</h1>
<p>Execute the following:</p>
<pre><code class="language-bash">git <span class="hljs-built_in">clone</span> https://github.com/AUTOMATIC1111/stable-diffusion-webui
<span class="hljs-built_in">cd</span> stable-diffusion-webui
python -m venv venv
<span class="hljs-built_in">source</span> venv/bin/activate
python -m pip install --upgrade pip wheel
<span class="hljs-comment"># It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers</span>
TORCH_COMMAND=<span class="hljs-string">'pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.1.1'</span> python launch.py --precision full --no-half
</code></pre>
<p>In following runs you will only need to execute:</p>
<pre><code class="language-bash"><span class="hljs-built_in">cd</span> stable-diffusion-webui
<span class="hljs-comment"># Optional: "git pull" to update the repository</span>
<span class="hljs-built_in">source</span> venv/bin/activate
<span class="hljs-comment"># It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers</span>
TORCH_COMMAND=<span class="hljs-string">'pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.1.1'</span> python launch.py --precision full --no-half
</code></pre>
<p>The first generation after starting the WebUI might take very long, and you might see a message similar to this:</p>
<blockquote>
<p>MIOpen(HIP): Warning [SQLiteBase] Missing system database file: gfx1030_40.kdb Performance may degrade. Please follow
instructions to install: <a href="https://github.com/ROCmSoftwarePlatform/MIOpen#installing-miopen-kernels-package">https://github.com/ROCmSoftwarePlatform/MIOpen#installing-miopen-kernels-package</a></p>
</blockquote>
<p>The next generations should work with regular performance. You can follow the link in the message, and if you happen
to use the same operating system, follow the steps there to fix this issue. If there is no clear way to compile or
install the MIOpen kernels for your operating system, consider following the “Running inside Docker”-guide below.</p>
<h1>Running inside Docker</h1>
<p>Pull the latest <code>rocm/pytorch</code> Docker image, start the image and attach to the container (taken from the <code>rocm/pytorch</code>
documentation): <code>docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $HOME/dockerx:/dockerx rocm/pytorch</code></p>
<p>Execute the following inside the container:</p>
<pre><code class="language-bash"><span class="hljs-built_in">cd</span> /dockerx
git <span class="hljs-built_in">clone</span> https://github.com/AUTOMATIC1111/stable-diffusion-webui
<span class="hljs-built_in">cd</span> stable-diffusion-webui
python -m pip install --upgrade pip wheel
<span class="hljs-comment"># It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers</span>
REQS_FILE=<span class="hljs-string">'requirements.txt'</span> python launch.py --precision full --no-half
</code></pre>
<p>Following runs will only require you to restart the container, attach to it again and execute the following inside the
container: Find the container name from this listing: <code>docker container ls --all</code>, select the one matching the
<code>rocm/pytorch</code> image, restart it: <code>docker container restart &lt;container-id&gt;</code> then attach to it: <code>docker exec -it &lt;container-id&gt; bash</code>.</p>
<pre><code class="language-bash"><span class="hljs-built_in">cd</span> /dockerx/stable-diffusion-webui
<span class="hljs-comment"># Optional: "git pull" to update the repository</span>
<span class="hljs-comment"># It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers</span>
REQS_FILE=<span class="hljs-string">'requirements.txt'</span> python launch.py --precision full --no-half
</code></pre>
<p>The <code>/dockerx</code> folder inside the container should be accessible in your home directory under the same name.</p>
<h2>Updating Python version inside Docker</h2>
<p>If the web UI becomes incompatible with the pre-installed Python 3.7 version inside the Docker image, here are
instructions on how to update it (assuming you have successfully followed “Running inside Docker”):</p>
<p>Execute the following inside the container:</p>
<pre><code class="language-bash">apt install python3.9-full <span class="hljs-comment"># Confirm every prompt</span>
update-alternatives --install /usr/<span class="hljs-built_in">local</span>/bin/python python /usr/bin/python3.9 1
<span class="hljs-built_in">echo</span> <span class="hljs-string">'PATH=/usr/local/bin:$PATH'</span> &gt;&gt; ~/.bashrc
</code></pre>
<p>Run <code>source ~/.bashrc</code> and proceed by running the same commands as you would with an existing container.</p>
<p>It’s possible that you don’t need “–precision full”, dropping “–no-half” however it may not work for everyone. Certain cards like the Radeon RX 6000 Series and the RX 500 Series will function normally without the option <code>--precision full --no-half</code>, saving plenty of VRAM. (noted <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5468">here</a>.)</p>
<h1>Install on AMD and Arch Linux</h1>
<p><strong>Install webui on Arch Linux with Arch-specific packages</strong><br>
<em>and possibly other Arch-based Linux distributions (tested Feb 22 2023)</em></p>
<h2>Arch-specific dependencies</h2>
<ol>
<li>Start with <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies#required-dependencies">required dependencies</a> and install <code>pip</code></li>
</ol>
<pre><code class="language-bash">sudo pacman -S python-pip
</code></pre>
<ol start="2">
<li>Install <code>pytorch</code> with ROCm backend</li>
</ol>
<p>Arch [Community] repository offers two <code>pytorch</code> packages, <code>python-pytorch-rocm</code> and <code>python-pytorch-opt-rocm</code>. For CPUs with AVX2 instruction set support, that is, CPU microarchitectures beyond Haswell (Intel, 2013) or Excavator (AMD, 2015), install <code>python-pytorch-opt-rocm</code> to benefit from performance optimizations. Otherwise install <code>python-pytorch-rocm</code>:</p>
<pre><code class="language-bash"><span class="hljs-comment"># Install either one:</span>
sudo pacman -S python-pytorch-rocm
sudo pacman -S python-pytorch-opt-rocm <span class="hljs-comment"># AVX2 CPUs only</span>
</code></pre>
<ol start="3">
<li>Install <code>torchvision</code> with ROCm backend</li>
</ol>
<p><code>python-torchvision-rocm</code> package is located in AUR. Clone the git repository and compile the package on your machine</p>
<pre><code class="language-bash">git <span class="hljs-built_in">clone</span> https://aur.archlinux.org/python-torchvision-rocm.git
<span class="hljs-built_in">cd</span> python-torchvision-rocm
makepkg -si
</code></pre>
<p>Confirm all steps until Pacman finishes installing <code>python-torchvision-rocm</code>.</p>
<p>Alternatively, install the <code>python-torchvision-rocm</code> package with a <a href="https://wiki.archlinux.org/title/AUR_helpers">AUR helper</a>.</p>
<h2>Setup <code>venv</code> environment</h2>
<ol>
<li>Manually create a <code>venv</code> environment with system site-packages (this will allows access to system <code>pytorch</code> and <code>torchvision</code>). Install the remaining Python dependencies</li>
</ol>
<pre><code class="language-bash">python -m venv venv --system-site-packages
<span class="hljs-built_in">source</span> venv/bin/activate
pip install -r requirements.txt
</code></pre>
<h2>Launch</h2>
<p>Run the following inside the project root to start webui:</p>
<pre><code class="language-bash"><span class="hljs-built_in">source</span> venv/bin/activate
./webui.sh
</code></pre>
<p>Depending on the GPU model, you may need to add certain <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings">Command Line Arguments</a> and <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Optimizations">Optimizations</a> to <code>webui-user.sh</code> in order for webui to run properly. Refer to the <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs#automatic-installation">Automatic Installation</a> section.</p>
<h2>Limitations</h2>
<ul>
<li>GPU model has to be supported by Arch dependencies</li>
</ul>
<p>See if your GPU is listed as a build architecture in <code>PYTORCH_ROCM_ARCH</code> variable for <a href="https://github.com/rocm-arch/python-torchvision-rocm/blob/b66f7ed9540a0e25f4a81bf0d9cfc3d76bc0270e/PKGBUILD#L68-L74">Tourchvision</a> and <a href="https://github.com/archlinux/svntogit-community/blob/5689e7f44f082ba3c37724c2890e93e7106002a1/trunk/PKGBUILD#L220">PyTorch</a>. References for architectures can be found <a href="https://llvm.org/docs/AMDGPUUsage.html#processors">here</a>. If not, consider building both packages locally or use another <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs">installation method</a>.</p>
<ul>
<li>Arch dependencies (<code>pytorch</code>, <code>torchvision</code>) are kept up-to-date by full system updates (<code>pacman -Syu</code>) and compiling, which may not be desirable when dependency combinations with fixed versions are wished</li>
</ul>
<p><em>This guide has been tested on AMD Radeon RX6800 with Python 3.10.9, ROCm 5.4.3, PyTorch 1.13.1, Torchvision 0.14.1</em></p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# Windows
Windows+AMD support has **not** officially been made for webui, \
but you can install lshqqytiger's fork of webui that uses **Direct-ml**.
-Training currently doesn't work, yet a variety of features/extensions do, such as LoRAs and controlnet. Report issues at https://github.com/lshqqytiger/stable-diffusion-webui-directml/issues
1. Install [Python 3.10.6](https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe) (ticking **Add to PATH**), and [git](https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe)
2. paste this line in cmd/terminal: `git clone https://github.com/lshqqytiger/stable-diffusion-webui-directml && cd stable-diffusion-webui-directml && git submodule init && git submodule update` \
<sup>(you can move the program folder somewhere else.)</sup>
3. Double-click webui-user.bat
4. If it looks like it is stuck when installing or running, press enter in the terminal and it should continue.
<details>
If you have 4-6gb vram, try adding these flags to `webui-user.bat` like so:
- `COMMANDLINE_ARGS=--opt-sub-quad-attention --lowvram --disable-nan-check`
- You can add --autolaunch to auto open the url for you.
- Rename your edited **webui-user.bat** file to **webui.settings.bat** to avoid your settings get overwrite after git pull for update.
</details>
(The rest **below are installation guides for linux** with rocm.)
# Automatic Installation
<sup>(As of [1/15/23](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/6709) you can just run `webui.sh` and pytorch+rocm should be automatically installed for you.)</sup>
1. Enter these commands, which will install webui to your current directory:
```
sudo apt install git python3.10-venv -y
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui && cd stable-diffusion-webui
python3.10 -m venv venv
```
2. Install and run with:
./webui.sh {your_arguments*}
*For many AMD GPUs, you **must** add `--precision full --no-half` or `--upcast-sampling` arguments to avoid NaN errors or crashing.
If `--upcast-sampling` works as a fix with your card, you should have 2x speed (fp16) compared to running in full precision.
<details>
- Some cards like the Radeon RX 6000 Series and the RX 500 Series will already run fp16 perfectly fine (noted [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5468).)
- If your card is unable to run SD with the latest pytorch+rocm core package, you can try installing previous versions, by following a more manual installation guide below.
</details>
# Running natively
Execute the following:
```bash
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
cd stable-diffusion-webui
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip wheel
# It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers
TORCH_COMMAND='pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.1.1' python launch.py --precision full --no-half
```
In following runs you will only need to execute:
```bash
cd stable-diffusion-webui
# Optional: "git pull" to update the repository
source venv/bin/activate
# It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers
TORCH_COMMAND='pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/rocm5.1.1' python launch.py --precision full --no-half
```
The first generation after starting the WebUI might take very long, and you might see a message similar to this:
> MIOpen(HIP): Warning [SQLiteBase] Missing system database file: gfx1030_40.kdb Performance may degrade. Please follow
> instructions to install: https://github.com/ROCmSoftwarePlatform/MIOpen#installing-miopen-kernels-package
The next generations should work with regular performance. You can follow the link in the message, and if you happen
to use the same operating system, follow the steps there to fix this issue. If there is no clear way to compile or
install the MIOpen kernels for your operating system, consider following the "Running inside Docker"-guide below.
# Running inside Docker
Pull the latest `rocm/pytorch` Docker image, start the image and attach to the container (taken from the `rocm/pytorch`
documentation): `docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined -v $HOME/dockerx:/dockerx rocm/pytorch`
Execute the following inside the container:
```bash
cd /dockerx
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui
cd stable-diffusion-webui
python -m pip install --upgrade pip wheel
# It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers
REQS_FILE='requirements.txt' python launch.py --precision full --no-half
```
Following runs will only require you to restart the container, attach to it again and execute the following inside the
container: Find the container name from this listing: `docker container ls --all`, select the one matching the
`rocm/pytorch` image, restart it: `docker container restart <container-id>` then attach to it: `docker exec -it
<container-id> bash`.
```bash
cd /dockerx/stable-diffusion-webui
# Optional: "git pull" to update the repository
# It's possible that you don't need "--precision full", dropping "--no-half" however crashes my drivers
REQS_FILE='requirements.txt' python launch.py --precision full --no-half
```
The `/dockerx` folder inside the container should be accessible in your home directory under the same name.
## Updating Python version inside Docker
If the web UI becomes incompatible with the pre-installed Python 3.7 version inside the Docker image, here are
instructions on how to update it (assuming you have successfully followed "Running inside Docker"):
Execute the following inside the container:
```bash
apt install python3.9-full # Confirm every prompt
update-alternatives --install /usr/local/bin/python python /usr/bin/python3.9 1
echo 'PATH=/usr/local/bin:$PATH' >> ~/.bashrc
```
Run `source ~/.bashrc` and proceed by running the same commands as you would with an existing container.
It's possible that you don't need "--precision full", dropping "--no-half" however it may not work for everyone. Certain cards like the Radeon RX 6000 Series and the RX 500 Series will function normally without the option `--precision full --no-half`, saving plenty of VRAM. (noted [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/5468).)
# Install on AMD and Arch Linux
**Install webui on Arch Linux with Arch-specific packages**
*and possibly other Arch-based Linux distributions (tested Feb 22 2023)*
## Arch-specific dependencies
1. Start with [required dependencies](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Dependencies#required-dependencies) and install `pip`
```bash
sudo pacman -S python-pip
```
2. Install `pytorch` with ROCm backend
Arch [Community] repository offers two `pytorch` packages, `python-pytorch-rocm` and `python-pytorch-opt-rocm`. For CPUs with AVX2 instruction set support, that is, CPU microarchitectures beyond Haswell (Intel, 2013) or Excavator (AMD, 2015), install `python-pytorch-opt-rocm` to benefit from performance optimizations. Otherwise install `python-pytorch-rocm`:
```bash
# Install either one:
sudo pacman -S python-pytorch-rocm
sudo pacman -S python-pytorch-opt-rocm # AVX2 CPUs only
```
3. Install `torchvision` with ROCm backend
`python-torchvision-rocm` package is located in AUR. Clone the git repository and compile the package on your machine
```bash
git clone https://aur.archlinux.org/python-torchvision-rocm.git
cd python-torchvision-rocm
makepkg -si
```
Confirm all steps until Pacman finishes installing `python-torchvision-rocm`.
Alternatively, install the `python-torchvision-rocm` package with a [AUR helper](https://wiki.archlinux.org/title/AUR_helpers).
## Setup `venv` environment
1. Manually create a `venv` environment with system site-packages (this will allows access to system `pytorch` and `torchvision`). Install the remaining Python dependencies
```bash
python -m venv venv --system-site-packages
source venv/bin/activate
pip install -r requirements.txt
```
## Launch
Run the following inside the project root to start webui:
```bash
source venv/bin/activate
./webui.sh
```
Depending on the GPU model, you may need to add certain [Command Line Arguments](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings) and [Optimizations](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Optimizations) to `webui-user.sh` in order for webui to run properly. Refer to the [Automatic Installation](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs#automatic-installation) section.
## Limitations
- GPU model has to be supported by Arch dependencies
See if your GPU is listed as a build architecture in `PYTORCH_ROCM_ARCH` variable for [Tourchvision](https://github.com/rocm-arch/python-torchvision-rocm/blob/b66f7ed9540a0e25f4a81bf0d9cfc3d76bc0270e/PKGBUILD#L68-L74) and [PyTorch](https://github.com/archlinux/svntogit-community/blob/5689e7f44f082ba3c37724c2890e93e7106002a1/trunk/PKGBUILD#L220). References for architectures can be found [here](https://llvm.org/docs/AMDGPUUsage.html#processors). If not, consider building both packages locally or use another [installation method](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Install-and-Run-on-AMD-GPUs).
- Arch dependencies (`pytorch`, `torchvision`) are kept up-to-date by full system updates (`pacman -Syu`) and compiling, which may not be desirable when dependency combinations with fixed versions are wished
*This guide has been tested on AMD Radeon RX6800 with Python 3.10.9, ROCm 5.4.3, PyTorch 1.13.1, Torchvision 0.14.1*
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Automatic Installation</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>Automatic Installation</h1>
<h2>Windows (method 1)</h2>
<blockquote>
<p>A very basic guide to get Stable Diffusion web UI up and running on Windows 10/11 NVIDIA GPU.</p>
</blockquote>
<ol>
<li>Download the <code>sd.webui.zip</code> from <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.0.0-pre">here</a>, this package is from <code>v1.0.0-pre</code> we will update it to the latest webui version in step 3.</li>
<li>Extract the zip file at your desired location.</li>
<li>Double click the <code>update.bat</code> to update web UI to the latest version, wait till finish then close the window.</li>
<li>Double click the <code>run.bat</code> to launch web UI, during the first launch it will download large amounts of files. After everything has been downloaded and installed correctly, you should see a message “<code>Running on local URL: http://127.0.0.1:7860</code>”, opening the link will present you with the web UI interface.</li>
</ol>
<blockquote>
<p>you should be able to start generating images</p>
</blockquote>
<h3>Extra configurations via <code>COMMANDLINE_ARGS</code></h3>
<p>There are some configuration options that you may want apply to web UI, in order to configure these options you need to edit the launch script found at <code>sd.webui\webui\webui-user.bat</code>, edit the file add the selected arguments after <code>set COMMANDLINE_ARGS=</code> like so :</p>
<pre><code class="language-bat"><span class="hljs-built_in">set</span> COMMANDLINE_ARGS=--autolaunch --update-check
</code></pre>
<blockquote>
<p>Each individual argument need to separated by a space, the above example well configure web UI to auto launch the browser page after it completes loading, and also check for new version of web UI at launch.</p>
</blockquote>
<h3>Troubleshooting</h3>
<p>The default configuration of web UI should run on most modern GPU, but in some cases you may need some extra arguments to allow it to work properly.</p>
<ol>
<li>For GPU with less amounts of VRAM, you may need <code>--medvram</code> or <code>--lowvram</code>, these optimizations reduces VRAM requirements but sacrifice performance. If you do not have enough VRAM, web UI may refuse to launch or fail to generate images due to an out-of-memory error. The amount of VRAM required largely depends the desired image resolution, for more details see <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Troubleshooting">Troubleshooting</a>.</li>
</ol>
<blockquote>
<p>the <a href="https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111">Tiled VAE</a> extension can help to reduce the VRAM requirement.</p>
</blockquote>
<ol start="2">
<li>
<p>If your generated results in resulting in a black or green image, try adding <code>--precision full</code> and <code>--no-half</code>.</p>
</li>
<li>
<p>Some combinations of model and VAE are prone to produce <code>NansException: A tensor with all NaNs was produced in VAE</code> resulting in a black image, using the option <code>--no-half-vae</code> may help to mitigate this issue.</p>
</li>
</ol>
<h3>Extra Options</h3>
<ol>
<li>There are several cross attenuation optimization methods such as <code>--xformers</code> or <code>--opt-sdp-attention</code>, these can drastically increase performance see <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Optimizations">Optimizations</a> for more details, experiment with different options as different hardware are suited for different optimizations. If you wish to measure your system’s performance, try using <a href="https://github.com/vladmandic/sd-extension-system-info">sd-extension-system-info</a> extension which features a benchmarking tool and a <a href="https://vladmandic.github.io/sd-extension-system-info/pages/benchmark.html">database</a> of user submitted results.</li>
<li>add <code>--autolaunch</code> to have web UI launch the web browser automatically after web UI has started up.</li>
<li>add <code>--update-check</code> will notify you when there’s a new version of webui.</li>
<li>See <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings">Command Line Arguments and Settings
</a> for more configuration options.</li>
</ol>
<h3>Tip</h3>
<p>If you already have stable diffusion models downloaded, you can move the models into <code>sd.webui\webui\models\Stable-diffusion\</code> before running <code>run.bat</code> in step 3, this will skip auto downloading the vanilla <a href="https://huggingface.co/runwayml/stable-diffusion-v1-5">stable-diffusion-v1-5 model</a> model.</p>
<h2>Windows (method 2)</h2>
<ol>
<li>Install <a href="https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe">Python 3.10.6</a> (ticking <strong>Add to PATH</strong>), and <a href="https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe">git</a></li>
<li>Open Command Prompt from search bar, and type <code>git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui</code></li>
<li>Double click <code>webui-user.bat</code></li>
</ol>
<p>Installation video in case you get stuck: <br>
<sup>solves <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/8229">#8229</a></sup></p>
<details><summary>Video: (Click to expand:)</summary>
<p><a href="https://user-images.githubusercontent.com/98228077/223032534-c5dd5b13-a4b6-47a7-995c-27ed8ba8b3e7.mp4">https://user-images.githubusercontent.com/98228077/223032534-c5dd5b13-a4b6-47a7-995c-27ed8ba8b3e7.mp4</a></p>
</details>
<details><summary>Alternative Powershell launch scripts:</summary>
<p><strong>webui.ps1</strong></p>
<pre><code>if ($env:PYTHON -eq &quot;&quot; -or $env:PYTHON -eq $null) {
$PYTHON = &quot;Python.exe&quot;
} else {
$PYTHON = $env:PYTHON
}
if ($env:VENV_DIR -eq &quot;&quot; -or $env:VENV_DIR -eq $null) {
$VENV_DIR = &quot;$PSScriptRoot\venv&quot;
} else {
$VENV_DIR = $env:VENV_DIR
}
if ($env:LAUNCH_SCRIPT -eq &quot;&quot; -or $env:LAUNCH_SCRIPT -eq $null) {
$LAUNCH_SCRIPT = &quot;$PSScriptRoot\launch.py&quot;
} else {
$LAUNCH_SCRIPT = $env:LAUNCH_SCRIPT
}
$ERROR_REPORTING = $false
mkdir tmp 2&gt;$null
function Start-Venv {
if ($VENV_DIR -eq '-') {
Skip-Venv
}
if (Test-Path -Path &quot;$VENV_DIR\Scripts\$python&quot;) {
Activate-Venv
} else {
$PYTHON_FULLNAME = &amp; $PYTHON -c &quot;import sys; print(sys.executable)&quot;
Write-Output &quot;Creating venv in directory $VENV_DIR using python $PYTHON_FULLNAME&quot;
Invoke-Expression &quot;$PYTHON_FULLNAME -m venv $VENV_DIR &gt; tmp/stdout.txt 2&gt; tmp/stderr.txt&quot;
if ($LASTEXITCODE -eq 0) {
Activate-Venv
} else {
Write-Output &quot;Unable to create venv in directory $VENV_DIR&quot;
}
}
}
function Activate-Venv {
$PYTHON = &quot;$VENV_DIR\Scripts\Python.exe&quot;
$ACTIVATE = &quot;$VENV_DIR\Scripts\activate.bat&quot;
Invoke-Expression &quot;cmd.exe /c $ACTIVATE&quot;
Write-Output &quot;Venv set to $VENV_DIR.&quot;
if ($ACCELERATE -eq 'True') {
Check-Accelerate
} else {
Launch-App
}
}
function Skip-Venv {
Write-Output &quot;Venv set to $VENV_DIR.&quot;
if ($ACCELERATE -eq 'True') {
Check-Accelerate
} else {
Launch-App
}
}
function Check-Accelerate {
Write-Output 'Checking for accelerate'
$ACCELERATE = &quot;$VENV_DIR\Scripts\accelerate.exe&quot;
if (Test-Path -Path $ACCELERATE) {
Accelerate-Launch
} else {
Launch-App
}
}
function Launch-App {
Write-Output &quot;Launching with python&quot;
Invoke-Expression &quot;$PYTHON $LAUNCH_SCRIPT&quot;
#pause
exit
}
function Accelerate-Launch {
Write-Output 'Accelerating'
Invoke-Expression &quot;$ACCELERATE launch --num_cpu_threads_per_process=6 $LAUNCH_SCRIPT&quot;
#pause
exit
}
try {
if(Get-Command $PYTHON){
Start-Venv
}
} Catch {
Write-Output &quot;Couldn't launch python.&quot;
}
</code></pre>
<p><strong>webui-user.ps1</strong></p>
<pre><code>[Environment]::SetEnvironmentVariable(&quot;PYTHON&quot;, &quot;&quot;)
[Environment]::SetEnvironmentVariable(&quot;GIT&quot;, &quot;&quot;)
[Environment]::SetEnvironmentVariable(&quot;VENV_DIR&quot;,&quot;&quot;)
# Commandline arguments for webui.py, for example: [Environment]::SetEnvironmentVariable(&quot;COMMANDLINE_ARGS&quot;, &quot;--medvram --opt-split-attention&quot;)
[Environment]::SetEnvironmentVariable(&quot;COMMANDLINE_ARGS&quot;, &quot;&quot;)
# script to launch to start the app
# [Environment]::SetEnvironmentVariable(&quot;LAUNCH_SCRIPT&quot;, &quot;launch.py&quot;)
# install command for torch
# [Environment]::SetEnvironmentVariable(&quot;TORCH_COMMAND&quot;, &quot;pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113&quot;)
# Requirements file to use for stable-diffusion-webui
# [Environment]::SetEnvironmentVariable(&quot;REQS_FILE&quot;, &quot;requirements_versions.txt&quot;)
# [Environment]::SetEnvironmentVariable(&quot;GFPGAN_PACKAGE&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;CLIP_PACKAGE&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;OPENCLIP_PACKAGE&quot;, &quot;&quot;)
# URL to a WHL if you wish to override default xformers windows
# [Environment]::SetEnvironmentVariable(&quot;XFORMERS_WINDOWS_PACKAGE&quot;, &quot;&quot;)
# Uncomment and set to enable an alternate repository URL
# [Environment]::SetEnvironmentVariable(&quot;STABLE_DIFFUSION_REPO&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;TAMING_TRANSFORMERS_REPO&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;K_DIFFUSION_REPO&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;CODEFORMER_REPO&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;BLIP_REPO&quot;, &quot;&quot;)
# Uncomment and set to enable a specific revision of a repository
# [Environment]::SetEnvironmentVariable(&quot;STABLE_DIFFUSION_COMMIT_HASH&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;TAMING_TRANSFORMERS_COMMIT_HASH&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;K_DIFFUSION_COMMIT_HASH&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;CODEFORMER_COMMIT_HASH&quot;, &quot;&quot;)
# [Environment]::SetEnvironmentVariable(&quot;BLIP_COMMIT_HASH&quot;, &quot;&quot;)
# Uncomment to enable accelerated launch
# [Environment]::SetEnvironmentVariable(&quot;ACCELERATE&quot;, &quot;True&quot;)
$SCRIPT = &quot;$PSScriptRoot\webui.ps1&quot;
Invoke-Expression &quot;$SCRIPT&quot;
</code></pre>
</details>
<p>See <a href="Troubleshooting">Troubleshooting</a> section for what to do if things go wrong.</p>
<h2>Linux</h2>
<p>(Debian-based)</p>
<ol>
<li>Enter these commands, which will install webui to your current directory:</li>
</ol>
<pre><code>sudo apt install git python3.10-venv -y
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui &amp;&amp; cd stable-diffusion-webui
python3.10 -m venv venv
</code></pre>
<ol start="2">
<li>
<p>Install and run with:</p>
<p>./webui.sh {your_arguments}</p>
</li>
</ol>
<details><summary>Other Distributions:</summary>
<p>(Arch-based)</p>
<pre><code>sudo pacman -S git python3 -y &amp;&amp; git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui &amp;&amp; cd stable-diffusion-webui &amp;&amp; ./webui.sh
</code></pre>
<p>(Red Hat-based)</p>
<pre><code>sudo dnf install git python3 -y &amp;&amp; git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui &amp;&amp; cd stable-diffusion-webui &amp;&amp; ./webui.sh
</code></pre>
</details>
<details><summary>For Installing Python 3.10</summary>
<p>Some distribution have older/newer system python versions than python 3.10.</p>
<pre><code>cd stable-diffusion-webui
sudo pacman -S pyenv
pyenv install 3.10.6
pyenv local 3.10.6
python -m venv
</code></pre>
</details>
<h2>Third party installation guides/scripts:</h2>
<ul>
<li>NixOS: <a href="https://github.com/virchau13/automatic1111-webui-nix">https://github.com/virchau13/automatic1111-webui-nix</a></li>
</ul>
<h2>Install and run without virtual environment</h2>
<p>To install the required packages via pip without creating a virtual environment, run:</p>
<pre><code class="language-bash">python launch.py
</code></pre>
<p>Command line arguments may be passed directly, for example:</p>
<pre><code class="language-bash">python launch.py --opt-split-attention --ckpt ../secret/anime9999.ckpt
</code></pre>
<h1>Manual Installation</h1>
<p>Manual installation is very outdated and probably won’t work. check colab in the repo’s readme for instructions.</p>
<p>The following process installs everything manually on both Windows or Linux (the latter requiring <code>dir</code> to be replaced by <code>ls</code>):</p>
<pre><code class="language-bash"><span class="hljs-comment"># install torch with CUDA support. See https://pytorch.org/get-started/locally/ for more instructions if this fails.</span>
pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
<span class="hljs-comment"># check if torch supports GPU; this must output "True". You need CUDA 11. installed for this. You might be able to use</span>
<span class="hljs-comment"># a different version, but this is what I tested.</span>
python -c <span class="hljs-string">"import torch; print(torch.cuda.is_available())"</span>
<span class="hljs-comment"># clone web ui and go into its directory</span>
git <span class="hljs-built_in">clone</span> https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
<span class="hljs-built_in">cd</span> stable-diffusion-webui
<span class="hljs-comment"># clone repositories for Stable Diffusion and (optionally) CodeFormer</span>
mkdir repositories
git <span class="hljs-built_in">clone</span> https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion-stability-ai
git <span class="hljs-built_in">clone</span> https://github.com/CompVis/taming-transformers.git repositories/taming-transformers
git <span class="hljs-built_in">clone</span> https://github.com/sczhou/CodeFormer.git repositories/CodeFormer
git <span class="hljs-built_in">clone</span> https://github.com/salesforce/BLIP.git repositories/BLIP
<span class="hljs-comment"># install requirements of Stable Diffusion</span>
pip install transformers==4.19.2 diffusers invisible-watermark --prefer-binary
<span class="hljs-comment"># install k-diffusion</span>
pip install git+https://github.com/crowsonkb/k-diffusion.git --prefer-binary
<span class="hljs-comment"># (optional) install GFPGAN (face restoration)</span>
pip install git+https://github.com/TencentARC/GFPGAN.git --prefer-binary
<span class="hljs-comment"># (optional) install requirements for CodeFormer (face restoration)</span>
pip install -r repositories/CodeFormer/requirements.txt --prefer-binary
<span class="hljs-comment"># install requirements of web ui</span>
pip install -r requirements.txt --prefer-binary
<span class="hljs-comment"># update numpy to latest version</span>
pip install -U numpy --prefer-binary
<span class="hljs-comment"># (outside of command line) put stable diffusion model into web ui directory</span>
<span class="hljs-comment"># the command below must output something like: 1 File(s) 4,265,380,512 bytes</span>
dir model.ckpt
</code></pre>
<p>The installation is finished, to start the web ui, run:</p>
<pre><code class="language-bash">python webui.py
</code></pre>
<h1>Windows 11 WSL2 instructions</h1>
<p>To install under a Linux distro in Windows 11’s WSL2:</p>
<pre><code class="language-bash"><span class="hljs-comment"># install conda (if not already done)</span>
wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
chmod +x Anaconda3-2022.05-Linux-x86_64.sh
./Anaconda3-2022.05-Linux-x86_64.sh
<span class="hljs-comment"># Clone webui repo</span>
git <span class="hljs-built_in">clone</span> https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
<span class="hljs-built_in">cd</span> stable-diffusion-webui
<span class="hljs-comment"># Create and activate conda env</span>
conda env create -f environment-wsl2.yaml
conda activate automatic
</code></pre>
<p>At this point, the instructions for the Manual installation may be applied starting at step <code># clone repositories for Stable Diffusion and (optionally) CodeFormer</code>.</p>
<h1>Alternative installation on Windows using Conda</h1>
<ul>
<li>Prerequisites <em><em>(Only needed if you do not have them)</em></em>. Assumes <a href="https://chocolatey.org/install">Chocolatey</a> is installed.<pre><code class="language-bash"><span class="hljs-comment"># install git</span>
choco install git
<span class="hljs-comment"># install conda</span>
choco install anaconda3
</code></pre>
Optional parameters: <a href="https://community.chocolatey.org/packages/git">git</a>, <a href="https://community.chocolatey.org/packages/anaconda3">conda</a></li>
<li>Install (warning: some files exceed multiple gigabytes, make sure you have space first)
<ol>
<li>Download as .zip and extract or use git to clone.<pre><code class="language-bash">git <span class="hljs-built_in">clone</span> https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
</code></pre>
</li>
<li>Launch the Anaconda prompt. It should be noted that you can use older Python versions, but you may be forced to manually remove features like cache optimization, which will degrade your performance.<pre><code class="language-bash"><span class="hljs-comment"># Navigate to the git directory</span>
<span class="hljs-built_in">cd</span> <span class="hljs-string">"GIT\StableDiffusion"</span>
<span class="hljs-comment"># Create environment</span>
conda create -n StableDiffusion python=3.10.6
<span class="hljs-comment"># Activate environment</span>
conda activate StableDiffusion
<span class="hljs-comment"># Validate environment is selected</span>
conda env list
<span class="hljs-comment"># Start local webserver</span>
webui-user.bat
<span class="hljs-comment"># Wait for "Running on local URL: http://127.0.0.1:7860" and open that URI.</span>
</code></pre>
</li>
<li><em><em>(Optional)</em></em> Go to <a href="https://huggingface.co/CompVis">CompVis</a> and download latest model, for example <a href="https://huggingface.co/CompVis/stable-diffusion-v1-4">1.4</a> and unpack it to ex:<pre><code class="language-bash">GIT\StableDiffusion\models\Stable-diffusion
</code></pre>
after that restart the server by restarting Anaconda prompt and<pre><code class="language-bash">webui-user.bat
</code></pre>
</li>
</ol>
</li>
<li>Alternative defaults worth trying out:
<ol>
<li>Try <strong>euler a</strong> (Ancestral Euler) with higher <strong>Sampling Steps</strong> ex: 40 or others with 100.</li>
<li>Set “Settings &gt; User interface &gt; Show image creation progress every N sampling steps” to 1 and pick a deterministic <strong>Seed</strong> value. Can visually see how image diffusion happens and record a .gif with <a href="https://github.com/NickeManarin/ScreenToGif">ScreenToGif</a>.</li>
<li>Use <strong>Restore faces</strong>. Generally, better results, but that quality comes at the cost of speed.</li>
</ol>
</li>
</ul>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# Automatic Installation
## Windows (method 1)
> A very basic guide to get Stable Diffusion web UI up and running on Windows 10/11 NVIDIA GPU.
1. Download the `sd.webui.zip` from [here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.0.0-pre), this package is from `v1.0.0-pre` we will update it to the latest webui version in step 3.
2. Extract the zip file at your desired location.
3. Double click the `update.bat` to update web UI to the latest version, wait till finish then close the window.
4. Double click the `run.bat` to launch web UI, during the first launch it will download large amounts of files. After everything has been downloaded and installed correctly, you should see a message "`Running on local URL: http://127.0.0.1:7860`", opening the link will present you with the web UI interface.
> you should be able to start generating images
### Extra configurations via `COMMANDLINE_ARGS`
There are some configuration options that you may want apply to web UI, in order to configure these options you need to edit the launch script found at `sd.webui\webui\webui-user.bat`, edit the file add the selected arguments after `set COMMANDLINE_ARGS=` like so :
```bat
set COMMANDLINE_ARGS=--autolaunch --update-check
```
> Each individual argument need to separated by a space, the above example well configure web UI to auto launch the browser page after it completes loading, and also check for new version of web UI at launch.
### Troubleshooting
The default configuration of web UI should run on most modern GPU, but in some cases you may need some extra arguments to allow it to work properly.
1. For GPU with less amounts of VRAM, you may need `--medvram` or `--lowvram`, these optimizations reduces VRAM requirements but sacrifice performance. If you do not have enough VRAM, web UI may refuse to launch or fail to generate images due to an out-of-memory error. The amount of VRAM required largely depends the desired image resolution, for more details see [Troubleshooting](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Troubleshooting).
> the [Tiled VAE](https://github.com/pkuliyi2015/multidiffusion-upscaler-for-automatic1111) extension can help to reduce the VRAM requirement.
2. If your generated results in resulting in a black or green image, try adding `--precision full` and `--no-half`.
3. Some combinations of model and VAE are prone to produce `NansException: A tensor with all NaNs was produced in VAE` resulting in a black image, using the option `--no-half-vae` may help to mitigate this issue.
### Extra Options
1. There are several cross attenuation optimization methods such as `--xformers` or `--opt-sdp-attention`, these can drastically increase performance see [Optimizations](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Optimizations) for more details, experiment with different options as different hardware are suited for different optimizations. If you wish to measure your system's performance, try using [sd-extension-system-info](https://github.com/vladmandic/sd-extension-system-info) extension which features a benchmarking tool and a [database](https://vladmandic.github.io/sd-extension-system-info/pages/benchmark.html) of user submitted results.
2. add `--autolaunch` to have web UI launch the web browser automatically after web UI has started up.
3. add `--update-check` will notify you when there's a new version of webui.
4. See [Command Line Arguments and Settings
](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings) for more configuration options.
### Tip
If you already have stable diffusion models downloaded, you can move the models into `sd.webui\webui\models\Stable-diffusion\` before running `run.bat` in step 3, this will skip auto downloading the vanilla [stable-diffusion-v1-5 model](https://huggingface.co/runwayml/stable-diffusion-v1-5) model.
## Windows (method 2)
1. Install [Python 3.10.6](https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe) (ticking **Add to PATH**), and [git](https://github.com/git-for-windows/git/releases/download/v2.39.2.windows.1/Git-2.39.2-64-bit.exe)
2. Open Command Prompt from search bar, and type `git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui`
3. Double click `webui-user.bat`
Installation video in case you get stuck: \
<sup>solves [#8229](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/8229)</sup>
<details><summary>Video: (Click to expand:)</summary>
https://user-images.githubusercontent.com/98228077/223032534-c5dd5b13-a4b6-47a7-995c-27ed8ba8b3e7.mp4
</details>
<details><summary>Alternative Powershell launch scripts:</summary>
**webui.ps1**
```
if ($env:PYTHON -eq "" -or $env:PYTHON -eq $null) {
$PYTHON = "Python.exe"
} else {
$PYTHON = $env:PYTHON
}
if ($env:VENV_DIR -eq "" -or $env:VENV_DIR -eq $null) {
$VENV_DIR = "$PSScriptRoot\venv"
} else {
$VENV_DIR = $env:VENV_DIR
}
if ($env:LAUNCH_SCRIPT -eq "" -or $env:LAUNCH_SCRIPT -eq $null) {
$LAUNCH_SCRIPT = "$PSScriptRoot\launch.py"
} else {
$LAUNCH_SCRIPT = $env:LAUNCH_SCRIPT
}
$ERROR_REPORTING = $false
mkdir tmp 2>$null
function Start-Venv {
if ($VENV_DIR -eq '-') {
Skip-Venv
}
if (Test-Path -Path "$VENV_DIR\Scripts\$python") {
Activate-Venv
} else {
$PYTHON_FULLNAME = & $PYTHON -c "import sys; print(sys.executable)"
Write-Output "Creating venv in directory $VENV_DIR using python $PYTHON_FULLNAME"
Invoke-Expression "$PYTHON_FULLNAME -m venv $VENV_DIR > tmp/stdout.txt 2> tmp/stderr.txt"
if ($LASTEXITCODE -eq 0) {
Activate-Venv
} else {
Write-Output "Unable to create venv in directory $VENV_DIR"
}
}
}
function Activate-Venv {
$PYTHON = "$VENV_DIR\Scripts\Python.exe"
$ACTIVATE = "$VENV_DIR\Scripts\activate.bat"
Invoke-Expression "cmd.exe /c $ACTIVATE"
Write-Output "Venv set to $VENV_DIR."
if ($ACCELERATE -eq 'True') {
Check-Accelerate
} else {
Launch-App
}
}
function Skip-Venv {
Write-Output "Venv set to $VENV_DIR."
if ($ACCELERATE -eq 'True') {
Check-Accelerate
} else {
Launch-App
}
}
function Check-Accelerate {
Write-Output 'Checking for accelerate'
$ACCELERATE = "$VENV_DIR\Scripts\accelerate.exe"
if (Test-Path -Path $ACCELERATE) {
Accelerate-Launch
} else {
Launch-App
}
}
function Launch-App {
Write-Output "Launching with python"
Invoke-Expression "$PYTHON $LAUNCH_SCRIPT"
#pause
exit
}
function Accelerate-Launch {
Write-Output 'Accelerating'
Invoke-Expression "$ACCELERATE launch --num_cpu_threads_per_process=6 $LAUNCH_SCRIPT"
#pause
exit
}
try {
if(Get-Command $PYTHON){
Start-Venv
}
} Catch {
Write-Output "Couldn't launch python."
}
```
**webui-user.ps1**
```
[Environment]::SetEnvironmentVariable("PYTHON", "")
[Environment]::SetEnvironmentVariable("GIT", "")
[Environment]::SetEnvironmentVariable("VENV_DIR","")
# Commandline arguments for webui.py, for example: [Environment]::SetEnvironmentVariable("COMMANDLINE_ARGS", "--medvram --opt-split-attention")
[Environment]::SetEnvironmentVariable("COMMANDLINE_ARGS", "")
# script to launch to start the app
# [Environment]::SetEnvironmentVariable("LAUNCH_SCRIPT", "launch.py")
# install command for torch
# [Environment]::SetEnvironmentVariable("TORCH_COMMAND", "pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 --extra-index-url https://download.pytorch.org/whl/cu113")
# Requirements file to use for stable-diffusion-webui
# [Environment]::SetEnvironmentVariable("REQS_FILE", "requirements_versions.txt")
# [Environment]::SetEnvironmentVariable("GFPGAN_PACKAGE", "")
# [Environment]::SetEnvironmentVariable("CLIP_PACKAGE", "")
# [Environment]::SetEnvironmentVariable("OPENCLIP_PACKAGE", "")
# URL to a WHL if you wish to override default xformers windows
# [Environment]::SetEnvironmentVariable("XFORMERS_WINDOWS_PACKAGE", "")
# Uncomment and set to enable an alternate repository URL
# [Environment]::SetEnvironmentVariable("STABLE_DIFFUSION_REPO", "")
# [Environment]::SetEnvironmentVariable("TAMING_TRANSFORMERS_REPO", "")
# [Environment]::SetEnvironmentVariable("K_DIFFUSION_REPO", "")
# [Environment]::SetEnvironmentVariable("CODEFORMER_REPO", "")
# [Environment]::SetEnvironmentVariable("BLIP_REPO", "")
# Uncomment and set to enable a specific revision of a repository
# [Environment]::SetEnvironmentVariable("STABLE_DIFFUSION_COMMIT_HASH", "")
# [Environment]::SetEnvironmentVariable("TAMING_TRANSFORMERS_COMMIT_HASH", "")
# [Environment]::SetEnvironmentVariable("K_DIFFUSION_COMMIT_HASH", "")
# [Environment]::SetEnvironmentVariable("CODEFORMER_COMMIT_HASH", "")
# [Environment]::SetEnvironmentVariable("BLIP_COMMIT_HASH", "")
# Uncomment to enable accelerated launch
# [Environment]::SetEnvironmentVariable("ACCELERATE", "True")
$SCRIPT = "$PSScriptRoot\webui.ps1"
Invoke-Expression "$SCRIPT"
```
</details>
See [Troubleshooting](Troubleshooting) section for what to do if things go wrong.
## Linux
(Debian-based)
1. Enter these commands, which will install webui to your current directory:
```
sudo apt install git python3.10-venv -y
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui && cd stable-diffusion-webui
python3.10 -m venv venv
```
2. Install and run with:
./webui.sh {your_arguments}
<details><summary>Other Distributions:</summary>
(Arch-based)
sudo pacman -S git python3 -y && git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui && cd stable-diffusion-webui && ./webui.sh
(Red Hat-based)
sudo dnf install git python3 -y && git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui && cd stable-diffusion-webui && ./webui.sh
</details>
<details><summary>For Installing Python 3.10</summary>
Some distribution have older/newer system python versions than python 3.10.
```
cd stable-diffusion-webui
sudo pacman -S pyenv
pyenv install 3.10.6
pyenv local 3.10.6
python -m venv
```
</details>
## Third party installation guides/scripts:
- NixOS: https://github.com/virchau13/automatic1111-webui-nix
## Install and run without virtual environment
To install the required packages via pip without creating a virtual environment, run:
```bash
python launch.py
```
Command line arguments may be passed directly, for example:
```bash
python launch.py --opt-split-attention --ckpt ../secret/anime9999.ckpt
```
# Manual Installation
Manual installation is very outdated and probably won't work. check colab in the repo's readme for instructions.
The following process installs everything manually on both Windows or Linux (the latter requiring `dir` to be replaced by `ls`):
```bash
# install torch with CUDA support. See https://pytorch.org/get-started/locally/ for more instructions if this fails.
pip install torch --extra-index-url https://download.pytorch.org/whl/cu113
# check if torch supports GPU; this must output "True". You need CUDA 11. installed for this. You might be able to use
# a different version, but this is what I tested.
python -c "import torch; print(torch.cuda.is_available())"
# clone web ui and go into its directory
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
# clone repositories for Stable Diffusion and (optionally) CodeFormer
mkdir repositories
git clone https://github.com/CompVis/stable-diffusion.git repositories/stable-diffusion-stability-ai
git clone https://github.com/CompVis/taming-transformers.git repositories/taming-transformers
git clone https://github.com/sczhou/CodeFormer.git repositories/CodeFormer
git clone https://github.com/salesforce/BLIP.git repositories/BLIP
# install requirements of Stable Diffusion
pip install transformers==4.19.2 diffusers invisible-watermark --prefer-binary
# install k-diffusion
pip install git+https://github.com/crowsonkb/k-diffusion.git --prefer-binary
# (optional) install GFPGAN (face restoration)
pip install git+https://github.com/TencentARC/GFPGAN.git --prefer-binary
# (optional) install requirements for CodeFormer (face restoration)
pip install -r repositories/CodeFormer/requirements.txt --prefer-binary
# install requirements of web ui
pip install -r requirements.txt --prefer-binary
# update numpy to latest version
pip install -U numpy --prefer-binary
# (outside of command line) put stable diffusion model into web ui directory
# the command below must output something like: 1 File(s) 4,265,380,512 bytes
dir model.ckpt
```
The installation is finished, to start the web ui, run:
```bash
python webui.py
```
# Windows 11 WSL2 instructions
To install under a Linux distro in Windows 11's WSL2:
```bash
# install conda (if not already done)
wget https://repo.anaconda.com/archive/Anaconda3-2022.05-Linux-x86_64.sh
chmod +x Anaconda3-2022.05-Linux-x86_64.sh
./Anaconda3-2022.05-Linux-x86_64.sh
# Clone webui repo
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
cd stable-diffusion-webui
# Create and activate conda env
conda env create -f environment-wsl2.yaml
conda activate automatic
```
At this point, the instructions for the Manual installation may be applied starting at step `# clone repositories for Stable Diffusion and (optionally) CodeFormer`.
# Alternative installation on Windows using Conda
- Prerequisites _*(Only needed if you do not have them)*_. Assumes [Chocolatey](https://chocolatey.org/install) is installed.
```bash
# install git
choco install git
# install conda
choco install anaconda3
```
Optional parameters: [git](https://community.chocolatey.org/packages/git), [conda](https://community.chocolatey.org/packages/anaconda3)
- Install (warning: some files exceed multiple gigabytes, make sure you have space first)
1. Download as .zip and extract or use git to clone.
```bash
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
```
2. Launch the Anaconda prompt. It should be noted that you can use older Python versions, but you may be forced to manually remove features like cache optimization, which will degrade your performance.
```bash
# Navigate to the git directory
cd "GIT\StableDiffusion"
# Create environment
conda create -n StableDiffusion python=3.10.6
# Activate environment
conda activate StableDiffusion
# Validate environment is selected
conda env list
# Start local webserver
webui-user.bat
# Wait for "Running on local URL: http://127.0.0.1:7860" and open that URI.
```
3. _*(Optional)*_ Go to [CompVis](https://huggingface.co/CompVis) and download latest model, for example [1.4](https://huggingface.co/CompVis/stable-diffusion-v1-4) and unpack it to ex:
```bash
GIT\StableDiffusion\models\Stable-diffusion
```
after that restart the server by restarting Anaconda prompt and
```bash
webui-user.bat
```
- Alternative defaults worth trying out:
1. Try **euler a** (Ancestral Euler) with higher **Sampling Steps** ex: 40 or others with 100.
2. Set "Settings > User interface > Show image creation progress every N sampling steps" to 1 and pick a deterministic **Seed** value. Can visually see how image diffusion happens and record a .gif with [ScreenToGif](https://github.com/NickeManarin/ScreenToGif).
3. Use **Restore faces**. Generally, better results, but that quality comes at the cost of speed.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Installation-on-Apple-Silicon.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>Mac users: Please provide feedback on if these instructions do or don’t work for you, and if anything is unclear or you are otherwise still having problems with your install that are not currently <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/5461">mentioned here</a>.</p>
<h2>Important notes</h2>
<p>Currently most functionality in the web UI works correctly on macOS, with the most notable exceptions being CLIP interrogator and training. Although training does seem to work, it is incredibly slow and consumes an excessive amount of memory. CLIP interrogator can be used but it doesn’t work correctly with the GPU acceleration macOS uses so the default configuration will run it entirely via CPU (which is slow).</p>
<p>Most samplers are known to work with the only exception being the PLMS sampler when using the Stable Diffusion 2.0 model. Generated images with GPU acceleration on macOS should usually match or almost match generated images on CPU with the same settings and seed.</p>
<h2>Automatic installation</h2>
<h3>New install:</h3>
<ol>
<li>If Homebrew is not installed, follow the instructions at <a href="https://brew.sh">https://brew.sh</a> to install it. Keep the terminal window open and follow the instructions under “Next steps” to add Homebrew to your PATH.</li>
<li>Open a new terminal window and run <code>brew install cmake protobuf rust python@3.10 git wget</code></li>
<li>Clone the web UI repository by running <code>git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui</code></li>
<li>Place Stable Diffusion models/checkpoints you want to use into <code>stable-diffusion-webui/models/Stable-diffusion</code>. If you don’t have any, see <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon#downloading-stable-diffusion-models">Downloading Stable Diffusion Models</a> below.</li>
<li><code>cd stable-diffusion-webui</code> and then <code>./webui.sh</code> to run the web UI. A Python virtual environment will be created and activated using venv and any remaining missing dependencies will be automatically downloaded and installed.</li>
<li>To relaunch the web UI process later, run <code>./webui.sh</code> again. Note that it doesn’t auto update the web UI; to update, run <code>git pull</code> before running <code>./webui.sh</code>.</li>
</ol>
<h3>Existing Install:</h3>
<p>If you have an existing install of web UI that was created with <code>setup_mac.sh</code>, delete the <code>run_webui_mac.sh</code> file and <code>repositories</code> folder from your <code>stable-diffusion-webui</code> folder. Then run <code>git pull</code> to update web UI and then <code>./webui.sh</code> to run it.</p>
<h2>Downloading Stable Diffusion Models</h2>
<p>If you don’t have any models to use, Stable Diffusion models can be downloaded from <a href="https://huggingface.co/models?pipeline_tag=text-to-image&amp;sort=downloads">Hugging Face</a>. To download, click on a model and then click on the <code>Files and versions</code> header. Look for files listed with the “.ckpt” or “.safetensors” extensions, and then click the down arrow to the right of the file size to download them.</p>
<p>Some popular official Stable Diffusion models are:</p>
<ul>
<li><a href="https://huggingface.co/CompVis/stable-diffusion-v-1-4-original">Stable DIffusion 1.4</a> (<a href="https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt">sd-v1-4.ckpt</a>)</li>
<li><a href="https://huggingface.co/runwayml/stable-diffusion-v1-5">Stable Diffusion 1.5</a> (<a href="https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt">v1-5-pruned-emaonly.ckpt</a>)</li>
<li><a href="https://huggingface.co/runwayml/stable-diffusion-inpainting">Stable Diffusion 1.5 Inpainting</a> (<a href="https://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt">sd-v1-5-inpainting.ckpt</a>)</li>
</ul>
<p>Stable Diffusion 2.0 and 2.1 require both a model and a configuration file, and image width &amp; height will need to be set to 768 or higher when generating images:</p>
<ul>
<li><a href="https://huggingface.co/stabilityai/stable-diffusion-2">Stable Diffusion 2.0</a> (<a href="https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.ckpt">768-v-ema.ckpt</a>)</li>
<li><a href="https://huggingface.co/stabilityai/stable-diffusion-2-1">Stable Diffusion 2.1</a> (<a href="https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt">v2-1_768-ema-pruned.ckpt</a>)</li>
</ul>
<p>For the configuration file, hold down the option key on the keyboard and click <a href="https://github.com/Stability-AI/stablediffusion/raw/main/configs/stable-diffusion/v2-inference-v.yaml">here</a> to download <code>v2-inference-v.yaml</code> (it may download as <code>v2-inference-v.yaml.yml</code>). In Finder select that file then go to the menu and select <code>File</code> &gt; <code>Get Info</code>. In the window that appears select the filename and change it to the filename of the model, except with the file extension <code>.yaml</code> instead of <code>.ckpt</code>, press return on the keyboard (confirm changing the file extension if prompted), and place it in the same folder as the model (e.g. if you downloaded the <code>768-v-ema.ckpt</code> model, rename it to <code>768-v-ema.yaml</code> and put it in <code>stable-diffusion-webui/models/Stable-diffusion</code> along with the model).</p>
<p>Also available is a <a href="https://huggingface.co/stabilityai/stable-diffusion-2-depth">Stable Diffusion 2.0 depth model</a> (<a href="https://huggingface.co/stabilityai/stable-diffusion-2-depth/resolve/main/512-depth-ema.ckpt">512-depth-ema.ckpt</a>). Download the <code>v2-midas-inference.yaml</code> configuration file by holding down option on the keyboard and clicking <a href="https://github.com/Stability-AI/stablediffusion/raw/main/configs/stable-diffusion/v2-midas-inference.yaml">here</a>, then rename it with the <code>.yaml</code> extension in the same way as mentioned above and put it in <code>stable-diffusion-webui/models/Stable-diffusion</code> along with the model. Note that this model works at image dimensions of 512 width/height or higher instead of 768.</p>
<h2>Troubleshooting</h2>
<h3>Web UI Won’t Start:</h3>
<p>If you encounter errors when trying to start the Web UI with <code>./webui.sh</code>, try deleting the <code>repositories</code> and <code>venv</code> folders from your <code>stable-diffusion-webui</code> folder and then update web UI with <code>git pull</code> before running <code>./webui.sh</code> again.</p>
<h3>Poor Performance:</h3>
<p>Currently GPU acceleration on macOS uses a <em>lot</em> of memory. If performance is poor (if it takes more than a minute to generate a 512x512 image with 20 steps with any sampler)</p>
<ul>
<li>Try starting with the <code>--opt-split-attention-v1</code> command line option (i.e. <code>./webui.sh --opt-split-attention-v1</code>) and see if that helps.</li>
<li>Doesn’t make much difference?
<ul>
<li>Open the Activity Monitor application located in /Applications/Utilities and check the memory pressure graph under the Memory tab. Memory pressure is being displayed in red when an image is generated</li>
<li>Close the web UI process and then add the <code>--medvram</code> command line option (i.e. <code>./webui.sh --opt-split-attention-v1 --medvram</code>).</li>
</ul>
</li>
<li>Performance is still poor and memory pressure still red with that option?
<ul>
<li>Try <code>--lowvram</code> (i.e. <code>./webui.sh --opt-split-attention-v1 --lowvram</code>).</li>
</ul>
</li>
<li>Still takes more than a few minutes to generate a 512x512 image with 20 steps with with any sampler?
<ul>
<li>You may need to turn off GPU acceleration.
<ul>
<li>Open <code>webui-user.sh</code> in Xcode</li>
<li>Change <code>#export COMMANDLINE_ARGS=&quot;&quot;</code> to <code>export COMMANDLINE_ARGS=&quot;--skip-torch-cuda-test --no-half --use-cpu all&quot;</code>.</li>
</ul>
</li>
</ul>
</li>
</ul>
<hr>
<p>Discussions/Feedback here: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/5461">https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/5461</a></p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
Mac users: Please provide feedback on if these instructions do or don't work for you, and if anything is unclear or you are otherwise still having problems with your install that are not currently [mentioned here](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/5461).
Important notes
------
Currently most functionality in the web UI works correctly on macOS, with the most notable exceptions being CLIP interrogator and training. Although training does seem to work, it is incredibly slow and consumes an excessive amount of memory. CLIP interrogator can be used but it doesn't work correctly with the GPU acceleration macOS uses so the default configuration will run it entirely via CPU (which is slow).
Most samplers are known to work with the only exception being the PLMS sampler when using the Stable Diffusion 2.0 model. Generated images with GPU acceleration on macOS should usually match or almost match generated images on CPU with the same settings and seed.
Automatic installation
------
### New install:
1. If Homebrew is not installed, follow the instructions at https://brew.sh to install it. Keep the terminal window open and follow the instructions under "Next steps" to add Homebrew to your PATH.
2. Open a new terminal window and run `brew install cmake protobuf rust python@3.10 git wget`
3. Clone the web UI repository by running `git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui`
4. Place Stable Diffusion models/checkpoints you want to use into `stable-diffusion-webui/models/Stable-diffusion`. If you don't have any, see [Downloading Stable Diffusion Models](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Installation-on-Apple-Silicon#downloading-stable-diffusion-models) below.
5. `cd stable-diffusion-webui` and then `./webui.sh` to run the web UI. A Python virtual environment will be created and activated using venv and any remaining missing dependencies will be automatically downloaded and installed.
6. To relaunch the web UI process later, run `./webui.sh` again. Note that it doesn't auto update the web UI; to update, run `git pull` before running `./webui.sh`.
### Existing Install:
If you have an existing install of web UI that was created with `setup_mac.sh`, delete the `run_webui_mac.sh` file and `repositories` folder from your `stable-diffusion-webui` folder. Then run `git pull` to update web UI and then `./webui.sh` to run it.
Downloading Stable Diffusion Models
------
If you don't have any models to use, Stable Diffusion models can be downloaded from [Hugging Face](https://huggingface.co/models?pipeline_tag=text-to-image&sort=downloads). To download, click on a model and then click on the `Files and versions` header. Look for files listed with the ".ckpt" or ".safetensors" extensions, and then click the down arrow to the right of the file size to download them.
Some popular official Stable Diffusion models are:
* [Stable DIffusion 1.4](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original) ([sd-v1-4.ckpt](https://huggingface.co/CompVis/stable-diffusion-v-1-4-original/resolve/main/sd-v1-4.ckpt))
* [Stable Diffusion 1.5](https://huggingface.co/runwayml/stable-diffusion-v1-5) ([v1-5-pruned-emaonly.ckpt](https://huggingface.co/runwayml/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.ckpt))
* [Stable Diffusion 1.5 Inpainting](https://huggingface.co/runwayml/stable-diffusion-inpainting) ([sd-v1-5-inpainting.ckpt](https://huggingface.co/runwayml/stable-diffusion-inpainting/resolve/main/sd-v1-5-inpainting.ckpt))
Stable Diffusion 2.0 and 2.1 require both a model and a configuration file, and image width & height will need to be set to 768 or higher when generating images:
* [Stable Diffusion 2.0](https://huggingface.co/stabilityai/stable-diffusion-2) ([768-v-ema.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2/resolve/main/768-v-ema.ckpt))
* [Stable Diffusion 2.1](https://huggingface.co/stabilityai/stable-diffusion-2-1) ([v2-1_768-ema-pruned.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2-1/resolve/main/v2-1_768-ema-pruned.ckpt))
For the configuration file, hold down the option key on the keyboard and click [here](https://github.com/Stability-AI/stablediffusion/raw/main/configs/stable-diffusion/v2-inference-v.yaml) to download `v2-inference-v.yaml` (it may download as `v2-inference-v.yaml.yml`). In Finder select that file then go to the menu and select `File` > `Get Info`. In the window that appears select the filename and change it to the filename of the model, except with the file extension `.yaml` instead of `.ckpt`, press return on the keyboard (confirm changing the file extension if prompted), and place it in the same folder as the model (e.g. if you downloaded the `768-v-ema.ckpt` model, rename it to `768-v-ema.yaml` and put it in `stable-diffusion-webui/models/Stable-diffusion` along with the model).
Also available is a [Stable Diffusion 2.0 depth model](https://huggingface.co/stabilityai/stable-diffusion-2-depth) ([512-depth-ema.ckpt](https://huggingface.co/stabilityai/stable-diffusion-2-depth/resolve/main/512-depth-ema.ckpt)). Download the `v2-midas-inference.yaml` configuration file by holding down option on the keyboard and clicking [here](https://github.com/Stability-AI/stablediffusion/raw/main/configs/stable-diffusion/v2-midas-inference.yaml), then rename it with the `.yaml` extension in the same way as mentioned above and put it in `stable-diffusion-webui/models/Stable-diffusion` along with the model. Note that this model works at image dimensions of 512 width/height or higher instead of 768.
Troubleshooting
------
### Web UI Won't Start:
If you encounter errors when trying to start the Web UI with `./webui.sh`, try deleting the `repositories` and `venv` folders from your `stable-diffusion-webui` folder and then update web UI with `git pull` before running `./webui.sh` again.
### Poor Performance:
Currently GPU acceleration on macOS uses a _lot_ of memory. If performance is poor (if it takes more than a minute to generate a 512x512 image with 20 steps with any sampler)
- Try starting with the `--opt-split-attention-v1` command line option (i.e. `./webui.sh --opt-split-attention-v1`) and see if that helps.
- Doesn't make much difference?
- Open the Activity Monitor application located in /Applications/Utilities and check the memory pressure graph under the Memory tab. Memory pressure is being displayed in red when an image is generated
- Close the web UI process and then add the `--medvram` command line option (i.e. `./webui.sh --opt-split-attention-v1 --medvram`).
- Performance is still poor and memory pressure still red with that option?
- Try `--lowvram` (i.e. `./webui.sh --opt-split-attention-v1 --lowvram`).
- Still takes more than a few minutes to generate a 512x512 image with 20 steps with with any sampler?
- You may need to turn off GPU acceleration.
- Open `webui-user.sh` in Xcode
- Change `#export COMMANDLINE_ARGS=""` to `export COMMANDLINE_ARGS="--skip-torch-cuda-test --no-half --use-cpu all"`.
------
Discussions/Feedback here: https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/5461
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>List-of-Time-Zones.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>You can generate the list of valid time zones by running this Python Script</p>
<pre><code class="language-py"><span class="hljs-keyword">import</span> pytz
<span class="hljs-keyword">for</span> tz <span class="hljs-keyword">in</span> pytz.all_timezones:
print(tz)
</code></pre>
<p>Or you can reference this pre-generated list (might be outdated).</p>
<pre><code>Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Ceuta
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/Douala
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
Africa/Juba
Africa/Kampala
Africa/Khartoum
Africa/Kigali
Africa/Kinshasa
Africa/Lagos
Africa/Libreville
Africa/Lome
Africa/Luanda
Africa/Lubumbashi
Africa/Lusaka
Africa/Malabo
Africa/Maputo
Africa/Maseru
Africa/Mbabane
Africa/Mogadishu
Africa/Monrovia
Africa/Nairobi
Africa/Ndjamena
Africa/Niamey
Africa/Nouakchott
Africa/Ouagadougou
Africa/Porto-Novo
Africa/Sao_Tome
Africa/Timbuktu
Africa/Tripoli
Africa/Tunis
Africa/Windhoek
America/Adak
America/Anchorage
America/Anguilla
America/Antigua
America/Araguaina
America/Argentina/Buenos_Aires
America/Argentina/Catamarca
America/Argentina/ComodRivadavia
America/Argentina/Cordoba
America/Argentina/Jujuy
America/Argentina/La_Rioja
America/Argentina/Mendoza
America/Argentina/Rio_Gallegos
America/Argentina/Salta
America/Argentina/San_Juan
America/Argentina/San_Luis
America/Argentina/Tucuman
America/Argentina/Ushuaia
America/Aruba
America/Asuncion
America/Atikokan
America/Atka
America/Bahia
America/Bahia_Banderas
America/Barbados
America/Belem
America/Belize
America/Blanc-Sablon
America/Boa_Vista
America/Bogota
America/Boise
America/Buenos_Aires
America/Cambridge_Bay
America/Campo_Grande
America/Cancun
America/Caracas
America/Catamarca
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Ciudad_Juarez
America/Coral_Harbour
America/Cordoba
America/Costa_Rica
America/Creston
America/Cuiaba
America/Curacao
America/Danmarkshavn
America/Dawson
America/Dawson_Creek
America/Denver
America/Detroit
America/Dominica
America/Edmonton
America/Eirunepe
America/El_Salvador
America/Ensenada
America/Fort_Nelson
America/Fort_Wayne
America/Fortaleza
America/Glace_Bay
America/Godthab
America/Goose_Bay
America/Grand_Turk
America/Grenada
America/Guadeloupe
America/Guatemala
America/Guayaquil
America/Guyana
America/Halifax
America/Havana
America/Hermosillo
America/Indiana/Indianapolis
America/Indiana/Knox
America/Indiana/Marengo
America/Indiana/Petersburg
America/Indiana/Tell_City
America/Indiana/Vevay
America/Indiana/Vincennes
America/Indiana/Winamac
America/Indianapolis
America/Inuvik
America/Iqaluit
America/Jamaica
America/Jujuy
America/Juneau
America/Kentucky/Louisville
America/Kentucky/Monticello
America/Knox_IN
America/Kralendijk
America/La_Paz
America/Lima
America/Los_Angeles
America/Louisville
America/Lower_Princes
America/Maceio
America/Managua
America/Manaus
America/Marigot
America/Martinique
America/Matamoros
America/Mazatlan
America/Mendoza
America/Menominee
America/Merida
America/Metlakatla
America/Mexico_City
America/Miquelon
America/Moncton
America/Monterrey
America/Montevideo
America/Montreal
America/Montserrat
America/Nassau
America/New_York
America/Nipigon
America/Nome
America/Noronha
America/North_Dakota/Beulah
America/North_Dakota/Center
America/North_Dakota/New_Salem
America/Nuuk
America/Ojinaga
America/Panama
America/Pangnirtung
America/Paramaribo
America/Phoenix
America/Port-au-Prince
America/Port_of_Spain
America/Porto_Acre
America/Porto_Velho
America/Puerto_Rico
America/Punta_Arenas
America/Rainy_River
America/Rankin_Inlet
America/Recife
America/Regina
America/Resolute
America/Rio_Branco
America/Rosario
America/Santa_Isabel
America/Santarem
America/Santiago
America/Santo_Domingo
America/Sao_Paulo
America/Scoresbysund
America/Shiprock
America/Sitka
America/St_Barthelemy
America/St_Johns
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Swift_Current
America/Tegucigalpa
America/Thule
America/Thunder_Bay
America/Tijuana
America/Toronto
America/Tortola
America/Vancouver
America/Virgin
America/Whitehorse
America/Winnipeg
America/Yakutat
America/Yellowknife
Antarctica/Casey
Antarctica/Davis
Antarctica/DumontDUrville
Antarctica/Macquarie
Antarctica/Mawson
Antarctica/McMurdo
Antarctica/Palmer
Antarctica/Rothera
Antarctica/South_Pole
Antarctica/Syowa
Antarctica/Troll
Antarctica/Vostok
Arctic/Longyearbyen
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Anadyr
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Ashkhabad
Asia/Atyrau
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok
Asia/Barnaul
Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Calcutta
Asia/Chita
Asia/Choibalsan
Asia/Chongqing
Asia/Chungking
Asia/Colombo
Asia/Dacca
Asia/Damascus
Asia/Dhaka
Asia/Dili
Asia/Dubai
Asia/Dushanbe
Asia/Famagusta
Asia/Gaza
Asia/Harbin
Asia/Hebron
Asia/Ho_Chi_Minh
Asia/Hong_Kong
Asia/Hovd
Asia/Irkutsk
Asia/Istanbul
Asia/Jakarta
Asia/Jayapura
Asia/Jerusalem
Asia/Kabul
Asia/Kamchatka
Asia/Karachi
Asia/Kashgar
Asia/Kathmandu
Asia/Katmandu
Asia/Khandyga
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Kuwait
Asia/Macao
Asia/Macau
Asia/Magadan
Asia/Makassar
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novokuznetsk
Asia/Novosibirsk
Asia/Omsk
Asia/Oral
Asia/Phnom_Penh
Asia/Pontianak
Asia/Pyongyang
Asia/Qatar
Asia/Qostanay
Asia/Qyzylorda
Asia/Rangoon
Asia/Riyadh
Asia/Saigon
Asia/Sakhalin
Asia/Samarkand
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Srednekolymsk
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Tel_Aviv
Asia/Thimbu
Asia/Thimphu
Asia/Tokyo
Asia/Tomsk
Asia/Ujung_Pandang
Asia/Ulaanbaatar
Asia/Ulan_Bator
Asia/Urumqi
Asia/Ust-Nera
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yangon
Asia/Yekaterinburg
Asia/Yerevan
Atlantic/Azores
Atlantic/Bermuda
Atlantic/Canary
Atlantic/Cape_Verde
Atlantic/Faeroe
Atlantic/Faroe
Atlantic/Jan_Mayen
Atlantic/Madeira
Atlantic/Reykjavik
Atlantic/South_Georgia
Atlantic/St_Helena
Atlantic/Stanley
Australia/ACT
Australia/Adelaide
Australia/Brisbane
Australia/Broken_Hill
Australia/Canberra
Australia/Currie
Australia/Darwin
Australia/Eucla
Australia/Hobart
Australia/LHI
Australia/Lindeman
Australia/Lord_Howe
Australia/Melbourne
Australia/NSW
Australia/North
Australia/Perth
Australia/Queensland
Australia/South
Australia/Sydney
Australia/Tasmania
Australia/Victoria
Australia/West
Australia/Yancowinna
Brazil/Acre
Brazil/DeNoronha
Brazil/East
Brazil/West
CET
CST6CDT
Canada/Atlantic
Canada/Central
Canada/Eastern
Canada/Mountain
Canada/Newfoundland
Canada/Pacific
Canada/Saskatchewan
Canada/Yukon
Chile/Continental
Chile/EasterIsland
Cuba
EET
EST
EST5EDT
Egypt
Eire
Etc/GMT
Etc/GMT+0
Etc/GMT+1
Etc/GMT+10
Etc/GMT+11
Etc/GMT+12
Etc/GMT+2
Etc/GMT+3
Etc/GMT+4
Etc/GMT+5
Etc/GMT+6
Etc/GMT+7
Etc/GMT+8
Etc/GMT+9
Etc/GMT-0
Etc/GMT-1
Etc/GMT-10
Etc/GMT-11
Etc/GMT-12
Etc/GMT-13
Etc/GMT-14
Etc/GMT-2
Etc/GMT-3
Etc/GMT-4
Etc/GMT-5
Etc/GMT-6
Etc/GMT-7
Etc/GMT-8
Etc/GMT-9
Etc/GMT0
Etc/Greenwich
Etc/UCT
Etc/UTC
Etc/Universal
Etc/Zulu
Europe/Amsterdam
Europe/Andorra
Europe/Astrakhan
Europe/Athens
Europe/Belfast
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Busingen
Europe/Chisinau
Europe/Copenhagen
Europe/Dublin
Europe/Gibraltar
Europe/Guernsey
Europe/Helsinki
Europe/Isle_of_Man
Europe/Istanbul
Europe/Jersey
Europe/Kaliningrad
Europe/Kiev
Europe/Kirov
Europe/Kyiv
Europe/Lisbon
Europe/Ljubljana
Europe/London
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Mariehamn
Europe/Minsk
Europe/Monaco
Europe/Moscow
Europe/Nicosia
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Samara
Europe/San_Marino
Europe/Sarajevo
Europe/Saratov
Europe/Simferopol
Europe/Skopje
Europe/Sofia
Europe/Stockholm
Europe/Tallinn
Europe/Tirane
Europe/Tiraspol
Europe/Ulyanovsk
Europe/Uzhgorod
Europe/Vaduz
Europe/Vatican
Europe/Vienna
Europe/Vilnius
Europe/Volgograd
Europe/Warsaw
Europe/Zagreb
Europe/Zaporozhye
Europe/Zurich
GB
GB-Eire
GMT
GMT+0
GMT-0
GMT0
Greenwich
HST
Hongkong
Iceland
Indian/Antananarivo
Indian/Chagos
Indian/Christmas
Indian/Cocos
Indian/Comoro
Indian/Kerguelen
Indian/Mahe
Indian/Maldives
Indian/Mauritius
Indian/Mayotte
Indian/Reunion
Iran
Israel
Jamaica
Japan
Kwajalein
Libya
MET
MST
MST7MDT
Mexico/BajaNorte
Mexico/BajaSur
Mexico/General
NZ
NZ-CHAT
Navajo
PRC
PST8PDT
Pacific/Apia
Pacific/Auckland
Pacific/Bougainville
Pacific/Chatham
Pacific/Chuuk
Pacific/Easter
Pacific/Efate
Pacific/Enderbury
Pacific/Fakaofo
Pacific/Fiji
Pacific/Funafuti
Pacific/Galapagos
Pacific/Gambier
Pacific/Guadalcanal
Pacific/Guam
Pacific/Honolulu
Pacific/Johnston
Pacific/Kanton
Pacific/Kiritimati
Pacific/Kosrae
Pacific/Kwajalein
Pacific/Majuro
Pacific/Marquesas
Pacific/Midway
Pacific/Nauru
Pacific/Niue
Pacific/Norfolk
Pacific/Noumea
Pacific/Pago_Pago
Pacific/Palau
Pacific/Pitcairn
Pacific/Pohnpei
Pacific/Ponape
Pacific/Port_Moresby
Pacific/Rarotonga
Pacific/Saipan
Pacific/Samoa
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Truk
Pacific/Wake
Pacific/Wallis
Pacific/Yap
Poland
Portugal
ROC
ROK
Singapore
Turkey
UCT
US/Alaska
US/Aleutian
US/Arizona
US/Central
US/East-Indiana
US/Eastern
US/Hawaii
US/Indiana-Starke
US/Michigan
US/Mountain
US/Pacific
US/Samoa
UTC
Universal
W-SU
WET
Zulu
</code></pre>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
You can generate the list of valid time zones by running this Python Script
```py
import pytz
for tz in pytz.all_timezones:
print(tz)
```
Or you can reference this pre-generated list (might be outdated).
```
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
Africa/Blantyre
Africa/Brazzaville
Africa/Bujumbura
Africa/Cairo
Africa/Casablanca
Africa/Ceuta
Africa/Conakry
Africa/Dakar
Africa/Dar_es_Salaam
Africa/Djibouti
Africa/Douala
Africa/El_Aaiun
Africa/Freetown
Africa/Gaborone
Africa/Harare
Africa/Johannesburg
Africa/Juba
Africa/Kampala
Africa/Khartoum
Africa/Kigali
Africa/Kinshasa
Africa/Lagos
Africa/Libreville
Africa/Lome
Africa/Luanda
Africa/Lubumbashi
Africa/Lusaka
Africa/Malabo
Africa/Maputo
Africa/Maseru
Africa/Mbabane
Africa/Mogadishu
Africa/Monrovia
Africa/Nairobi
Africa/Ndjamena
Africa/Niamey
Africa/Nouakchott
Africa/Ouagadougou
Africa/Porto-Novo
Africa/Sao_Tome
Africa/Timbuktu
Africa/Tripoli
Africa/Tunis
Africa/Windhoek
America/Adak
America/Anchorage
America/Anguilla
America/Antigua
America/Araguaina
America/Argentina/Buenos_Aires
America/Argentina/Catamarca
America/Argentina/ComodRivadavia
America/Argentina/Cordoba
America/Argentina/Jujuy
America/Argentina/La_Rioja
America/Argentina/Mendoza
America/Argentina/Rio_Gallegos
America/Argentina/Salta
America/Argentina/San_Juan
America/Argentina/San_Luis
America/Argentina/Tucuman
America/Argentina/Ushuaia
America/Aruba
America/Asuncion
America/Atikokan
America/Atka
America/Bahia
America/Bahia_Banderas
America/Barbados
America/Belem
America/Belize
America/Blanc-Sablon
America/Boa_Vista
America/Bogota
America/Boise
America/Buenos_Aires
America/Cambridge_Bay
America/Campo_Grande
America/Cancun
America/Caracas
America/Catamarca
America/Cayenne
America/Cayman
America/Chicago
America/Chihuahua
America/Ciudad_Juarez
America/Coral_Harbour
America/Cordoba
America/Costa_Rica
America/Creston
America/Cuiaba
America/Curacao
America/Danmarkshavn
America/Dawson
America/Dawson_Creek
America/Denver
America/Detroit
America/Dominica
America/Edmonton
America/Eirunepe
America/El_Salvador
America/Ensenada
America/Fort_Nelson
America/Fort_Wayne
America/Fortaleza
America/Glace_Bay
America/Godthab
America/Goose_Bay
America/Grand_Turk
America/Grenada
America/Guadeloupe
America/Guatemala
America/Guayaquil
America/Guyana
America/Halifax
America/Havana
America/Hermosillo
America/Indiana/Indianapolis
America/Indiana/Knox
America/Indiana/Marengo
America/Indiana/Petersburg
America/Indiana/Tell_City
America/Indiana/Vevay
America/Indiana/Vincennes
America/Indiana/Winamac
America/Indianapolis
America/Inuvik
America/Iqaluit
America/Jamaica
America/Jujuy
America/Juneau
America/Kentucky/Louisville
America/Kentucky/Monticello
America/Knox_IN
America/Kralendijk
America/La_Paz
America/Lima
America/Los_Angeles
America/Louisville
America/Lower_Princes
America/Maceio
America/Managua
America/Manaus
America/Marigot
America/Martinique
America/Matamoros
America/Mazatlan
America/Mendoza
America/Menominee
America/Merida
America/Metlakatla
America/Mexico_City
America/Miquelon
America/Moncton
America/Monterrey
America/Montevideo
America/Montreal
America/Montserrat
America/Nassau
America/New_York
America/Nipigon
America/Nome
America/Noronha
America/North_Dakota/Beulah
America/North_Dakota/Center
America/North_Dakota/New_Salem
America/Nuuk
America/Ojinaga
America/Panama
America/Pangnirtung
America/Paramaribo
America/Phoenix
America/Port-au-Prince
America/Port_of_Spain
America/Porto_Acre
America/Porto_Velho
America/Puerto_Rico
America/Punta_Arenas
America/Rainy_River
America/Rankin_Inlet
America/Recife
America/Regina
America/Resolute
America/Rio_Branco
America/Rosario
America/Santa_Isabel
America/Santarem
America/Santiago
America/Santo_Domingo
America/Sao_Paulo
America/Scoresbysund
America/Shiprock
America/Sitka
America/St_Barthelemy
America/St_Johns
America/St_Kitts
America/St_Lucia
America/St_Thomas
America/St_Vincent
America/Swift_Current
America/Tegucigalpa
America/Thule
America/Thunder_Bay
America/Tijuana
America/Toronto
America/Tortola
America/Vancouver
America/Virgin
America/Whitehorse
America/Winnipeg
America/Yakutat
America/Yellowknife
Antarctica/Casey
Antarctica/Davis
Antarctica/DumontDUrville
Antarctica/Macquarie
Antarctica/Mawson
Antarctica/McMurdo
Antarctica/Palmer
Antarctica/Rothera
Antarctica/South_Pole
Antarctica/Syowa
Antarctica/Troll
Antarctica/Vostok
Arctic/Longyearbyen
Asia/Aden
Asia/Almaty
Asia/Amman
Asia/Anadyr
Asia/Aqtau
Asia/Aqtobe
Asia/Ashgabat
Asia/Ashkhabad
Asia/Atyrau
Asia/Baghdad
Asia/Bahrain
Asia/Baku
Asia/Bangkok
Asia/Barnaul
Asia/Beirut
Asia/Bishkek
Asia/Brunei
Asia/Calcutta
Asia/Chita
Asia/Choibalsan
Asia/Chongqing
Asia/Chungking
Asia/Colombo
Asia/Dacca
Asia/Damascus
Asia/Dhaka
Asia/Dili
Asia/Dubai
Asia/Dushanbe
Asia/Famagusta
Asia/Gaza
Asia/Harbin
Asia/Hebron
Asia/Ho_Chi_Minh
Asia/Hong_Kong
Asia/Hovd
Asia/Irkutsk
Asia/Istanbul
Asia/Jakarta
Asia/Jayapura
Asia/Jerusalem
Asia/Kabul
Asia/Kamchatka
Asia/Karachi
Asia/Kashgar
Asia/Kathmandu
Asia/Katmandu
Asia/Khandyga
Asia/Kolkata
Asia/Krasnoyarsk
Asia/Kuala_Lumpur
Asia/Kuching
Asia/Kuwait
Asia/Macao
Asia/Macau
Asia/Magadan
Asia/Makassar
Asia/Manila
Asia/Muscat
Asia/Nicosia
Asia/Novokuznetsk
Asia/Novosibirsk
Asia/Omsk
Asia/Oral
Asia/Phnom_Penh
Asia/Pontianak
Asia/Pyongyang
Asia/Qatar
Asia/Qostanay
Asia/Qyzylorda
Asia/Rangoon
Asia/Riyadh
Asia/Saigon
Asia/Sakhalin
Asia/Samarkand
Asia/Seoul
Asia/Shanghai
Asia/Singapore
Asia/Srednekolymsk
Asia/Taipei
Asia/Tashkent
Asia/Tbilisi
Asia/Tehran
Asia/Tel_Aviv
Asia/Thimbu
Asia/Thimphu
Asia/Tokyo
Asia/Tomsk
Asia/Ujung_Pandang
Asia/Ulaanbaatar
Asia/Ulan_Bator
Asia/Urumqi
Asia/Ust-Nera
Asia/Vientiane
Asia/Vladivostok
Asia/Yakutsk
Asia/Yangon
Asia/Yekaterinburg
Asia/Yerevan
Atlantic/Azores
Atlantic/Bermuda
Atlantic/Canary
Atlantic/Cape_Verde
Atlantic/Faeroe
Atlantic/Faroe
Atlantic/Jan_Mayen
Atlantic/Madeira
Atlantic/Reykjavik
Atlantic/South_Georgia
Atlantic/St_Helena
Atlantic/Stanley
Australia/ACT
Australia/Adelaide
Australia/Brisbane
Australia/Broken_Hill
Australia/Canberra
Australia/Currie
Australia/Darwin
Australia/Eucla
Australia/Hobart
Australia/LHI
Australia/Lindeman
Australia/Lord_Howe
Australia/Melbourne
Australia/NSW
Australia/North
Australia/Perth
Australia/Queensland
Australia/South
Australia/Sydney
Australia/Tasmania
Australia/Victoria
Australia/West
Australia/Yancowinna
Brazil/Acre
Brazil/DeNoronha
Brazil/East
Brazil/West
CET
CST6CDT
Canada/Atlantic
Canada/Central
Canada/Eastern
Canada/Mountain
Canada/Newfoundland
Canada/Pacific
Canada/Saskatchewan
Canada/Yukon
Chile/Continental
Chile/EasterIsland
Cuba
EET
EST
EST5EDT
Egypt
Eire
Etc/GMT
Etc/GMT+0
Etc/GMT+1
Etc/GMT+10
Etc/GMT+11
Etc/GMT+12
Etc/GMT+2
Etc/GMT+3
Etc/GMT+4
Etc/GMT+5
Etc/GMT+6
Etc/GMT+7
Etc/GMT+8
Etc/GMT+9
Etc/GMT-0
Etc/GMT-1
Etc/GMT-10
Etc/GMT-11
Etc/GMT-12
Etc/GMT-13
Etc/GMT-14
Etc/GMT-2
Etc/GMT-3
Etc/GMT-4
Etc/GMT-5
Etc/GMT-6
Etc/GMT-7
Etc/GMT-8
Etc/GMT-9
Etc/GMT0
Etc/Greenwich
Etc/UCT
Etc/UTC
Etc/Universal
Etc/Zulu
Europe/Amsterdam
Europe/Andorra
Europe/Astrakhan
Europe/Athens
Europe/Belfast
Europe/Belgrade
Europe/Berlin
Europe/Bratislava
Europe/Brussels
Europe/Bucharest
Europe/Budapest
Europe/Busingen
Europe/Chisinau
Europe/Copenhagen
Europe/Dublin
Europe/Gibraltar
Europe/Guernsey
Europe/Helsinki
Europe/Isle_of_Man
Europe/Istanbul
Europe/Jersey
Europe/Kaliningrad
Europe/Kiev
Europe/Kirov
Europe/Kyiv
Europe/Lisbon
Europe/Ljubljana
Europe/London
Europe/Luxembourg
Europe/Madrid
Europe/Malta
Europe/Mariehamn
Europe/Minsk
Europe/Monaco
Europe/Moscow
Europe/Nicosia
Europe/Oslo
Europe/Paris
Europe/Podgorica
Europe/Prague
Europe/Riga
Europe/Rome
Europe/Samara
Europe/San_Marino
Europe/Sarajevo
Europe/Saratov
Europe/Simferopol
Europe/Skopje
Europe/Sofia
Europe/Stockholm
Europe/Tallinn
Europe/Tirane
Europe/Tiraspol
Europe/Ulyanovsk
Europe/Uzhgorod
Europe/Vaduz
Europe/Vatican
Europe/Vienna
Europe/Vilnius
Europe/Volgograd
Europe/Warsaw
Europe/Zagreb
Europe/Zaporozhye
Europe/Zurich
GB
GB-Eire
GMT
GMT+0
GMT-0
GMT0
Greenwich
HST
Hongkong
Iceland
Indian/Antananarivo
Indian/Chagos
Indian/Christmas
Indian/Cocos
Indian/Comoro
Indian/Kerguelen
Indian/Mahe
Indian/Maldives
Indian/Mauritius
Indian/Mayotte
Indian/Reunion
Iran
Israel
Jamaica
Japan
Kwajalein
Libya
MET
MST
MST7MDT
Mexico/BajaNorte
Mexico/BajaSur
Mexico/General
NZ
NZ-CHAT
Navajo
PRC
PST8PDT
Pacific/Apia
Pacific/Auckland
Pacific/Bougainville
Pacific/Chatham
Pacific/Chuuk
Pacific/Easter
Pacific/Efate
Pacific/Enderbury
Pacific/Fakaofo
Pacific/Fiji
Pacific/Funafuti
Pacific/Galapagos
Pacific/Gambier
Pacific/Guadalcanal
Pacific/Guam
Pacific/Honolulu
Pacific/Johnston
Pacific/Kanton
Pacific/Kiritimati
Pacific/Kosrae
Pacific/Kwajalein
Pacific/Majuro
Pacific/Marquesas
Pacific/Midway
Pacific/Nauru
Pacific/Niue
Pacific/Norfolk
Pacific/Noumea
Pacific/Pago_Pago
Pacific/Palau
Pacific/Pitcairn
Pacific/Pohnpei
Pacific/Ponape
Pacific/Port_Moresby
Pacific/Rarotonga
Pacific/Saipan
Pacific/Samoa
Pacific/Tahiti
Pacific/Tarawa
Pacific/Tongatapu
Pacific/Truk
Pacific/Wake
Pacific/Wallis
Pacific/Yap
Poland
Portugal
ROC
ROK
Singapore
Turkey
UCT
US/Alaska
US/Aleutian
US/Arizona
US/Central
US/East-Indiana
US/Eastern
US/Hawaii
US/Indiana-Starke
US/Michigan
US/Mountain
US/Pacific
US/Samoa
UTC
Universal
W-SU
WET
Zulu
```
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Using localization files</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>Using localization files</h1>
<p>The intended way to do localizations now is via extensions. See:
<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions">https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions</a></p>
<h1>Creating localization files</h1>
<p>Go to Settings/Actions and click <code>Download localization template</code> button at the bottom. This will download a template for localization that you can edit.</p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# Using localization files
The intended way to do localizations now is via extensions. See:
https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Developing-extensions
# Creating localization files
Go to Settings/Actions and click `Download localization template` button at the bottom. This will download a template for localization that you can edit.
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Negative-prompt.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>Negative prompt is a way to use the Stable Diffusion in a way that allows the user to specify what he doesn’t want to see, without any extra load or requirements for the model. As far as I know, I was the first to use this approach; the commit that adds it is <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/757bb7c46b20651853ee23e3109ac4f9fb06a061">757bb7c4</a>. The feature has found extreme popularity among users who remove the usual deformities of Stable Diffusion like extra limbs with it. In addition to just being able to specify what you don’t want to see, which sometimes is possible via usual prompt, and sometimes isn’t, this allows you to do that without using any of your allowance of 75 tokens the prompt consists of.</p>
<p>The way negative prompt works is by using user-specified text instead of empty string for <code>unconditional_conditioning</code> when doing sampling.</p>
<p>Here’s the (simplified) code from <a href="https://github.com/CompVis/stable-diffusion/blob/main/scripts/txt2img.py">txt2img.py</a>:</p>
<pre><code class="language-python"><span class="hljs-comment"># prompts = ["a castle in a forest"]</span>
<span class="hljs-comment"># batch_size = 1</span>
c = model.get_learned_conditioning(prompts)
uc = model.get_learned_conditioning(batch_size * [<span class="hljs-string">""</span>])
samples_ddim, _ = sampler.sample(conditioning=c, unconditional_conditioning=uc, [...])
</code></pre>
<p>This launches the sampler that repeatedly:</p>
<ul>
<li>de-noises the picture guiding it to look more like your prompt (conditioning)</li>
<li>de-noises the picture guiding it to look more like an empty prompt (unconditional_conditioning)</li>
<li>looks at difference between those and uses it to produce a set of changes for the noisy picture (different samplers do that part differently)</li>
</ul>
<p>To use negative prompt, all that’s needed is this:</p>
<pre><code class="language-python"><span class="hljs-comment"># prompts = ["a castle in a forest"]</span>
<span class="hljs-comment"># negative_prompts = ["grainy, fog"]</span>
c = model.get_learned_conditioning(prompts)
uc = model.get_learned_conditioning(negative_prompts)
samples_ddim, _ = sampler.sample(conditioning=c, unconditional_conditioning=uc, [...])
</code></pre>
<p>The sampler then will look at differences between image de-noised to look like your prompt (a castle), and an image de-noised to look like your negative prompt (grainy, fog), and try to move the final results towards the former and away from latter.</p>
<h3>Examples:</h3>
<pre><code>a colorful photo of a castle in the middle of a forest with trees and (((bushes))), by Ismail Inceoglu, ((((shadows)))), ((((high contrast)))), dynamic shading, ((hdr)), detailed vegetation, digital painting, digital drawing, detailed painting, a detailed digital painting, gothic art, featured on deviantart
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 749109862, Size: 896x448, Model hash: 7460a6fa
</code></pre>
<table>
<thead>
<tr>
<th>negative prompt</th>
<th>image</th>
</tr>
</thead>
<tbody>
<tr>
<td>none</td>
<td><img src="https://user-images.githubusercontent.com/20920490/192156368-18360487-0dcf-4b7d-b57e-b3fa80a81f1a.png" alt="01069-749109862"></td>
</tr>
<tr>
<td>fog</td>
<td><img src="https://user-images.githubusercontent.com/20920490/192156405-9c43ba8c-4eb8-415d-9f4d-902c8cf69b6d.png" alt="01070-749109862"></td>
</tr>
<tr>
<td>grainy</td>
<td><img src="https://user-images.githubusercontent.com/20920490/192156421-17e53296-df5c-4e82-bf9a-f1ca562d3ad0.png" alt="01071-749109862"></td>
</tr>
<tr>
<td>fog, grainy</td>
<td><img src="https://user-images.githubusercontent.com/20920490/192156430-3d05e5c4-2b86-409c-a357-a31178e0cb30.png" alt="01072-749109862"></td>
</tr>
<tr>
<td>fog, grainy, purple</td>
<td><img src="https://user-images.githubusercontent.com/20920490/192156440-ec59abe8-1a18-4372-a100-0da8bc1f8d13.png" alt="01073-749109862"></td>
</tr>
</tbody>
</table>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
Negative prompt is a way to use the Stable Diffusion in a way that allows the user to specify what he doesn't want to see, without any extra load or requirements for the model. As far as I know, I was the first to use this approach; the commit that adds it is [757bb7c4](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/757bb7c46b20651853ee23e3109ac4f9fb06a061). The feature has found extreme popularity among users who remove the usual deformities of Stable Diffusion like extra limbs with it. In addition to just being able to specify what you don't want to see, which sometimes is possible via usual prompt, and sometimes isn't, this allows you to do that without using any of your allowance of 75 tokens the prompt consists of.
The way negative prompt works is by using user-specified text instead of empty string for `unconditional_conditioning` when doing sampling.
Here's the (simplified) code from [txt2img.py](https://github.com/CompVis/stable-diffusion/blob/main/scripts/txt2img.py):
```python
# prompts = ["a castle in a forest"]
# batch_size = 1
c = model.get_learned_conditioning(prompts)
uc = model.get_learned_conditioning(batch_size * [""])
samples_ddim, _ = sampler.sample(conditioning=c, unconditional_conditioning=uc, [...])
```
This launches the sampler that repeatedly:
- de-noises the picture guiding it to look more like your prompt (conditioning)
- de-noises the picture guiding it to look more like an empty prompt (unconditional_conditioning)
- looks at difference between those and uses it to produce a set of changes for the noisy picture (different samplers do that part differently)
To use negative prompt, all that's needed is this:
```python
# prompts = ["a castle in a forest"]
# negative_prompts = ["grainy, fog"]
c = model.get_learned_conditioning(prompts)
uc = model.get_learned_conditioning(negative_prompts)
samples_ddim, _ = sampler.sample(conditioning=c, unconditional_conditioning=uc, [...])
```
The sampler then will look at differences between image de-noised to look like your prompt (a castle), and an image de-noised to look like your negative prompt (grainy, fog), and try to move the final results towards the former and away from latter.
### Examples:
```
a colorful photo of a castle in the middle of a forest with trees and (((bushes))), by Ismail Inceoglu, ((((shadows)))), ((((high contrast)))), dynamic shading, ((hdr)), detailed vegetation, digital painting, digital drawing, detailed painting, a detailed digital painting, gothic art, featured on deviantart
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 749109862, Size: 896x448, Model hash: 7460a6fa
```
| negative prompt | image |
|---------------------|---------------------------------------------------------------------------------------------------------------------------|
| none | ![01069-749109862](https://user-images.githubusercontent.com/20920490/192156368-18360487-0dcf-4b7d-b57e-b3fa80a81f1a.png) |
| fog | ![01070-749109862](https://user-images.githubusercontent.com/20920490/192156405-9c43ba8c-4eb8-415d-9f4d-902c8cf69b6d.png) |
| grainy | ![01071-749109862](https://user-images.githubusercontent.com/20920490/192156421-17e53296-df5c-4e82-bf9a-f1ca562d3ad0.png) |
| fog, grainy | ![01072-749109862](https://user-images.githubusercontent.com/20920490/192156430-3d05e5c4-2b86-409c-a357-a31178e0cb30.png) |
| fog, grainy, purple | ![01073-749109862](https://user-images.githubusercontent.com/20920490/192156440-ec59abe8-1a18-4372-a100-0da8bc1f8d13.png) |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Online-Services.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h2>Google Colab</h2>
<ul>
<li><a href="https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb">maintained by TheLastBen</a></li>
<li><a href="https://github.com/camenduru/stable-diffusion-webui-colab">maintained by camenduru</a></li>
<li><a href="https://github.com/ddPn08/automatic1111-colab">maintained by ddPn08</a></li>
<li><a href="https://colab.research.google.com/drive/1kw3egmSn-KgWsikYvOMjJkVDsPLjEMzl">maintained by Akaibu</a></li>
<li><a href="https://colab.research.google.com/drive/1Iy-xW9t1-OQWhb0hNxueGij8phCyluOh">Colab, original by me, outdated</a>.</li>
</ul>
<h2>Paperspace</h2>
<ul>
<li><a href="https://github.com/Engineer-of-Stuff/stable-diffusion-paperspace">maintained by Cyberes</a></li>
</ul>
<h2>SageMaker Studio Lab</h2>
<ul>
<li><a href="https://github.com/Miraculix200/StableDiffusionUI_SageMakerSL/blob/main/StableDiffusionUI_SageMakerSL.ipynb">maintained by fractality</a></li>
</ul>
<h2>Docker</h2>
<ul>
<li><a href="https://github.com/camenduru/stable-diffusion-webui-docker">maintained by camenduru</a></li>
<li><a href="https://github.com/AbdBarho/stable-diffusion-webui-docker">maintained by AbdBarho</a></li>
</ul>
<h2>Installation Guides</h2>
<ul>
<li><a href="https://vladiliescu.net/stable-diffusion-web-ui-on-azure-ml/">azure-ml</a> - (<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/44c46f0ed395967cd3830dd481a2db759fda5b3b">commit</a>)</li>
</ul>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
## Google Colab
- [maintained by TheLastBen](https://colab.research.google.com/github/TheLastBen/fast-stable-diffusion/blob/main/fast_stable_diffusion_AUTOMATIC1111.ipynb)
- [maintained by camenduru](https://github.com/camenduru/stable-diffusion-webui-colab)
- [maintained by ddPn08](https://github.com/ddPn08/automatic1111-colab)
- [maintained by Akaibu](https://colab.research.google.com/drive/1kw3egmSn-KgWsikYvOMjJkVDsPLjEMzl)
- [Colab, original by me, outdated](https://colab.research.google.com/drive/1Iy-xW9t1-OQWhb0hNxueGij8phCyluOh).
## Paperspace
- [maintained by Cyberes](https://github.com/Engineer-of-Stuff/stable-diffusion-paperspace)
## SageMaker Studio Lab
- [maintained by fractality](https://github.com/Miraculix200/StableDiffusionUI_SageMakerSL/blob/main/StableDiffusionUI_SageMakerSL.ipynb)
## Docker
- [maintained by camenduru](https://github.com/camenduru/stable-diffusion-webui-docker)
- [maintained by AbdBarho](https://github.com/AbdBarho/stable-diffusion-webui-docker)
## Installation Guides
- [azure-ml](https://vladiliescu.net/stable-diffusion-web-ui-on-azure-ml/) - ([commit](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/44c46f0ed395967cd3830dd481a2db759fda5b3b))
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Optimizations.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>A number of optimization can be enabled by <a href="Command-Line-Arguments-And-Settings">commandline arguments</a>:</p>
<table>
<thead>
<tr>
<th>commandline argument</th>
<th>explanation</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>--opt-sdp-attention</code></td>
<td>May results in faster speeds than using xFormers on some systems but requires more VRAM. (non-deterministic)</td>
</tr>
<tr>
<td><code>--opt-sdp-no-mem-attention</code></td>
<td>May results in faster speeds than using xFormers on some systems but requires more VRAM. (deterministic, slightly slower than <code>--opt-sdp-attention</code> and uses more VRAM)</td>
</tr>
<tr>
<td><code>--xformers</code></td>
<td>Use <a href="https://github.com/facebookresearch/xformers">xFormers</a> library. Great improvement to memory consumption and speed. Nvidia GPUs only. (non-deterministic)</td>
</tr>
<tr>
<td><code>--force-enable-xformers</code></td>
<td>Enables xFormers regardless of whether the program thinks you can run it or not. Do not report bugs you get running this.</td>
</tr>
<tr>
<td><code>--opt-split-attention</code></td>
<td>Cross attention layer optimization significantly reducing memory use for almost no cost (some report improved performance with it). Black magic. <br/>On by default for <code>torch.cuda</code>, which includes both NVidia and AMD cards.</td>
</tr>
<tr>
<td><code>--disable-opt-split-attention</code></td>
<td>Disables the optimization above.</td>
</tr>
<tr>
<td><code>--opt-sub-quad-attention</code></td>
<td>Sub-quadratic attention, a memory efficient Cross Attention layer optimization that can significantly reduce required memory, sometimes at a slight performance cost. Recommended if getting poor performance or failed generations with a hardware/software configuration that xFormers doesn’t work for. On macOS, this will also allow for generation of larger images.</td>
</tr>
<tr>
<td><code>--opt-split-attention-v1</code></td>
<td>Uses an older version of the optimization above that is not as memory hungry (it will use less VRAM, but will be more limiting in the maximum size of pictures you can make).</td>
</tr>
<tr>
<td><code>--medvram</code></td>
<td>Makes the Stable Diffusion model consume less VRAM by splitting it into three parts - cond (for transforming text into numerical representation), first_stage (for converting a picture into latent space and back), and unet (for actual denoising of latent space) and making it so that only one is in VRAM at all times, sending others to CPU RAM. Lowers performance, but only by a bit - except if live previews are enabled.</td>
</tr>
<tr>
<td><code>--lowvram</code></td>
<td>An even more thorough optimization of the above, splitting unet into many modules, and only one module is kept in VRAM. Devastating for performance.</td>
</tr>
<tr>
<td><code>*do-not-batch-cond-uncond</code></td>
<td>Prevents batching of positive and negative prompts during sampling, which essentially lets you run at 0.5 batch size, saving a lot of memory. Decreases performance. Not a command line option, but an optimization implicitly enabled by using <code>--medvram</code> or <code>--lowvram</code>.</td>
</tr>
<tr>
<td><code>--always-batch-cond-uncond</code></td>
<td>Disables the optimization above. Only makes sense together with <code>--medvram</code> or <code>--lowvram</code></td>
</tr>
<tr>
<td><code>--opt-channelslast</code></td>
<td>Changes torch memory type for stable diffusion to channels last. Effects not closely studied.</td>
</tr>
<tr>
<td><code>--upcast-sampling</code></td>
<td>For Nvidia and AMD cards normally forced to run with <code>--no-half</code>, <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8782">should improve generation speed</a>.</td>
</tr>
</tbody>
</table>
<p>As of <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.3.0">version 1.3.0</a>, <code>Cross attention optimization</code> can be selected under settings. xFormers still needs to enabled via <code>COMMANDLINE_ARGS</code>.
<img src="https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/40751091/c72576e1-0f51-4643-ad91-e9aaec4fc125" alt="2023-06-21 22_53_54_877 chrome"></p>
<p>Extra tips (Windows):</p>
<ul>
<li><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/3889">https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/3889</a> Disable Hardware GPU scheduling.</li>
<li>disable browser hardware acceleration</li>
<li>Go in nvidia control panel, 3d parameters, and change power profile to “maximum performance”</li>
</ul>
<h2>Memory &amp; Performance Impact of Optimizers and Flags</h2>
<p><em>This is an example test using specific hardware and configuration, your mileage may vary</em><br>
<em>Tested using nVidia RTX3060 and CUDA 11.7</em></p>
<table>
<thead>
<tr>
<th>Cross-attention</th>
<th>Peak Memory at Batch size 1/2/4/8/16</th>
<th>Initial It/s</th>
<th>Peak It/s</th>
<th>Note</th>
</tr>
</thead>
<tbody>
<tr>
<td>None</td>
<td>4.1 / 6.2 / OOM / OOM / OOM</td>
<td>4.2</td>
<td>4.6</td>
<td>slow and early out-of-memory</td>
</tr>
<tr>
<td>v1</td>
<td>2.8 / 2.8 / 2.8 / 3.1 / 4.1</td>
<td>4.1</td>
<td>4.7</td>
<td>slow but lowest memory usage and does not require sometimes problematic xFormers</td>
</tr>
<tr>
<td>InvokeAI</td>
<td>3.1 / 4.2 / 6.3 / 6.6 / 7.0</td>
<td>5.5</td>
<td>6.6</td>
<td>almost identical to default optimizer</td>
</tr>
<tr>
<td>Doggetx</td>
<td>3.1 / 4.2 / 6.3 / 6.6 / 7.1</td>
<td>5.4</td>
<td>6.6</td>
<td>default</td>
</tr>
<tr>
<td>Doggetx</td>
<td>2.2 / 2.7 / 3.8 / 5.9 / 6.2</td>
<td>4.1</td>
<td>6.3</td>
<td>using <code>medvram</code> preset result in decent memory savings without huge performance hit</td>
</tr>
<tr>
<td>Doggetx</td>
<td>0.9 / 1.1 / 2.2 / 4.3 / 6.4</td>
<td>1.0</td>
<td>6.3</td>
<td>using <code>lowvram</code> preset is extremely slow due to constant swapping</td>
</tr>
<tr>
<td>xFormers</td>
<td>2.8 / 2.8 / 2.8 / 3.1 / 4.1</td>
<td>6.5</td>
<td>7.5</td>
<td>fastest and low memory</td>
</tr>
<tr>
<td>xFormers</td>
<td>2.9 / 2.9 / 2.9 / 3.6 / 4.1</td>
<td>6.4</td>
<td>7.6</td>
<td>with <code>cuda_alloc_conf</code> and <code>opt-channelslast</code></td>
</tr>
</tbody>
</table>
<p>Notes:</p>
<ul>
<li>Performance at batch-size 1 is around <strong>~70%</strong> of peak performance</li>
<li>Peak performance is typically around batch size 8<br>
After that it grows by few percent if you have extra VRAM before it starts to drop due to GC kicking in</li>
<li>Performance with <code>lowvram</code> preset is very low below batch size 8 and by then memory savings are not that big</li>
</ul>
<p>Other possible optimizations:</p>
<ul>
<li>adding <code>set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512</code> in <code>webui-user.bat</code><br>
No performance impact and increases initial memory footprint a bit but reduces memory fragmentation in long runs</li>
<li><code>opt-channelslast</code><br>
Hit-and-miss: seems like additional slight performance increase with higher batch sizes and slower with small sizes, but differences are within margin-of-error</li>
</ul>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
A number of optimization can be enabled by [commandline arguments](Command-Line-Arguments-And-Settings):
| commandline argument | explanation |
|--------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `--opt-sdp-attention` | May results in faster speeds than using xFormers on some systems but requires more VRAM. (non-deterministic)
| `--opt-sdp-no-mem-attention` | May results in faster speeds than using xFormers on some systems but requires more VRAM. (deterministic, slightly slower than `--opt-sdp-attention` and uses more VRAM)
| `--xformers` | Use [xFormers](https://github.com/facebookresearch/xformers) library. Great improvement to memory consumption and speed. Nvidia GPUs only. (non-deterministic) |
| `--force-enable-xformers` | Enables xFormers regardless of whether the program thinks you can run it or not. Do not report bugs you get running this. |
| `--opt-split-attention` | Cross attention layer optimization significantly reducing memory use for almost no cost (some report improved performance with it). Black magic. <br/>On by default for `torch.cuda`, which includes both NVidia and AMD cards. |
| `--disable-opt-split-attention` | Disables the optimization above. |
| `--opt-sub-quad-attention` | Sub-quadratic attention, a memory efficient Cross Attention layer optimization that can significantly reduce required memory, sometimes at a slight performance cost. Recommended if getting poor performance or failed generations with a hardware/software configuration that xFormers doesn't work for. On macOS, this will also allow for generation of larger images. |
| `--opt-split-attention-v1` | Uses an older version of the optimization above that is not as memory hungry (it will use less VRAM, but will be more limiting in the maximum size of pictures you can make). |
| `--medvram` | Makes the Stable Diffusion model consume less VRAM by splitting it into three parts - cond (for transforming text into numerical representation), first_stage (for converting a picture into latent space and back), and unet (for actual denoising of latent space) and making it so that only one is in VRAM at all times, sending others to CPU RAM. Lowers performance, but only by a bit - except if live previews are enabled. |
| `--lowvram` | An even more thorough optimization of the above, splitting unet into many modules, and only one module is kept in VRAM. Devastating for performance. |
| `*do-not-batch-cond-uncond` | Prevents batching of positive and negative prompts during sampling, which essentially lets you run at 0.5 batch size, saving a lot of memory. Decreases performance. Not a command line option, but an optimization implicitly enabled by using `--medvram` or `--lowvram`. |
| `--always-batch-cond-uncond` | Disables the optimization above. Only makes sense together with `--medvram` or `--lowvram` |
| `--opt-channelslast` | Changes torch memory type for stable diffusion to channels last. Effects not closely studied. |
| `--upcast-sampling` | For Nvidia and AMD cards normally forced to run with `--no-half`, [should improve generation speed](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/8782).
As of [version 1.3.0](https://github.com/AUTOMATIC1111/stable-diffusion-webui/releases/tag/v1.3.0), `Cross attention optimization` can be selected under settings. xFormers still needs to enabled via `COMMANDLINE_ARGS`.
![2023-06-21 22_53_54_877 chrome](https://github.com/AUTOMATIC1111/stable-diffusion-webui/assets/40751091/c72576e1-0f51-4643-ad91-e9aaec4fc125)
Extra tips (Windows):
- https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/3889 Disable Hardware GPU scheduling.
- disable browser hardware acceleration
- Go in nvidia control panel, 3d parameters, and change power profile to "maximum performance"
## Memory & Performance Impact of Optimizers and Flags
*This is an example test using specific hardware and configuration, your mileage may vary*
*Tested using nVidia RTX3060 and CUDA 11.7*
| Cross-attention | Peak Memory at Batch size 1/2/4/8/16 | Initial It/s | Peak It/s | Note |
| --------------- | ------------------------------------ | -------- | --------- | ---- |
| None | 4.1 / 6.2 / OOM / OOM / OOM | 4.2 | 4.6 | slow and early out-of-memory
| v1 | 2.8 / 2.8 / 2.8 / 3.1 / 4.1 | 4.1 | 4.7 | slow but lowest memory usage and does not require sometimes problematic xFormers
| InvokeAI | 3.1 / 4.2 / 6.3 / 6.6 / 7.0 | 5.5 | 6.6 | almost identical to default optimizer
| Doggetx | 3.1 / 4.2 / 6.3 / 6.6 / 7.1 | 5.4 | 6.6 | default |
| Doggetx | 2.2 / 2.7 / 3.8 / 5.9 / 6.2 | 4.1 | 6.3 | using `medvram` preset result in decent memory savings without huge performance hit
| Doggetx | 0.9 / 1.1 / 2.2 / 4.3 / 6.4 | 1.0 | 6.3 | using `lowvram` preset is extremely slow due to constant swapping
| xFormers | 2.8 / 2.8 / 2.8 / 3.1 / 4.1 | 6.5 | 7.5 | fastest and low memory
| xFormers | 2.9 / 2.9 / 2.9 / 3.6 / 4.1 | 6.4 | 7.6 | with `cuda_alloc_conf` and `opt-channelslast`
Notes:
- Performance at batch-size 1 is around **~70%** of peak performance
- Peak performance is typically around batch size 8
After that it grows by few percent if you have extra VRAM before it starts to drop due to GC kicking in
- Performance with `lowvram` preset is very low below batch size 8 and by then memory savings are not that big
Other possible optimizations:
- adding `set PYTORCH_CUDA_ALLOC_CONF=garbage_collection_threshold:0.9,max_split_size_mb:512` in `webui-user.bat`
No performance impact and increases initial memory footprint a bit but reduces memory fragmentation in long runs
- `opt-channelslast`
Hit-and-miss: seems like additional slight performance increase with higher batch sizes and slower with small sizes, but differences are within margin-of-error
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Seed-breaking-changes.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h2><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/9669">2023-04-29</a> - Fix prompt schedule for second order samplers</h2>
<p>Second order samplers (Heun, DPM2/a, DPM++ 2S/a, DPM++ SDE / Karras) cause the prompt schedule to run twice as fast when prompting something like <code>[dog:cat:0.5]</code> (i.e. for 100 steps, prompt is <code>dog</code> until step 25, <code>cat</code> until 50, and remains <code>dog</code> until 100). This fixes that by checking if the sampler is any of these second order samplers and multiplies the step count by 2 for calculating the prompt schedule.</p>
<h2><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/80b26d2a69617b75d2d01c1e6b7d11445815ed4d">2023-03-26</a> - Apply LoRA by altering layer’s weights</h2>
<p>TLDR: produces pictures are a little bit different. If using highres fix, those small differences can be amplified into big ones.</p>
<p>New method introduced in <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/80b26d2a69617b75d2d01c1e6b7d11445815ed4d">80b26d2a</a> allows to pre-calculate new model weights once and then not have to do anything when creating images. With this, adding many loras will incur small performance overhead the first time you apply those loras, and after that will be as fast as if you were making pictures without any loras enabled. Old method slows down generation by a lot with every new lora added.</p>
<p>Differences between produced images are tiny, but if that matters for you (or for some extension you are using), 1.2.0 adds an option to use old method.</p>
<h2><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/a77ac2eeaad82dcf71edc6770ae82745b7d55423">2023-02-18</a> - deterministic DPM++ SDE across different batch sizes</h2>
<p>DPM++ SDE and DPM++ SDE Karras samplers used to produce different images in batches compared to single image with same parameters. PR <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/7730">https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/7730</a> fixes this. But the nature of the fix also changes what generates for single images. an option is added to compatibility settings to revert to old behavior: Do not make DPM++ SDE deterministic across different batch sizes.</p>
<h2><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/035f2af050da98a8b3f847624ef3b5bc3395e87e">2023-01-11</a> - Alternating words syntax bugfix</h2>
<p>If you used alternating words syntax bugfix with emphasis before <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/97ff69eff338c6641f4abf430bf5ac112c1775e0">97ff69ef</a>, the program would incorrectly replace emphasized part with just <code>(</code>. So, <code>[a|(b:1.1)]</code>, rather than becoming a sequence of</p>
<p><code>a</code> -&gt; <code>(b:1.1)</code> -&gt; <code>a</code> -&gt; <code>(b:1.1)</code> -&gt;</p>
<p>becomes</p>
<p><code>a</code> -&gt; <code>(</code> -&gt; <code>a</code> -&gt; <code>(</code> -&gt;</p>
<p>The bug was fixed. If you need to reproduce old seeds, put the opening parenthesis into your prompt yourself (<code>[a|\(]</code>)</p>
<h2><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/6044">2023-01-05</a> - Karras sigma min/max</h2>
<p>Some of discussion is here: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4373">PR</a></p>
<p>To revert to old sigmas (0.1 to 10), use setting: <code>Use old karras scheduler sigmas</code>.</p>
<h2><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/ef27a18b6b7cb1a8eebdc9b2e88d25baf2c2414d">2023-01-02</a> - Hires fix rework</h2>
<p>Rather than using width/height to specify target resolution, width/height is used to specify first pass resolution, and resulting resolution is either set using “Scale by” multiplier (Hires upscale), or directly using “Resize width to” and/or “Resize height to” (Hires resize).</p>
<p>Here’s how old and new settings correspond to each other:</p>
<table>
<thead>
<tr>
<th>Old version</th>
<th>New version</th>
</tr>
</thead>
<tbody>
<tr>
<td>Size: 1024x1024</td>
<td>Size: 512x512, Hires upscale: 2.0</td>
</tr>
<tr>
<td>Size: 1280x1024, First pass size: 640x512</td>
<td>Size: 640x512, Hires upscale: 2.0; Alternatively Size: 640x512, Hires resize: 1280x1024</td>
</tr>
<tr>
<td>Size: 1024x1280, First pass size: 0x0</td>
<td>Size: 512x576 (auto-calcualted if you use old infotext - paste it into prompt and use ↙️ button), Hires upscale: 2.0</td>
</tr>
<tr>
<td>Size: 1024x512, First pass size: 512x512</td>
<td>Size: 512x512, Hires resize: 1024x512</td>
</tr>
</tbody>
</table>
<h2><a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/c1c27dad3ba371a5ae344b267c760aa51e77f193">2022-09-29</a> - New emphasis implementation</h2>
<p>New implementation supports escape characters and numerical weights. A downside of the new implementation is that the old one was not perfect and sometimes ate characters: “a (((farm))), daytime”, for example, would become “a farm daytime” without the comma. This behavior is not shared by the new implementation which preserves all text correctly, and this means that your saved seeds may produce different pictures.</p>
<p>For now, there is an option in settings to use the old implementation: <code>Use old emphasis implementation</code>.</p>
<p>More info about the feature: <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#attentionemphasis">Attention/emphasis</a></p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
## [2023-04-29](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/9669) - Fix prompt schedule for second order samplers
Second order samplers (Heun, DPM2/a, DPM++ 2S/a, DPM++ SDE / Karras) cause the prompt schedule to run twice as fast when prompting something like `[dog:cat:0.5]` (i.e. for 100 steps, prompt is `dog` until step 25, `cat` until 50, and remains `dog` until 100). This fixes that by checking if the sampler is any of these second order samplers and multiplies the step count by 2 for calculating the prompt schedule.
## [2023-03-26](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/80b26d2a69617b75d2d01c1e6b7d11445815ed4d) - Apply LoRA by altering layer's weights
TLDR: produces pictures are a little bit different. If using highres fix, those small differences can be amplified into big ones.
New method introduced in [80b26d2a](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/80b26d2a69617b75d2d01c1e6b7d11445815ed4d) allows to pre-calculate new model weights once and then not have to do anything when creating images. With this, adding many loras will incur small performance overhead the first time you apply those loras, and after that will be as fast as if you were making pictures without any loras enabled. Old method slows down generation by a lot with every new lora added.
Differences between produced images are tiny, but if that matters for you (or for some extension you are using), 1.2.0 adds an option to use old method.
## [2023-02-18](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/a77ac2eeaad82dcf71edc6770ae82745b7d55423) - deterministic DPM++ SDE across different batch sizes
DPM++ SDE and DPM++ SDE Karras samplers used to produce different images in batches compared to single image with same parameters. PR https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/7730 fixes this. But the nature of the fix also changes what generates for single images. an option is added to compatibility settings to revert to old behavior: Do not make DPM++ SDE deterministic across different batch sizes.
## [2023-01-11](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/035f2af050da98a8b3f847624ef3b5bc3395e87e) - Alternating words syntax bugfix
If you used alternating words syntax bugfix with emphasis before [97ff69ef](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/97ff69eff338c6641f4abf430bf5ac112c1775e0), the program would incorrectly replace emphasized part with just `(`. So, `[a|(b:1.1)]`, rather than becoming a sequence of
`a` -> `(b:1.1)` -> `a` -> `(b:1.1)` -> ...
becomes
`a` -> `(` -> `a` -> `(` -> ...
The bug was fixed. If you need to reproduce old seeds, put the opening parenthesis into your prompt yourself (`[a|\(]`)
## [2023-01-05](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/6044) - Karras sigma min/max
Some of discussion is here: [PR](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/4373)
To revert to old sigmas (0.1 to 10), use setting: `Use old karras scheduler sigmas`.
## [2023-01-02](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/ef27a18b6b7cb1a8eebdc9b2e88d25baf2c2414d) - Hires fix rework
Rather than using width/height to specify target resolution, width/height is used to specify first pass resolution, and resulting resolution is either set using "Scale by" multiplier (Hires upscale), or directly using "Resize width to" and/or "Resize height to" (Hires resize).
Here's how old and new settings correspond to each other:
| Old version | New version |
|-------------------------------------------|-------------------------------------------------------------------------------------------------|
| Size: 1024x1024 | Size: 512x512, Hires upscale: 2.0 |
| Size: 1280x1024, First pass size: 640x512 | Size: 640x512, Hires upscale: 2.0; Alternatively Size: 640x512, Hires resize: 1280x1024 |
| Size: 1024x1280, First pass size: 0x0 | Size: 512x576 (auto-calcualted if you use old infotext - paste it into prompt and use ↙️ button), Hires upscale: 2.0 |
| Size: 1024x512, First pass size: 512x512 | Size: 512x512, Hires resize: 1024x512 |
## [2022-09-29](https://github.com/AUTOMATIC1111/stable-diffusion-webui/commit/c1c27dad3ba371a5ae344b267c760aa51e77f193) - New emphasis implementation
New implementation supports escape characters and numerical weights. A downside of the new implementation is that the old one was not perfect and sometimes ate characters: "a (((farm))), daytime", for example, would become "a farm daytime" without the comma. This behavior is not shared by the new implementation which preserves all text correctly, and this means that your saved seeds may produce different pictures.
For now, there is an option in settings to use the old implementation: `Use old emphasis implementation`.
More info about the feature: [Attention/emphasis](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Features#attentionemphasis)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Tests.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>You can run tests to validate your modifications.</p>
<p>Post <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/10291">PR #10291</a>, <a href="https://docs.pytest.org/en/7.3.x/">py.test</a> is used as the test runner. Testing dependencies are in <code>requirements-test.txt</code>, so <code>pip install -r requirements-test.txt</code> first.</p>
<p>Most of the tests run against a live instance of the WebUI. You can start the WebUI server with a suitable baseline configuration with the <code>--test-server</code> argument, but you may want to add e.g. <code>--use-cpu all --no-half</code> depending on your system.</p>
<p>Once the server is running, you can run tests with just <code>py.test</code>.</p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
You can run tests to validate your modifications.
Post [PR #10291](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/10291), [py.test](https://docs.pytest.org/en/7.3.x/) is used as the test runner. Testing dependencies are in `requirements-test.txt`, so `pip install -r requirements-test.txt` first.
Most of the tests run against a live instance of the WebUI. You can start the WebUI server with a suitable baseline configuration with the `--test-server` argument, but you may want to add e.g. `--use-cpu all --no-half` depending on your system.
Once the server is running, you can run tests with just `py.test`.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>What is Textual Inversion?</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>What is Textual Inversion?</h1>
<p><a href="https://textual-inversion.github.io/">Textual inversion</a>: Teach the base model <strong>new vocabulary about a particular concept</strong> with a couple of images reflecting that concept.</p>
<ul>
<li>The concept can be: a pose, an artistic style, a texture, etc.
<ul>
<li>The concept doesn’t have to actually exist in the real world. For example, you might have seen many generated images whose negative prompt (np) contained the tag “EasyNegative”. That’s an artificial concept trained on a bunch of images <em>someone</em> thought of poor quality.</li>
</ul>
</li>
<li>It <strong>doesn’t enrich the model</strong>. If your base model is trained solely on images of <em>apples</em>, and you tried to teach the model the word <em>“banana”</em> with ~20 images of bananas, then – at best – your model will give you long, yellow apples when you ask for a banana. (Of course, you can get the model to approximate a banana with apples with 1,000+ images, but is it really worth it? 😉 )</li>
</ul>
<p>The result of the training is a <code>.pt</code> or a <code>.bin</code> file (former is the format used by original author, latter is by the <a href="https://huggingface.co/docs/diffusers/index">diffusers</a> library) with the embedding in it. These files can be shared to other generative artists.</p>
<h1>Using pre-trained embeddings</h1>
<p>Put the embedding into the <code>embeddings</code> directory and use its filename in the prompt. You don’t have to restart the program for this to work.</p>
<p>As an example, here is an embedding of <a href="https://drive.google.com/file/d/1MDSmzSbzkIcw5_aw_i79xfO3CRWQDl-8/view?usp=sharing">Usada Pekora</a> I trained on WD1.2 model, on 53 pictures (119 augmented) for 19500 steps, with 8 vectors per token setting.</p>
<p>Pictures it generates:
<img src="https://user-images.githubusercontent.com/20920490/193285043-5d5d57d8-7b5e-4803-a211-5ca5220c35f4.png" alt="grid-0037"></p>
<pre><code>portrait of usada pekora
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 45dee52b
</code></pre>
<p>You can combine multiple embeddings in one prompt:
<img src="https://user-images.githubusercontent.com/20920490/193285265-a5224378-4ae2-48bf-ad7d-e79a9f998f9c.png" alt="grid-0038"></p>
<pre><code>portrait of usada pekora, mignon
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 45dee52b
</code></pre>
<p>Be very careful about which model you are using with your embeddings: they work well with the model you used during training, and not so well on different models. For example, here is the above embedding and vanilla 1.4 stable diffusion model:
<img src="https://user-images.githubusercontent.com/20920490/193285611-486373f2-35d0-437c-895a-71454564a7c4.png" alt="grid-0036"></p>
<pre><code>portrait of usada pekora
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 7460a6fa
</code></pre>
<h1>Training embeddings</h1>
<h2>Textual inversion tab</h2>
<p>Experimental support for training embeddings in user interface.</p>
<ul>
<li>create a new empty embedding, select directory with images, train the embedding on it</li>
<li>the feature is very raw, use at own risk</li>
<li>i was able to reproduce results I got with other repos in training anime artists as styles, after few tens of thousands steps</li>
<li>works with half precision floats, but needs experimentation to see if results will be just as good</li>
<li>if you have enough memory, safer to run with <code>--no-half --precision full</code></li>
<li>Section for UI to run preprocessing for images automatically.</li>
<li>you can interrupt and resume training without any loss of data (except for AdamW optimization parameters, but it seems none of existing repos save those anyway so the general opinion is they are not important)</li>
<li>no support for batch sizes or gradient accumulation</li>
<li>it should not be possible to run this with <code>--lowvram</code> and <code>--medvram</code> flags.</li>
</ul>
<h2>Explanation for parameters</h2>
<h3>Creating an embedding</h3>
<ul>
<li><strong>Name</strong>: filename for the created embedding. You will also use this text in prompts when referring to the embedding.</li>
<li><strong>Initialization text</strong>: the embedding you create will initially be filled with vectors of this text. If you create a one vector embedding named “zzzz1234” with “tree” as initialization text, and use it in prompt without training, then prompt “a zzzz1234 by monet” will produce same pictures as “a tree by monet”.</li>
<li><strong>Number of vectors per token</strong>: the size of embedding. The larger this value, the more information about subject you can fit into the embedding, but also the more words it will take away from your prompt allowance. With stable diffusion, you have a limit of 75 tokens in the prompt. If you use an embedding with 16 vectors in a prompt, that will leave you with space for 75 - 16 = 59. Also from my experience, the larger the number of vectors, the more pictures you need to obtain good results.</li>
</ul>
<h3>Preprocess</h3>
<p>This takes images from a directory, processes them to be ready for textual inversion, and writes results to another directory. This is a convenience feature and you can preprocess pictures yourself if you wish.</p>
<ul>
<li><strong>Source directory</strong>: directory with images</li>
<li><strong>Destination directory</strong>: directory where the results will be written</li>
<li><strong>Create flipped copies</strong>: for each image, also write its mirrored copy</li>
<li><strong>Split oversized images into two</strong>: if the image is too tall or wide, resize it to have the short side match the desired resolution, and create two, possibly intersecting pictures out of it.</li>
<li><strong>Use BLIP caption as filename</strong>: use BLIP model from the interrogator to add a caption to the filename.</li>
</ul>
<h3>Training an embedding</h3>
<ul>
<li><strong>Embedding</strong>: select the embedding you want to train from this dropdown.</li>
<li><strong>Learning rate</strong>: how fast should the training go. The danger of setting this parameter to a high value is that you may break the embedding if you set it too high. If you see <code>Loss: nan</code> in the training info textbox, that means you failed and the embedding is dead. With the default value, this should not happen. It’s possible to specify multiple learning rates in this setting using the following syntax: <code>0.005:100, 1e-3:1000, 1e-5</code> - this will train with lr of <code>0.005</code> for first 100 steps, then <code>1e-3</code> until 1000 steps, then <code>1e-5</code> until the end.</li>
<li><strong>Dataset directory</strong>: directory with images for training. They all must be square.</li>
<li><strong>Log directory</strong>: sample images and copies of partially trained embeddings will be written to this directory.</li>
<li><strong>Prompt template file</strong>: text file with prompts, one per line, for training the model on. See files in directory <code>textual_inversion_templates</code> for what you can do with those. Use <code>style.txt</code> when training styles, and <code>subject.txt</code> when training object embeddings. Following tags can be used in the file:
<ul>
<li><code>[name]</code>: the name of embedding</li>
<li><code>[filewords]</code>: words from the file name of the image from the dataset. See below for more info.</li>
</ul>
</li>
<li><strong>Max steps</strong>: training will stop after this many steps have been completed. A step is when one picture (or one batch of pictures, but batches are currently not supported) is shown to the model and is used to improve embedding. if you interrupt training and resume it at a later date, the number of steps is preserved.</li>
<li><strong>Save images with embedding in PNG chunks</strong>: every time an image is generated it is combined with the most recently logged embedding and saved to image_embeddings in a format that can be both shared as an image, and placed into your embeddings folder and loaded.</li>
<li><strong>Preview prompt</strong>: if not empty, this prompt will be used to generate preview pictures. If empty, the prompt from training will be used.</li>
</ul>
<h3>filewords</h3>
<p><code>[filewords]</code> is a tag for prompt template file that allows you to insert text from filename into the prompt. By default, file’s extension is removed, as well as all numbers and dashes (<code>-</code>) at the start of filename. So this filename: <code>000001-1-a man in suit.png</code> will become this text for prompt: <code>a man in suit</code>. Formatting of the text in the filename is left as it is.</p>
<p>It’s possible to use options <code>Filename word regex</code> and <code>Filename join string</code> to alter the text from filename: for example, with word regex = <code>\w+</code> and join string = <code>,</code>, the file from above will produce this text: <code>a, man, in, suit</code>. regex is used to extract words from text (and they are <code>['a', 'man', 'in', 'suit', ]</code>), and join string (’, ') is placed between those words to create one text: <code>a, man, in, suit</code>.</p>
<p>It’s also possible to make a text file with same filename as image (<code>000001-1-a man in suit.txt</code>) and just put the prompt text there. The filename and regex options will not be used.</p>
<h2>Third party repos</h2>
<p>I successfully trained embeddings using those repositories:</p>
<ul>
<li><a href="https://github.com/nicolai256/Stable-textual-inversion_win">nicolai256</a></li>
<li><a href="https://github.com/invoke-ai/InvokeAI">lstein</a></li>
</ul>
<p>Other options are to train on colabs and/or using diffusers library, which I know nothing about.</p>
<h1>Finding embeddings online</h1>
<ul>
<li>Github has kindly asked me to remove all the links here.</li>
</ul>
<h1>Hypernetworks</h1>
<p>Hypernetworks is a novel (get it?) concept for fine tuning a model without touching any of its weights.</p>
<p>The current way to train hypernets is in the textual inversion tab.</p>
<p>Training works the same way as with textual inversion.</p>
<p>The only requirement is to use a very, very low learning rate, something like 0.000005 or 0.0000005.</p>
<h3>Dum Dum Guide</h3>
<p>An anonymous user has written a guide with pictures for using hypernetworks: <a href="https://rentry.org/hypernetwork4dumdums">https://rentry.org/hypernetwork4dumdums</a></p>
<h3>Unload VAE and CLIP from VRAM when training</h3>
<p>This option on settings tab allows you to save some memoryat the cost of slower preview picture generation.</p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# What is Textual Inversion?
[Textual inversion](https://textual-inversion.github.io/): Teach the base model **new vocabulary about a particular concept** with a couple of images reflecting that concept.
* The concept can be: a pose, an artistic style, a texture, etc.
* The concept doesn't have to actually exist in the real world. For example, you might have seen many generated images whose negative prompt (np) contained the tag "EasyNegative". That's an artificial concept trained on a bunch of images _someone_ thought of poor quality.
* It **doesn't enrich the model**. If your base model is trained solely on images of _apples_, and you tried to teach the model the word _"banana"_ with ~20 images of bananas, then -- at best -- your model will give you long, yellow apples when you ask for a banana. (Of course, you can get the model to approximate a banana with apples with 1,000+ images, but is it really worth it? ;) )
The result of the training is a `.pt` or a `.bin` file (former is the format used by original author, latter is by the [diffusers][dl] library) with the embedding in it. These files can be shared to other generative artists.
[dl]: https://huggingface.co/docs/diffusers/index
# Using pre-trained embeddings
Put the embedding into the `embeddings` directory and use its filename in the prompt. You don't have to restart the program for this to work.
As an example, here is an embedding of [Usada Pekora](https://drive.google.com/file/d/1MDSmzSbzkIcw5_aw_i79xfO3CRWQDl-8/view?usp=sharing) I trained on WD1.2 model, on 53 pictures (119 augmented) for 19500 steps, with 8 vectors per token setting.
Pictures it generates:
![grid-0037](https://user-images.githubusercontent.com/20920490/193285043-5d5d57d8-7b5e-4803-a211-5ca5220c35f4.png)
```
portrait of usada pekora
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 45dee52b
```
You can combine multiple embeddings in one prompt:
![grid-0038](https://user-images.githubusercontent.com/20920490/193285265-a5224378-4ae2-48bf-ad7d-e79a9f998f9c.png)
```
portrait of usada pekora, mignon
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 45dee52b
```
Be very careful about which model you are using with your embeddings: they work well with the model you used during training, and not so well on different models. For example, here is the above embedding and vanilla 1.4 stable diffusion model:
![grid-0036](https://user-images.githubusercontent.com/20920490/193285611-486373f2-35d0-437c-895a-71454564a7c4.png)
```
portrait of usada pekora
Steps: 20, Sampler: Euler a, CFG scale: 7, Seed: 4077357776, Size: 512x512, Model hash: 7460a6fa
```
# Training embeddings
## Textual inversion tab
Experimental support for training embeddings in user interface.
- create a new empty embedding, select directory with images, train the embedding on it
- the feature is very raw, use at own risk
- i was able to reproduce results I got with other repos in training anime artists as styles, after few tens of thousands steps
- works with half precision floats, but needs experimentation to see if results will be just as good
- if you have enough memory, safer to run with `--no-half --precision full`
- Section for UI to run preprocessing for images automatically.
- you can interrupt and resume training without any loss of data (except for AdamW optimization parameters, but it seems none of existing repos save those anyway so the general opinion is they are not important)
- no support for batch sizes or gradient accumulation
- it should not be possible to run this with `--lowvram` and `--medvram` flags.
## Explanation for parameters
### Creating an embedding
- **Name**: filename for the created embedding. You will also use this text in prompts when referring to the embedding.
- **Initialization text**: the embedding you create will initially be filled with vectors of this text. If you create a one vector embedding named "zzzz1234" with "tree" as initialization text, and use it in prompt without training, then prompt "a zzzz1234 by monet" will produce same pictures as "a tree by monet".
- **Number of vectors per token**: the size of embedding. The larger this value, the more information about subject you can fit into the embedding, but also the more words it will take away from your prompt allowance. With stable diffusion, you have a limit of 75 tokens in the prompt. If you use an embedding with 16 vectors in a prompt, that will leave you with space for 75 - 16 = 59. Also from my experience, the larger the number of vectors, the more pictures you need to obtain good results.
### Preprocess
This takes images from a directory, processes them to be ready for textual inversion, and writes results to another directory. This is a convenience feature and you can preprocess pictures yourself if you wish.
- **Source directory**: directory with images
- **Destination directory**: directory where the results will be written
- **Create flipped copies**: for each image, also write its mirrored copy
- **Split oversized images into two**: if the image is too tall or wide, resize it to have the short side match the desired resolution, and create two, possibly intersecting pictures out of it.
- **Use BLIP caption as filename**: use BLIP model from the interrogator to add a caption to the filename.
### Training an embedding
- **Embedding**: select the embedding you want to train from this dropdown.
- **Learning rate**: how fast should the training go. The danger of setting this parameter to a high value is that you may break the embedding if you set it too high. If you see `Loss: nan` in the training info textbox, that means you failed and the embedding is dead. With the default value, this should not happen. It's possible to specify multiple learning rates in this setting using the following syntax: `0.005:100, 1e-3:1000, 1e-5` - this will train with lr of `0.005` for first 100 steps, then `1e-3` until 1000 steps, then `1e-5` until the end.
- **Dataset directory**: directory with images for training. They all must be square.
- **Log directory**: sample images and copies of partially trained embeddings will be written to this directory.
- **Prompt template file**: text file with prompts, one per line, for training the model on. See files in directory `textual_inversion_templates` for what you can do with those. Use `style.txt` when training styles, and `subject.txt` when training object embeddings. Following tags can be used in the file:
- `[name]`: the name of embedding
- `[filewords]`: words from the file name of the image from the dataset. See below for more info.
- **Max steps**: training will stop after this many steps have been completed. A step is when one picture (or one batch of pictures, but batches are currently not supported) is shown to the model and is used to improve embedding. if you interrupt training and resume it at a later date, the number of steps is preserved.
- **Save images with embedding in PNG chunks**: every time an image is generated it is combined with the most recently logged embedding and saved to image_embeddings in a format that can be both shared as an image, and placed into your embeddings folder and loaded.
- **Preview prompt**: if not empty, this prompt will be used to generate preview pictures. If empty, the prompt from training will be used.
### filewords
`[filewords]` is a tag for prompt template file that allows you to insert text from filename into the prompt. By default, file's extension is removed, as well as all numbers and dashes (`-`) at the start of filename. So this filename: `000001-1-a man in suit.png` will become this text for prompt: `a man in suit`. Formatting of the text in the filename is left as it is.
It's possible to use options `Filename word regex` and `Filename join string` to alter the text from filename: for example, with word regex = `\w+` and join string = `, `, the file from above will produce this text: `a, man, in, suit`. regex is used to extract words from text (and they are `['a', 'man', 'in', 'suit', ]`), and join string (', ') is placed between those words to create one text: `a, man, in, suit`.
It's also possible to make a text file with same filename as image (`000001-1-a man in suit.txt`) and just put the prompt text there. The filename and regex options will not be used.
## Third party repos
I successfully trained embeddings using those repositories:
- [nicolai256](https://github.com/nicolai256/Stable-textual-inversion_win)
- [lstein](https://github.com/invoke-ai/InvokeAI)
Other options are to train on colabs and/or using diffusers library, which I know nothing about.
# Finding embeddings online
- Github has kindly asked me to remove all the links here.
# Hypernetworks
Hypernetworks is a novel (get it?) concept for fine tuning a model without touching any of its weights.
The current way to train hypernets is in the textual inversion tab.
Training works the same way as with textual inversion.
The only requirement is to use a very, very low learning rate, something like 0.000005 or 0.0000005.
### Dum Dum Guide
An anonymous user has written a guide with pictures for using hypernetworks: https://rentry.org/hypernetwork4dumdums
### Unload VAE and CLIP from VRAM when training
This option on settings tab allows you to save some memoryat the cost of slower preview picture generation.
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Low VRAM Video-cards</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><ul>
<li>
<h3><strong>The program is tested to work on Python 3.10.6. Don’t use other versions unless you are looking for trouble.</strong></h3>
</li>
<li>The program needs 16gb of regular RAM to run smoothly. If you have 8gb RAM, consider making an 8gb page file/swap file, or use the <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings">–lowram</a> option (if you have more gpu vram than ram).</li>
<li>The installer creates a python virtual environment, so none of the installed modules will affect existing system installations of python.</li>
<li>To use the system’s python rather than creating a virtual environment, use custom parameter replacing <code>set VENV_DIR=-</code>.</li>
<li>To reinstall from scratch, delete directories: <code>venv</code>, <code>repositories</code>.</li>
<li>When starting the program for the first time, the path to python interpreter is displayed. If this is not the python you installed, you can specify full path in the <code>webui-user</code> script; see <a href="Command-Line-Arguments-and-Settings#environment-variables">Command-Line-Arguments-and-Settings#environment-variables</a>.</li>
<li>If the desired version of Python is not in PATH, modify the line <code>set PYTHON=python</code> in <code>webui-user.bat</code> with the full path to the python executable.
<ul>
<li>Example: <code>set PYTHON=B:\soft\Python310\python.exe</code></li>
</ul>
</li>
<li>Installer requirements from <code>requirements_versions.txt</code>, which lists versions for modules specifically compatible with Python 3.10.6. If this doesn’t work with other versions of Python, setting the custom parameter <code>set REQS_FILE=requirements.txt</code> may help.</li>
</ul>
<h1>Low VRAM Video-cards</h1>
<p>When running on video cards with a low amount of VRAM (&lt;=4GB), out of memory errors may arise.
Various optimizations may be enabled through command line arguments, sacrificing some/a lot of speed in favor of using less VRAM:</p>
<ul>
<li>Use <code>--opt-sdp-attention</code> OR the optional dependency <code>--xformers</code> to cut the gpu memory usage down by half on many cards.</li>
<li>If you have 4GB VRAM and want to make 512x512 (or maybe up to 640x640) images, use <code>--medvram</code>.</li>
<li>If you have 4GB VRAM and want to make 512x512 images, but you get an out of memory error with <code>--medvram</code>, use <code>--lowvram --always-batch-cond-uncond</code> instead.</li>
<li>If you have 4GB VRAM and want to make images larger than you can with <code>--medvram</code>, use <code>--lowvram</code>.</li>
</ul>
<h1>Torch is not able to use GPU</h1>
<p>This is one of the most frequently mentioned problems, but it’s usually not a WebUI fault, there are many reasons for it.</p>
<ul>
<li>WebUI uses GPU by default, so if you don’t have suitable hardware, you need to <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings#running-on-cpu">run on CPU</a>.</li>
<li>Make sure you configure the WebUI correctly, refer to the corresponding installation tutorial in the <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki">wiki</a>.</li>
<li>If you encounter this issue after some component updates, try undoing the most recent actions.</li>
</ul>
<p>If you are one of the above, you should delete the <code>venv</code> folder.</p>
<p>If you still can’t solve the problem, you need to submit some additional information when reporting.</p>
<ol>
<li>Open the console under <code>venv\Scripts</code></li>
<li>Run <code>python -m torch.utils.collect_env</code></li>
<li>Copy all the output of the console and post it</li>
</ol>
<h1>Green or Black screen</h1>
<p>Video cards
Certain GPU video cards don’t support half precision: a green or black screen may appear instead of the generated pictures. Use <code>--upcast-sampling</code>. This should stack with <code>--xformers</code> if you are using.
If still not fixed, use command line arguments <code>--precision full --no-half</code> at a significant increase in VRAM usage, which may require <code>--medvram</code>.</p>
<h1>A Tensor with all NaNs was produced in the vae</h1>
<p>This is the same problem as the one from above, to verify, Use <code>--disable-nan-check</code>. With this on, if one of the images fail the rest of the pictures are displayed.</p>
<p>It is either a model cause - <a href="https://github.com/arenasys/stable-diffusion-webui-model-toolkit#clip">resource</a></p>
<p>Merge cause - <a href="https://github.com/Mikubill/sd-webui-controlnet/discussions/1214">resource</a></p>
<p>Or GPU related.</p>
<ul>
<li>
<p>NVIDIA 16XX and 10XX cards should be using --upcast-sampling and --xformers to run at equivalent speed. If issue is persisting, try running the vae in fp32 by adding <code>--no-half-vae</code> If this fails, you will have to fall back to running with <code>--no-half</code>, which would be the the slowest + using the most gpu memory.</p>
</li>
<li>
<p>AMD cards that cannot run fp16 normally should be on <code>--upcast-sampling --opt-sub-quad-attention</code> / <code>--opt-split-attention-v1</code>. The fallback order should ideally be the same as the one above. Following that, if it continues to fail, AMD users may need to utilize some trick like “export HSA_OVERRIDE_GFX_VERSION=10.3.0” specific to their GPU. It would be ideal to do a thorough google search + all of github search to find the HSA_OVERRIDE_GFX_VERSION right for your specific GPU.</p>
</li>
</ul>
<p>(These are word-of-mouth troubleshooting tips. Test with a fp32 4gb SD1 model)</p>
<h1>“CUDA error: no kernel image is available for execution on the device” after enabling xformers</h1>
<p>Your installed xformers is incompatible with your GPU. If you use Python 3.10, have a Pascal or higher card and run on Windows, add <code>--reinstall-xformers --xformers</code> to your <code>COMMANDLINE_ARGS</code> to upgrade to a working version. Remove <code>--reinstall-xformers</code> after upgrading.</p>
<h1>NameError: name ‘xformers’ is not defined</h1>
<p>If you use Windows, this means your Python is too old. Use 3.10</p>
<p>If Linux, you’ll have to build xformers yourself or just avoid using xformers.</p>
<h1><code>--share</code> non-functional after gradio 3.22 update</h1>
<p>Windows defender/antiviruses sometimes blocks Gradio’s ability to create a public URL.</p>
<ol>
<li>Go to your antivirus</li>
<li>Check the protection history: <br>
<img src="https://user-images.githubusercontent.com/98228077/229028161-4ad3c837-ae3f-45f7-9a0a-fa165d70d943.png" alt="image"></li>
<li>Add it as an exclusion</li>
</ol>
<p>Related issues:</p>
<details>
<p><a href="https://github.com/gradio-app/gradio/issues/3230">https://github.com/gradio-app/gradio/issues/3230</a> <br>
<a href="https://github.com/gradio-app/gradio/issues/3677">https://github.com/gradio-app/gradio/issues/3677</a></p>
</details>
<h1>weird css loading</h1>
<figure><img src="https://user-images.githubusercontent.com/98228077/229085355-0fbd56d6-fe1c-4858-8701-6c5697b9a6d6.png" alt="image"></figure>
<p>This issue has been noted, 3 times. It is apparently something users in china may experience.
<a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/8537">#8537</a></p>
<details><summary> Solution: </summary>
<p>This problem is caused by errors in the CSS file type information in my computer registry, which leads to errors in CSS parsing and application.
Solution:</p>
<figure><img src="https://user-images.githubusercontent.com/98228077/229086022-f27858a3-c9d9-470c-87cc-aa1974b7c5d0.png" alt="image"></figure>
<p>According to the above image to locate, and modify the last Content Type and PerceivedType.
Finally, reboot the machine, delete the browser cache, and force refresh the web page (shift+f5).
Thanks to <a href="https://www.bilibili.com/read/cv19519519">https://www.bilibili.com/read/cv19519519</a></p>
</details></div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
- ### **The program is tested to work on Python 3.10.6. Don't use other versions unless you are looking for trouble.**
- The program needs 16gb of regular RAM to run smoothly. If you have 8gb RAM, consider making an 8gb page file/swap file, or use the [--lowram](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings) option (if you have more gpu vram than ram).
- The installer creates a python virtual environment, so none of the installed modules will affect existing system installations of python.
- To use the system's python rather than creating a virtual environment, use custom parameter replacing `set VENV_DIR=-`.
- To reinstall from scratch, delete directories: `venv`, `repositories`.
- When starting the program for the first time, the path to python interpreter is displayed. If this is not the python you installed, you can specify full path in the `webui-user` script; see [Command-Line-Arguments-and-Settings#environment-variables](Command-Line-Arguments-and-Settings#environment-variables).
- If the desired version of Python is not in PATH, modify the line `set PYTHON=python` in `webui-user.bat` with the full path to the python executable.
- Example: `set PYTHON=B:\soft\Python310\python.exe`
- Installer requirements from `requirements_versions.txt`, which lists versions for modules specifically compatible with Python 3.10.6. If this doesn't work with other versions of Python, setting the custom parameter `set REQS_FILE=requirements.txt` may help.
# Low VRAM Video-cards
When running on video cards with a low amount of VRAM (<=4GB), out of memory errors may arise.
Various optimizations may be enabled through command line arguments, sacrificing some/a lot of speed in favor of using less VRAM:
- Use `--opt-sdp-attention` OR the optional dependency `--xformers` to cut the gpu memory usage down by half on many cards.
- If you have 4GB VRAM and want to make 512x512 (or maybe up to 640x640) images, use `--medvram`.
- If you have 4GB VRAM and want to make 512x512 images, but you get an out of memory error with `--medvram`, use `--lowvram --always-batch-cond-uncond` instead.
- If you have 4GB VRAM and want to make images larger than you can with `--medvram`, use `--lowvram`.
# Torch is not able to use GPU
This is one of the most frequently mentioned problems, but it's usually not a WebUI fault, there are many reasons for it.
- WebUI uses GPU by default, so if you don't have suitable hardware, you need to [run on CPU](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki/Command-Line-Arguments-and-Settings#running-on-cpu).
- Make sure you configure the WebUI correctly, refer to the corresponding installation tutorial in the [wiki](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki).
- If you encounter this issue after some component updates, try undoing the most recent actions.
If you are one of the above, you should delete the `venv` folder.
If you still can't solve the problem, you need to submit some additional information when reporting.
1. Open the console under `venv\Scripts`
2. Run `python -m torch.utils.collect_env`
3. Copy all the output of the console and post it
# Green or Black screen
Video cards
Certain GPU video cards don't support half precision: a green or black screen may appear instead of the generated pictures. Use `--upcast-sampling`. This should stack with `--xformers` if you are using.
If still not fixed, use command line arguments `--precision full --no-half` at a significant increase in VRAM usage, which may require `--medvram`.
# A Tensor with all NaNs was produced in the vae
This is the same problem as the one from above, to verify, Use `--disable-nan-check`. With this on, if one of the images fail the rest of the pictures are displayed.
It is either a model cause - [resource](https://github.com/arenasys/stable-diffusion-webui-model-toolkit#clip)
Merge cause - [resource](https://github.com/Mikubill/sd-webui-controlnet/discussions/1214)
Or GPU related.
- NVIDIA 16XX and 10XX cards should be using --upcast-sampling and --xformers to run at equivalent speed. If issue is persisting, try running the vae in fp32 by adding `--no-half-vae` If this fails, you will have to fall back to running with `--no-half`, which would be the the slowest + using the most gpu memory.
- AMD cards that cannot run fp16 normally should be on `--upcast-sampling --opt-sub-quad-attention` / `--opt-split-attention-v1`. The fallback order should ideally be the same as the one above. Following that, if it continues to fail, AMD users may need to utilize some trick like "export HSA_OVERRIDE_GFX_VERSION=10.3.0" specific to their GPU. It would be ideal to do a thorough google search + all of github search to find the HSA_OVERRIDE_GFX_VERSION right for your specific GPU.
(These are word-of-mouth troubleshooting tips. Test with a fp32 4gb SD1 model)
# "CUDA error: no kernel image is available for execution on the device" after enabling xformers
Your installed xformers is incompatible with your GPU. If you use Python 3.10, have a Pascal or higher card and run on Windows, add `--reinstall-xformers --xformers` to your `COMMANDLINE_ARGS` to upgrade to a working version. Remove `--reinstall-xformers` after upgrading.
# NameError: name 'xformers' is not defined
If you use Windows, this means your Python is too old. Use 3.10
If Linux, you'll have to build xformers yourself or just avoid using xformers.
# `--share` non-functional after gradio 3.22 update
Windows defender/antiviruses sometimes blocks Gradio's ability to create a public URL.
1. Go to your antivirus
2. Check the protection history: \
![image](https://user-images.githubusercontent.com/98228077/229028161-4ad3c837-ae3f-45f7-9a0a-fa165d70d943.png)
3. Add it as an exclusion
Related issues:
<details>
https://github.com/gradio-app/gradio/issues/3230 \
https://github.com/gradio-app/gradio/issues/3677
</details>
# weird css loading
![image](https://user-images.githubusercontent.com/98228077/229085355-0fbd56d6-fe1c-4858-8701-6c5697b9a6d6.png)
This issue has been noted, 3 times. It is apparently something users in china may experience.
[#8537](https://github.com/AUTOMATIC1111/stable-diffusion-webui/issues/8537)
<details><summary> Solution: </summary>
This problem is caused by errors in the CSS file type information in my computer registry, which leads to errors in CSS parsing and application.
Solution:
![image](https://user-images.githubusercontent.com/98228077/229086022-f27858a3-c9d9-470c-87cc-aa1974b7c5d0.png)
According to the above image to locate, and modify the last Content Type and PerceivedType.
Finally, reboot the machine, delete the browser cache, and force refresh the web page (shift+f5).
Thanks to https://www.bilibili.com/read/cv19519519
</details>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>Xformers Library (Optional)</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><h1>Xformers Library (Optional)</h1>
<p>The Xformers library provides an optional method to accelerate image generation. This enhancement is exclusively available for NVIDIA GPUs, optimizing image generation and reducing VRAM usage. Older versions below 0.0.20 will produce <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/2705#discussioncomment-4024378">non-deterministic</a> results.</p>
<h2>Important Notice - No Need for Manual Installation</h2>
<p>As of January 23, 2023, neither Windows nor Linux users are required to manually build the Xformers library. This change was implemented when WebUI transitioned from a user-built wheel to an <a href="https://pypi.org/project/xformers/0.0.16rc425/#history">official wheel</a>. You can view the package upgrades and other details of this update in <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5939/commits/c091cf1b4acd2047644d3571bcbfd81c81b4c3af">this PR</a>.</p>
<h2>Usage</h2>
<p>If you are using a Pascal, Turing, Ampere, Lovelace, or Hopper card with Python 3.10, simply launch the repository using the --xformers flag. The compatible wheel will be automatically installed.</p>
<h2>Building xformers on Windows by <a href="https://github.com/duckness">@duckness</a></h2>
<ol>
<li><a href="https://visualstudio.microsoft.com/downloads/?q=build+tools#build-tools-for-visual-studio-2022">Install VS Build Tools 2022</a>, you only need <code>Desktop development with C++</code></li>
</ol>
<figure><img src="https://user-images.githubusercontent.com/6380270/194767872-232136a1-9204-4b16-ae21-3e01f6f526ea.png" alt="setup_COFbK0AJAZ"></figure>
<ol start="2">
<li><a href="https://developer.nvidia.com/cuda-11.3.0-download-archive">Install CUDA 11.3</a> (later versions are not tested), select custom, you only need the following (VS integration is probably unecessary):</li>
</ol>
<figure><img src="https://user-images.githubusercontent.com/6380270/194767963-6df7ce14-e6eb-4718-8e93-a11abf172f14.png" alt="setup_QwCdsQ28FM"></figure>
<ol start="3">
<li>Clone the <a href="https://github.com/facebookresearch/xformers">xFormers repo</a>, create a <code>venv</code> and activate it</li>
</ol>
<pre><code class="language-sh">git <span class="hljs-built_in">clone</span> https://github.com/facebookresearch/xformers.git
<span class="hljs-built_in">cd</span> xformers
git submodule update --init --recursive
python -m venv venv
./venv/scripts/activate
</code></pre>
<ol start="4">
<li>To avoid issues with getting the CPU version, <a href="https://pytorch.org/get-started/locally/">install pyTorch seperately</a>:</li>
</ol>
<pre><code class="language-sh">pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu113
</code></pre>
<ol start="5">
<li>Then install the rest of the dependencies:</li>
</ol>
<pre><code class="language-sh">pip install -r requirements.txt
pip install wheel
</code></pre>
<ol start="6">
<li>
<p>As CUDA 11.3 is rather old, you need to force enable it to be built on MS Build Tools 2022. Do <code>$env:NVCC_FLAGS = &quot;-allow-unsupported-compiler&quot;</code> if on <code>powershell</code>, or <code>set NVCC_FLAGS=-allow-unsupported-compiler</code> if on <code>cmd</code></p>
</li>
<li>
<p>You can finally build xFormers, note that the build will take a long time (probably 10-20minutes), it may initially complain of some errors but it should still compile correctly.</p>
</li>
</ol>
<blockquote>
<p>OPTIONAL tip: To further speed up on multi-core CPU Windows systems, install ninja <a href="https://github.com/ninja-build/ninja">https://github.com/ninja-build/ninja</a>.
Steps to install:</p>
<ol>
<li>download ninja-win.zip from <a href="https://github.com/ninja-build/ninja/releases">https://github.com/ninja-build/ninja/releases</a> and unzip</li>
<li>place ninja.exe under C:\Windows OR add the full path to the extracted ninja.exe into system PATH</li>
<li>Run ninja -h in cmd and verify if you see a help message printed</li>
<li>Run the follow commands to start building. It should automatically use Ninja, no extra config is needed. You should see significantly higher CPU usage (40%+).</li>
</ol>
<pre><code>python setup.py build
python setup.py bdist_wheel
</code></pre>
<p>This has reduced build time on a windows PC with a AMD 5800X CPU from 1.5hr to 10min.
Ninja is also supported on Linux and MacOS but I do not have these OS to test thus can not provide step-by-step tutorial.</p>
</blockquote>
<ol start="8">
<li>Run the following:</li>
</ol>
<pre><code class="language-sh">python setup.py build
python setup.py bdist_wheel
</code></pre>
<ol start="9">
<li>
<p>In <code>xformers</code> directory, navigate to the <code>dist</code> folder and copy the <code>.whl</code> file to the base directory of <code>stable-diffusion-webui</code></p>
</li>
<li>
<p>In <code>stable-diffusion-webui</code> directory, install the <code>.whl</code>, change the name of the file in the command below if the name is different:</p>
</li>
</ol>
<pre><code class="language-sh">./venv/scripts/activate
pip install xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl
</code></pre>
<ol start="11">
<li>Ensure that <code>xformers</code> is activated by launching <code>stable-diffusion-webui</code> with <code>--force-enable-xformers</code></li>
</ol>
<h2>Building xformers on Linux (from anonymous user)</h2>
<ol>
<li>go to the webui directory</li>
<li><code>source ./venv/bin/activate</code></li>
<li><code>cd repositories</code></li>
<li><code>git clone https://github.com/facebookresearch/xformers.git</code></li>
<li><code>cd xformers</code></li>
<li><code>git submodule update --init --recursive</code></li>
<li><code>pip install -r requirements.txt</code></li>
<li><code>pip install -e .</code></li>
</ol>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
# Xformers Library (Optional)
The Xformers library provides an optional method to accelerate image generation. This enhancement is exclusively available for NVIDIA GPUs, optimizing image generation and reducing VRAM usage. Older versions below 0.0.20 will produce [non-deterministic](https://github.com/AUTOMATIC1111/stable-diffusion-webui/discussions/2705#discussioncomment-4024378) results.
## Important Notice - No Need for Manual Installation
As of January 23, 2023, neither Windows nor Linux users are required to manually build the Xformers library. This change was implemented when WebUI transitioned from a user-built wheel to an [official wheel](https://pypi.org/project/xformers/0.0.16rc425/#history). You can view the package upgrades and other details of this update in [this PR](https://github.com/AUTOMATIC1111/stable-diffusion-webui/pull/5939/commits/c091cf1b4acd2047644d3571bcbfd81c81b4c3af).
## Usage
If you are using a Pascal, Turing, Ampere, Lovelace, or Hopper card with Python 3.10, simply launch the repository using the --xformers flag. The compatible wheel will be automatically installed.
## Building xformers on Windows by [@duckness](https://github.com/duckness)
1. [Install VS Build Tools 2022](https://visualstudio.microsoft.com/downloads/?q=build+tools#build-tools-for-visual-studio-2022), you only need `Desktop development with C++`
![setup_COFbK0AJAZ](https://user-images.githubusercontent.com/6380270/194767872-232136a1-9204-4b16-ae21-3e01f6f526ea.png)
2. [Install CUDA 11.3](https://developer.nvidia.com/cuda-11.3.0-download-archive) (later versions are not tested), select custom, you only need the following (VS integration is probably unecessary):
![setup_QwCdsQ28FM](https://user-images.githubusercontent.com/6380270/194767963-6df7ce14-e6eb-4718-8e93-a11abf172f14.png)
3. Clone the [xFormers repo](https://github.com/facebookresearch/xformers), create a `venv` and activate it
```sh
git clone https://github.com/facebookresearch/xformers.git
cd xformers
git submodule update --init --recursive
python -m venv venv
./venv/scripts/activate
```
4. To avoid issues with getting the CPU version, [install pyTorch seperately](https://pytorch.org/get-started/locally/):
```sh
pip install torch torchvision --extra-index-url https://download.pytorch.org/whl/cu113
```
5. Then install the rest of the dependencies:
```sh
pip install -r requirements.txt
pip install wheel
```
6. As CUDA 11.3 is rather old, you need to force enable it to be built on MS Build Tools 2022. Do `$env:NVCC_FLAGS = "-allow-unsupported-compiler"` if on `powershell`, or `set NVCC_FLAGS=-allow-unsupported-compiler` if on `cmd`
7. You can finally build xFormers, note that the build will take a long time (probably 10-20minutes), it may initially complain of some errors but it should still compile correctly.
> OPTIONAL tip: To further speed up on multi-core CPU Windows systems, install ninja https://github.com/ninja-build/ninja.
> Steps to install:
> 1. download ninja-win.zip from https://github.com/ninja-build/ninja/releases and unzip
> 2. place ninja.exe under C:\Windows OR add the full path to the extracted ninja.exe into system PATH
> 3. Run ninja -h in cmd and verify if you see a help message printed
> 4. Run the follow commands to start building. It should automatically use Ninja, no extra config is needed. You should see significantly higher CPU usage (40%+).
> ```
> python setup.py build
> python setup.py bdist_wheel
> ```
> This has reduced build time on a windows PC with a AMD 5800X CPU from 1.5hr to 10min.
> Ninja is also supported on Linux and MacOS but I do not have these OS to test thus can not provide step-by-step tutorial.
8. Run the following:
```sh
python setup.py build
python setup.py bdist_wheel
```
9. In `xformers` directory, navigate to the `dist` folder and copy the `.whl` file to the base directory of `stable-diffusion-webui`
10. In `stable-diffusion-webui` directory, install the `.whl`, change the name of the file in the command below if the name is different:
```sh
./venv/scripts/activate
pip install xformers-0.0.14.dev0-cp310-cp310-win_amd64.whl
```
11. Ensure that `xformers` is activated by launching `stable-diffusion-webui` with `--force-enable-xformers`
## Building xformers on Linux (from anonymous user)
1. go to the webui directory
2. `source ./venv/bin/activate`
3. `cd repositories`
3. `git clone https://github.com/facebookresearch/xformers.git`
4. `cd xformers`
5. `git submodule update --init --recursive`
6. `pip install -r requirements.txt`
7. `pip install -e .`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="Content-Type" name="viewport" content="width=device-width, initial-scale=1"/>
<title>_Footer.md</title>
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/normalize-4.2.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/github-markdown-2.3.0.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/lib/katex-0.7.1/katex.min.css">
<link rel="stylesheet" href="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.css">
</head>
<body>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1"
style="width:0;height:0;position:absolute;overflow:hidden;">
<defs>
<symbol id="si-zfinder-collapse-left" viewBox="0 0 38 38">
<path d="M38 0H0v38h38V0zM3 35V3h32v32H3zM5 5v28h17V21h-9.667L16 26h-4l-5-7 5-7h4l-3.667 5H22V5H5z"/>
</symbol>
<symbol id="si-zfinder-expand-right" viewBox="0 0 38 38">
<path d="M0 0h38v38H0V0zm35 35V3H3v32h32zM22 5v28H5V21h9.667L11 26h4l5-7-5-7h-4l3.667 5H5V5h17z"/>
</symbol>
<symbol id="si-zfinder-fullscreen" viewBox="0 0 28 28">
<path d="M4 18H0v10h10v-4H4v-6zm-4-8h4V4h6V0H0v10zm24 14h-6v4h10V18h-4v6zM18 0v4h6v6h4V0H18z"/>
</symbol>
<symbol id="si-zfinder-fullscreen-exit" viewBox="0 0 28 28">
<path d="M0 22h6v6h4V18H0v4zM6 6H0v4h10V0H6v6zm12 22h4v-6h6v-4H18v10zm4-22V0h-4v10h10V6h-6z"/>
</symbol>
</defs>
</svg>
<nav id="toc">
<div id="toc-body" class="toc-body"></div>
</nav>
<article id="markdown">
<nav id="markdown-header" class="markdown-header">
<svg class="si" id="toggle-toc" width="24" height="24">
<use xlink:href="#si-zfinder-collapse-left"></use>
</svg>
<svg class="si float-right" id="toggle-fullscreen-article" width="24" height="24">
<use xlink:href="#si-zfinder-fullscreen"></use>
</svg>
</nav>
<div id="markdown-body" class="markdown-body"><p>This is the <em>Stable Diffusion web UI</em> wiki. <a href="https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki">Wiki Home</a></p>
</div>
</article>
<div id="loading">
<div class="sk-double-bounce">
<div class="sk-child sk-double-bounce1"></div>
<div class="sk-child sk-double-bounce2"></div>
</div>
</div>
<script src="https://leungwensen.github.io/zfinder/dist/lib/jquery-3.1.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/lib/screenfull-3.0.0.min.js"></script>
<script src="https://leungwensen.github.io/zfinder/dist/zfinder/markdown-previewer.js"></script>
</body>
</html>
This is the _Stable Diffusion web UI_ wiki. [Wiki Home](https://github.com/AUTOMATIC1111/stable-diffusion-webui/wiki)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册