You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| --log_tokenization | -t | False | Display a color-coded list of the parsed tokens derived from the prompt |
132
+
| --skip_normalization| -x | False | Weighted subprompts will not be normalized. See [Weighted Prompts](./OTHER.md#**Weighted Prompts**) |
133
+
| --upscale <int> <float> | -U <int> <float> | -U 1 0.75| Upscale image by magnification factor (2, 4), and set strength of upscaling (0.0-1.0). If strength not set, will default to 0.75. |
134
+
| --gfpgan_strength <float> | -G <float> | -G0 | Fix faces using the GFPGAN algorithm; argument indicates how hard the algorithm should try (0.0-1.0) |
135
+
| --save_original | -save_orig| False | When upscaling or fixing faces, this will cause the original image to be saved rather than replaced. |
136
+
| --variation <float> |-v<float>| 0.0 | Add a bit of noise (0.0=none, 1.0=high) to the image in order to generate a series of variations. Usually used in combination with -S<seed> and -n<int> to generate a series a riffs on a starting image. See [Variations](./VARIATIONS.md). |
137
+
| --with_variations <pattern> | -V<pattern>| None | Combine two or more variations. See [Variations](./VARIATIONS.md) for now to use this. |
138
+
139
+
Note that the width and height of the image must be multiples of
140
+
64. You can provide different values, but they will be rounded down to
141
+
the nearest multiple of 64.
142
+
143
+
144
+
### This is an example of img2img:
145
+
146
+
~~~~
147
+
dream> waterfall and rainbow -I./vacation-photo.png -W640 -H480 --fit
148
+
~~~~
149
+
150
+
This will modify the indicated vacation photograph by making it more
151
+
like the prompt. Results will vary greatly depending on what is in the
152
+
image. We also ask to --fit the image into a box no bigger than
153
+
640x480. Otherwise the image size will be identical to the provided
154
+
photo and you may run out of memory if it is large.
155
+
156
+
In addition to the command-line options recognized by txt2img, img2img
| --init_img <path> | -I<path> | None | Path to the initialization image |
162
+
| --fit | -F | False | Scale the image to fit into the specified -H and -W dimensions |
163
+
| --strength <float> | -s<float> | 0.75 | How hard to try to match the prompt to the initial image. Ranges from 0.0-0.99, with higher values replacing the initial image completely.|
164
+
165
+
### This is an example of inpainting:
166
+
167
+
~~~~
168
+
dream> waterfall and rainbow -I./vacation-photo.png -M./vacation-mask.png -W640 -H480 --fit
169
+
~~~~
170
+
171
+
This will do the same thing as img2img, but image alterations will
172
+
only occur within transparent areas defined by the mask file specified
173
+
by -M. You may also supply just a single initial image with the areas
174
+
to overpaint made transparent, but you must be careful not to destroy
175
+
the pixels underneath when you create the transparent areas. See
176
+
[Inpainting](./INPAINTING.md) for details.
177
+
178
+
inpainting accepts all the arguments used for txt2img and img2img, as
This script also provides an img2img feature that lets you seed your creations with an initial drawing or photo. This is a really cool feature that tells stable diffusion to build the prompt on top of the image you provide, preserving the original's basic shape and layout. To use it, provide the `--init_img` option as shown here:
3
+
This script also provides an img2img feature that lets you seed your
4
+
creations with an initial drawing or photo. This is a really cool
5
+
feature that tells stable diffusion to build the prompt on top of the
6
+
image you provide, preserving the original's basic shape and
7
+
layout. To use it, provide the `--init_img` option as shown here:
4
8
5
9
```
6
10
dream> "waterfall and rainbow" --init_img=./init-images/crude_drawing.png --strength=0.5 -s100 -n4
7
11
```
8
12
9
-
The `--init_img (-I)` option gives the path to the seed picture. `--strength (-f)` controls how much the original will be modified, ranging from `0.0` (keep the original intact), to `1.0` (ignore
10
-
the original completely). The default is `0.75`, and ranges from `0.25-0.75` give interesting results.
13
+
The `--init_img (-I)` option gives the path to the seed
14
+
picture. `--strength (-f)` controls how much the original will be
15
+
modified, ranging from `0.0` (keep the original intact), to `1.0`
16
+
(ignore the original completely). The default is `0.75`, and ranges
17
+
from `0.25-0.75` give interesting results.
11
18
12
-
You may also pass a `-v<count>` option to generate count variants on the original image. This is done by passing the first generated image back into img2img the requested number of times. It generates interesting variants.
19
+
You may also pass a `-v<count>` option to generate count variants on
20
+
the original image. This is done by passing the first generated image
21
+
back into img2img the requested number of times. It generates
22
+
interesting variants.
13
23
14
-
If the initial image contains transparent regions, then Stable Diffusion will only draw within the transparent regions, a process
15
-
called "inpainting". However, for this to work correctly, the color information underneath the transparent needs to be preserved, not erased. See [Creating Transparent Images For Inpainting](./INPAINTING.md#creating-transparent-regions-for-inpainting) for details.
24
+
If the initial image contains transparent regions, then Stable
25
+
Diffusion will only draw within the transparent regions, a process
26
+
called "inpainting". However, for this to work correctly, the color
27
+
information underneath the transparent needs to be preserved, not
Copy file name to clipboardExpand all lines: docs/features/OTHER.md
+16-8Lines changed: 16 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -83,8 +83,11 @@ For example consider this prompt:
83
83
tabby cat:0.25 white duck:0.75 hybrid
84
84
```
85
85
86
-
This will tell the sampler to invest 25% of its effort on the tabby cat aspect of the image and 75% on the white duck aspect (surprisingly, this example actually works). The prompt weights can
87
-
use any combination of integers and floating point numbers, and they do not need to add up to 1.
86
+
This will tell the sampler to invest 25% of its effort on the tabby
87
+
cat aspect of the image and 75% on the white duck aspect
88
+
(surprisingly, this example actually works). The prompt weights can
89
+
use any combination of integers and floating point numbers, and they
90
+
do not need to add up to 1.
88
91
89
92
---
90
93
@@ -93,22 +96,27 @@ use any combination of integers and floating point numbers, and they do not need
93
96
For programmers who wish to incorporate stable-diffusion into other products, this repository includes a simplified API for text to image generation, which lets you create images from a prompt in just three lines of code:
94
97
95
98
```
96
-
from ldm.simplet2i import T2I
97
-
model= T2I()
98
-
outputs = model.txt2img("a unicorn in manhattan")
99
+
from ldm.generate import Generate
100
+
g = Generate()
101
+
outputs = g.txt2img("a unicorn in manhattan")
99
102
```
100
103
101
104
Outputs is a list of lists in the format [filename1,seed1],[filename2,seed2]...].
102
105
103
-
Please see ldm/simplet2i.py for more information. A set of example scripts is coming RSN.
106
+
Please see ldm/generate.py for more information. A set of example scripts is coming RSN.
104
107
105
108
---
106
109
107
110
## **Preload Models**
108
111
109
-
In situations where you have limited internet connectivity or are blocked behind a firewall, you can use the preload script to preload the required files for Stable Diffusion to run.
112
+
In situations where you have limited internet connectivity or are
113
+
blocked behind a firewall, you can use the preload script to preload
114
+
the required files for Stable Diffusion to run.
110
115
111
-
The preload script `scripts/preload_models.py` needs to be run once at least while connected to the internet. In the following runs, it will load up the cached versions of the required files from the `.cache` directory of the system.
116
+
The preload script `scripts/preload_models.py` needs to be run once at
117
+
least while connected to the internet. In the following runs, it will
118
+
load up the cached versions of the required files from the `.cache`
0 commit comments