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
aa74ac7e
Commit
aa74ac7e
authored
Aug 30, 2022
by
deggua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shortened abbreviations
parent
19ba176d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
16 deletions
+28
-16
webui.py
webui.py
+28
-16
No files found.
webui.py
View file @
aa74ac7e
...
@@ -747,7 +747,7 @@ def process_images(p: StableDiffusionProcessing):
...
@@ -747,7 +747,7 @@ def process_images(p: StableDiffusionProcessing):
generation_params
=
{
generation_params
=
{
"Steps"
:
p
.
steps
,
"Steps"
:
p
.
steps
,
"Sampler"
:
samplers
[
p
.
sampler_index
]
.
name
,
"Sampler"
:
samplers
[
p
.
sampler_index
]
.
name
,
"CFG
scale
"
:
p
.
cfg_scale
,
"CFG"
:
p
.
cfg_scale
,
"Seed"
:
seed
,
"Seed"
:
seed
,
"GFPGAN"
:
(
"GFPGAN"
if
p
.
use_GFPGAN
and
GFPGAN
is
not
None
else
None
)
"GFPGAN"
:
(
"GFPGAN"
if
p
.
use_GFPGAN
and
GFPGAN
is
not
None
else
None
)
}
}
...
@@ -758,7 +758,7 @@ def process_images(p: StableDiffusionProcessing):
...
@@ -758,7 +758,7 @@ def process_images(p: StableDiffusionProcessing):
generation_params_text
=
", "
.
join
([
k
if
k
==
v
else
f
'{k}: {v}'
for
k
,
v
in
generation_params
.
items
()
if
v
is
not
None
])
generation_params_text
=
", "
.
join
([
k
if
k
==
v
else
f
'{k}: {v}'
for
k
,
v
in
generation_params
.
items
()
if
v
is
not
None
])
def
infotext
():
def
infotext
():
return
f
"{prompt}
\n
{generation_params_text}"
.
strip
()
+
""
.
join
([
"
\n\n
"
+
x
for
x
in
comments
])
return
f
'{prompt}
\n
<p class="performance">{generation_params_text}</p>'
.
strip
()
+
""
.
join
([
"
\n\n
"
+
x
for
x
in
comments
])
if
os
.
path
.
exists
(
cmd_opts
.
embeddings_dir
):
if
os
.
path
.
exists
(
cmd_opts
.
embeddings_dir
):
model_hijack
.
load_textual_inversion_embeddings
(
cmd_opts
.
embeddings_dir
,
model
)
model_hijack
.
load_textual_inversion_embeddings
(
cmd_opts
.
embeddings_dir
,
model
)
...
@@ -974,7 +974,7 @@ def img2img(prompt: str, init_img, ddim_steps: int, sampler_index: int, use_GFPG
...
@@ -974,7 +974,7 @@ def img2img(prompt: str, init_img, ddim_steps: int, sampler_index: int, use_GFPG
init_images
=
[
init_img
],
init_images
=
[
init_img
],
resize_mode
=
resize_mode
,
resize_mode
=
resize_mode
,
denoising_strength
=
denoising_strength
,
denoising_strength
=
denoising_strength
,
extra_generation_params
=
{
"D
enoising Strength
"
:
denoising_strength
}
extra_generation_params
=
{
"D
NS
"
:
denoising_strength
}
)
)
if
loopback
:
if
loopback
:
...
@@ -1235,15 +1235,21 @@ main_css = \
...
@@ -1235,15 +1235,21 @@ main_css = \
# #generate{width: 100%;}
# #generate{width: 100%;}
custom_css
=
\
custom_css
=
\
"""
"""
/* hide scrollbars, better scaling for gallery, small padding for main image */
::-webkit-scrollbar { display: none }
#output_gallery {
#output_gallery {
min-height: 50vh !important;
min-height: 50vh !important;
scrollbar-width: none;
scrollbar-width: none;
}
}
::-webkit-scrollbar {
#output_gallery > div > img {
display: none;
padding-top: 0.5rem;
padding-right: 0.5rem;
padding-left: 0.5rem;
}
}
/* remove excess padding around prompt textbox, increase font size */
#prompt_row input { font-size: 16px }
#prompt_input {
#prompt_input {
padding-top: 0.25rem !important;
padding-top: 0.25rem !important;
padding-bottom: 0rem !important;
padding-bottom: 0rem !important;
...
@@ -1252,10 +1258,7 @@ custom_css = \
...
@@ -1252,10 +1258,7 @@ custom_css = \
border-style: none !important;
border-style: none !important;
}
}
#prompt_row input {
/* remove excess padding from mode dropdown, change appear to a button */
font-size: 16px;
}
#sd_mode {
#sd_mode {
padding-top: 0 !important;
padding-top: 0 !important;
padding-bottom: 0 !important;
padding-bottom: 0 !important;
...
@@ -1265,14 +1268,21 @@ custom_css = \
...
@@ -1265,14 +1268,21 @@ custom_css = \
}
}
#sd_mode > label > select {
#sd_mode > label > select {
background-color: #4b5563;
font-weight: 600;
font-weight: 600;
min-height: 42px;
min-height: 42px;
max-height: 42px;
max-height: 42px;
text-align: center;
text-align: center;
font-size: 1rem;
font-size: 1rem;
appearance: none;
background-image: linear-gradient(90deg, #4b5563, #374151);
-webkit-appearance: none;
background-position: left;
background-size: contain;
padding-right: 0;
border-color: rgb(75 85 99 / var(--tw-border-opacity));
}
}
/* custom column scaling (odd = right/left, even = center) */
#body>.col:nth-child(odd) {
#body>.col:nth-child(odd) {
max-width: 450px;
max-width: 450px;
min-width: 300px;
min-width: 300px;
...
@@ -1281,10 +1291,12 @@ custom_css = \
...
@@ -1281,10 +1291,12 @@ custom_css = \
width:250
%
;
width:250
%
;
}
}
/* better overall scaling + limits */
.container {
.container {
max-width: min(1600px, 95
%
);
max-width: min(1600px, 95
%
);
}
}
/* hide increment/decrement buttons on number inputs */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
input[type="number"]::-webkit-inner-spin-button {
-webkit-appearance: none;
-webkit-appearance: none;
...
@@ -1311,9 +1323,9 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
...
@@ -1311,9 +1323,9 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
with
gr
.
Row
():
with
gr
.
Row
():
sd_image_height
=
\
sd_image_height
=
\
gr
.
Number
(
label
=
"Image
H
eight"
,
value
=
512
,
precision
=
0
,
elem_id
=
'img_height'
)
gr
.
Number
(
label
=
"Image
h
eight"
,
value
=
512
,
precision
=
0
,
elem_id
=
'img_height'
)
sd_image_width
=
\
sd_image_width
=
\
gr
.
Number
(
label
=
"Image
W
idth"
,
value
=
512
,
precision
=
0
,
elem_id
=
'img_width'
)
gr
.
Number
(
label
=
"Image
w
idth"
,
value
=
512
,
precision
=
0
,
elem_id
=
'img_width'
)
with
gr
.
Row
():
with
gr
.
Row
():
sd_batch_count
=
\
sd_batch_count
=
\
...
@@ -1323,7 +1335,7 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
...
@@ -1323,7 +1335,7 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
with
gr
.
Group
():
with
gr
.
Group
():
sd_input_image
=
\
sd_input_image
=
\
gr
.
Image
(
label
=
'Input Image'
,
source
=
"upload"
,
interactive
=
True
,
type
=
"pil"
,
show_label
=
Fals
e
,
visible
=
False
)
gr
.
Image
(
label
=
'Input Image'
,
source
=
"upload"
,
interactive
=
True
,
type
=
"pil"
,
show_label
=
Tru
e
,
visible
=
False
)
sd_resize_mode
=
\
sd_resize_mode
=
\
gr
.
Dropdown
(
label
=
"Resize mode"
,
choices
=
[
"Stretch"
,
"Scale and crop"
,
"Scale and fill"
],
type
=
"index"
,
value
=
"Stretch"
,
visible
=
False
)
gr
.
Dropdown
(
label
=
"Resize mode"
,
choices
=
[
"Stretch"
,
"Scale and crop"
,
"Scale and fill"
],
type
=
"index"
,
value
=
"Stretch"
,
visible
=
False
)
...
@@ -1337,7 +1349,7 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
...
@@ -1337,7 +1349,7 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
# Right Column
# Right Column
with
gr
.
Column
():
with
gr
.
Column
():
sd_generate
=
\
sd_generate
=
\
gr
.
Button
(
'Generate'
)
.
style
(
full_width
=
True
)
gr
.
Button
(
'Generate'
,
variant
=
'primary'
)
.
style
(
full_width
=
True
)
with
gr
.
Row
():
with
gr
.
Row
():
sd_sampling_method
=
\
sd_sampling_method
=
\
...
@@ -1349,12 +1361,12 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
...
@@ -1349,12 +1361,12 @@ with gr.Blocks(css=full_css, analytics_enabled=False, title='Stable Diffusion We
sd_cfg
=
\
sd_cfg
=
\
gr
.
Slider
(
label
=
'Prompt similarity (CFG)'
,
value
=
8.0
,
minimum
=
1.0
,
maximum
=
15.0
,
step
=
0.5
)
gr
.
Slider
(
label
=
'Prompt similarity (CFG)'
,
value
=
8.0
,
minimum
=
1.0
,
maximum
=
15.0
,
step
=
0.5
)
sd_denoise
=
\
sd_denoise
=
\
gr
.
Slider
(
label
=
'Denoising
S
trength (DNS)'
,
value
=
0.75
,
minimum
=
0.0
,
maximum
=
1.0
,
step
=
0.01
,
visible
=
False
)
gr
.
Slider
(
label
=
'Denoising
s
trength (DNS)'
,
value
=
0.75
,
minimum
=
0.0
,
maximum
=
1.0
,
step
=
0.01
,
visible
=
False
)
sd_facefix
=
\
sd_facefix
=
\
gr
.
Checkbox
(
label
=
'GFPGAN'
,
value
=
False
,
visible
=
GFPGAN
is
not
None
)
gr
.
Checkbox
(
label
=
'GFPGAN'
,
value
=
False
,
visible
=
GFPGAN
is
not
None
)
sd_facefix_strength
=
\
sd_facefix_strength
=
\
gr
.
Slider
(
minimum
=
0.0
,
maximum
=
1.0
,
step
=
0.
001
,
label
=
"GFPGAN s
trength"
,
value
=
1
,
interactive
=
GFPGAN
is
not
None
,
visible
=
False
)
gr
.
Slider
(
minimum
=
0.0
,
maximum
=
1.0
,
step
=
0.
1
,
label
=
"S
trength"
,
value
=
1
,
interactive
=
GFPGAN
is
not
None
,
visible
=
False
)
sd_use_input_seed
=
\
sd_use_input_seed
=
\
gr
.
Checkbox
(
label
=
'Custom seed'
)
gr
.
Checkbox
(
label
=
'Custom seed'
)
...
...
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