Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
S
stable-diffusion-webui
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
stable-diffusion-webui
Commits
63a3ae2b
Commit
63a3ae2b
authored
Sep 01, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix images not displayed when not saving
fix lack of left padding for grids with 1 row
parent
5a6c0740
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
26 deletions
+26
-26
webui.py
webui.py
+26
-26
No files found.
webui.py
View file @
63a3ae2b
...
@@ -548,7 +548,7 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts):
...
@@ -548,7 +548,7 @@ def draw_grid_annotations(im, width, height, hor_texts, ver_texts):
color_active
=
(
0
,
0
,
0
)
color_active
=
(
0
,
0
,
0
)
color_inactive
=
(
153
,
153
,
153
)
color_inactive
=
(
153
,
153
,
153
)
pad_left
=
width
*
3
//
4
if
len
(
ver_texts
)
>
1
else
0
pad_left
=
width
*
3
//
4
if
len
(
ver_texts
)
>
0
else
0
cols
=
im
.
width
//
width
cols
=
im
.
width
//
width
rows
=
im
.
height
//
height
rows
=
im
.
height
//
height
...
@@ -1145,7 +1145,6 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
...
@@ -1145,7 +1145,6 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
x_samples_ddim
=
model
.
decode_first_stage
(
samples_ddim
)
x_samples_ddim
=
model
.
decode_first_stage
(
samples_ddim
)
x_samples_ddim
=
torch
.
clamp
((
x_samples_ddim
+
1.0
)
/
2.0
,
min
=
0.0
,
max
=
1.0
)
x_samples_ddim
=
torch
.
clamp
((
x_samples_ddim
+
1.0
)
/
2.0
,
min
=
0.0
,
max
=
1.0
)
if
p
.
prompt_matrix
or
opts
.
samples_save
or
opts
.
grid_save
:
for
i
,
x_sample
in
enumerate
(
x_samples_ddim
):
for
i
,
x_sample
in
enumerate
(
x_samples_ddim
):
x_sample
=
255.
*
np
.
moveaxis
(
x_sample
.
cpu
()
.
numpy
(),
0
,
2
)
x_sample
=
255.
*
np
.
moveaxis
(
x_sample
.
cpu
()
.
numpy
(),
0
,
2
)
x_sample
=
x_sample
.
astype
(
np
.
uint8
)
x_sample
=
x_sample
.
astype
(
np
.
uint8
)
...
@@ -1172,13 +1171,13 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
...
@@ -1172,13 +1171,13 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
image
.
alpha_composite
(
overlay
)
image
.
alpha_composite
(
overlay
)
image
=
image
.
convert
(
'RGB'
)
image
=
image
.
convert
(
'RGB'
)
if
not
p
.
do_not_save_samples
:
if
opts
.
samples_save
and
not
p
.
do_not_save_samples
:
save_image
(
image
,
p
.
outpath_samples
,
""
,
seeds
[
i
],
prompts
[
i
],
opts
.
samples_format
,
info
=
infotext
())
save_image
(
image
,
p
.
outpath_samples
,
""
,
seeds
[
i
],
prompts
[
i
],
opts
.
samples_format
,
info
=
infotext
())
output_images
.
append
(
image
)
output_images
.
append
(
image
)
unwanted_grid_because_of_img_count
=
len
(
output_images
)
<
2
and
opts
.
grid_only_if_multiple
unwanted_grid_because_of_img_count
=
len
(
output_images
)
<
2
and
opts
.
grid_only_if_multiple
if
(
p
.
prompt_matrix
or
opts
.
grid_save
)
and
not
p
.
do_not_save_grid
and
not
unwanted_grid_because_of_img_count
:
if
not
p
.
do_not_save_grid
and
not
unwanted_grid_because_of_img_count
:
return_grid
=
opts
.
return_grid
return_grid
=
opts
.
return_grid
if
p
.
prompt_matrix
:
if
p
.
prompt_matrix
:
...
@@ -1198,6 +1197,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
...
@@ -1198,6 +1197,7 @@ def process_images(p: StableDiffusionProcessing) -> Processed:
if
return_grid
:
if
return_grid
:
output_images
.
insert
(
0
,
grid
)
output_images
.
insert
(
0
,
grid
)
if
opts
.
grid_save
:
save_image
(
grid
,
p
.
outpath_grids
,
"grid"
,
seed
,
prompt
,
opts
.
grid_format
,
info
=
infotext
(),
short_filename
=
not
opts
.
grid_extended_filename
)
save_image
(
grid
,
p
.
outpath_grids
,
"grid"
,
seed
,
prompt
,
opts
.
grid_format
,
info
=
infotext
(),
short_filename
=
not
opts
.
grid_extended_filename
)
torch_gc
()
torch_gc
()
...
...
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