Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
S
Stable Diffusion Webui
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
novelai-storage
Stable Diffusion Webui
Commits
f34e2293
Commit
f34e2293
authored
Oct 02, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
0758f6e6
1955ca62
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
16 deletions
+48
-16
README.md
README.md
+8
-8
modules/images.py
modules/images.py
+6
-1
modules/ui.py
modules/ui.py
+34
-7
No files found.
README.md
View file @
f34e2293
...
...
@@ -11,12 +11,12 @@ Check the [custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-web
-
One click install and run script (but you still must install python and git)
-
Outpainting
-
Inpainting
-
Prompt
-
Stable Diffusion
u
pscale
-
Prompt
Matrix
-
Stable Diffusion
U
pscale
-
Attention, specify parts of text that the model should pay more attention to
-
a man in a ((t
xuedo)) - will pay more attentino
to tuxedo
-
a man in a (t
xu
edo:1.21) - alternative syntax
-
Loopback, run img2img proc
v
essing multiple times
-
a man in a ((t
uxedo)) - will pay more attention
to tuxedo
-
a man in a (t
ux
edo:1.21) - alternative syntax
-
Loopback, run img2img processing multiple times
-
X/Y plot, a way to draw a 2 dimensional plot of images with different parameters
-
Textual Inversion
-
have as many embeddings as you want and use any names you like for them
...
...
@@ -35,15 +35,15 @@ Check the [custom scripts](https://github.com/AUTOMATIC1111/stable-diffusion-web
-
4GB video card support (also reports of 2GB working)
-
Correct seeds for batches
-
Prompt length validation
-
get length of prompt in tokensas you type
-
get a warning after ge
en
ration if some text was truncated
-
get length of prompt in tokens
as you type
-
get a warning after ge
ne
ration if some text was truncated
-
Generation parameters
-
parameters you used to generate images are saved with that image
-
in PNG chunks for PNG, in EXIF for JPEG
-
can drag the image to PNG info tab to restore generation parameters and automatically copy them into UI
-
can be disabled in settings
-
Settings page
-
Running arbitrary python code from UI (must run with
commandline flag
to enable)
-
Running arbitrary python code from UI (must run with
--allow-code
to enable)
-
Mouseover hints for most UI elements
-
Possible to change defaults/mix/max/step values for UI elements via text config
-
Random artist button
...
...
modules/images.py
View file @
f34e2293
...
...
@@ -311,7 +311,12 @@ def apply_filename_pattern(x, p, seed, prompt):
x
=
x
.
replace
(
"[cfg]"
,
str
(
p
.
cfg_scale
))
x
=
x
.
replace
(
"[width]"
,
str
(
p
.
width
))
x
=
x
.
replace
(
"[height]"
,
str
(
p
.
height
))
x
=
x
.
replace
(
"[styles]"
,
sanitize_filename_part
(
", "
.
join
([
x
for
x
in
p
.
styles
if
not
x
==
"None"
]),
replace_spaces
=
False
))
#currently disabled if using the save button, will work otherwise
# if enabled it will cause a bug because styles is not included in the save_files data dictionary
if
hasattr
(
p
,
"styles"
):
x
=
x
.
replace
(
"[styles]"
,
sanitize_filename_part
(
", "
.
join
([
x
for
x
in
p
.
styles
if
not
x
==
"None"
]),
replace_spaces
=
False
))
x
=
x
.
replace
(
"[sampler]"
,
sanitize_filename_part
(
sd_samplers
.
samplers
[
p
.
sampler_index
]
.
name
,
replace_spaces
=
False
))
x
=
x
.
replace
(
"[model_hash]"
,
shared
.
sd_model
.
sd_model_hash
)
...
...
modules/ui.py
View file @
f34e2293
...
...
@@ -33,6 +33,7 @@ import modules.gfpgan_model
import
modules.codeformer_model
import
modules.styles
import
modules.generation_parameters_copypaste
from
modules.images
import
apply_filename_pattern
,
get_next_sequence_number
import
modules.textual_inversion.ui
# this is a fix for Windows users. Without it, javascript files will be served with text/html content-type and the bowser will not show any UI
...
...
@@ -96,14 +97,31 @@ def send_gradio_gallery_to_image(x):
def
save_files
(
js_data
,
images
,
index
):
import
csv
os
.
makedirs
(
opts
.
outdir_save
,
exist_ok
=
True
)
import
csv
filenames
=
[]
#quick dictionary to class object conversion. Its neccesary due apply_filename_pattern requiring it
class
MyObject
:
def
__init__
(
self
,
d
=
None
):
if
d
is
not
None
:
for
key
,
value
in
d
.
items
():
setattr
(
self
,
key
,
value
)
data
=
json
.
loads
(
js_data
)
p
=
MyObject
(
data
)
path
=
opts
.
outdir_save
save_to_dirs
=
opts
.
save_to_dirs
if
save_to_dirs
:
dirname
=
apply_filename_pattern
(
opts
.
directories_filename_pattern
or
"[prompt_words]"
,
p
,
p
.
seed
,
p
.
prompt
)
path
=
os
.
path
.
join
(
opts
.
outdir_save
,
dirname
)
os
.
makedirs
(
path
,
exist_ok
=
True
)
if
index
>
-
1
and
opts
.
save_selected_only
and
(
index
>=
data
[
"index_of_first_image"
]):
# ensures we are looking at a specific non-grid picture, and we have save_selected_only
images
=
[
images
[
index
]]
infotexts
=
[
data
[
"infotexts"
][
index
]]
else
:
...
...
@@ -115,11 +133,20 @@ def save_files(js_data, images, index):
if
at_start
:
writer
.
writerow
([
"prompt"
,
"seed"
,
"width"
,
"height"
,
"sampler"
,
"cfgs"
,
"steps"
,
"filename"
,
"negative_prompt"
])
filename_base
=
str
(
int
(
time
.
time
()
*
1000
))
file_decoration
=
opts
.
samples_filename_pattern
or
"[seed]-[prompt_spaces]"
if
file_decoration
!=
""
:
file_decoration
=
"-"
+
file_decoration
.
lower
()
file_decoration
=
apply_filename_pattern
(
file_decoration
,
p
,
p
.
seed
,
p
.
prompt
)
truncated
=
(
file_decoration
[:
240
]
+
'..'
)
if
len
(
file_decoration
)
>
240
else
file_decoration
filename_base
=
truncated
extension
=
opts
.
samples_format
.
lower
()
basecount
=
get_next_sequence_number
(
path
,
""
)
for
i
,
filedata
in
enumerate
(
images
):
filename
=
filename_base
+
(
""
if
len
(
images
)
==
1
else
"-"
+
str
(
i
+
1
))
+
f
".{extension}"
filepath
=
os
.
path
.
join
(
opts
.
outdir_save
,
filename
)
file_number
=
f
"{basecount+i:05}"
filename
=
file_number
+
filename_base
+
f
".{extension}"
filepath
=
os
.
path
.
join
(
path
,
filename
)
if
filedata
.
startswith
(
"data:image/png;base64,"
):
filedata
=
filedata
[
len
(
"data:image/png;base64,"
):]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment