提交 edbbb638 编写于 作者: W weixin_44463441

Auto Commit

上级 e56812f9
......@@ -27,3 +27,4 @@ coverage
*.njsproj
*.sln
*.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]
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]
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
此差异已折叠。
## 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
```
此差异已折叠。
# 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>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)
此差异已折叠。
**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
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
# 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
此差异已折叠。
此差异已折叠。
此差异已折叠。
## 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))
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
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.
先完成此消息的编辑!
想要评论请 注册