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
21bcbb94
Commit
21bcbb94
authored
Aug 26, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix a bug with wrong row count in prompt matrix
parent
21765c17
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
webui.py
webui.py
+6
-5
No files found.
webui.py
View file @
21bcbb94
...
@@ -267,7 +267,7 @@ def load_GFPGAN():
...
@@ -267,7 +267,7 @@ def load_GFPGAN():
return
GFPGANer
(
model_path
=
model_path
,
upscale
=
1
,
arch
=
'clean'
,
channel_multiplier
=
2
,
bg_upsampler
=
None
)
return
GFPGANer
(
model_path
=
model_path
,
upscale
=
1
,
arch
=
'clean'
,
channel_multiplier
=
2
,
bg_upsampler
=
None
)
def
image_grid
(
imgs
,
batch_size
,
round_down
=
False
,
force_n_rows
=
None
):
def
image_grid
(
imgs
,
batch_size
,
force_n_rows
=
None
):
if
force_n_rows
is
not
None
:
if
force_n_rows
is
not
None
:
rows
=
force_n_rows
rows
=
force_n_rows
elif
opts
.
n_rows
>
0
:
elif
opts
.
n_rows
>
0
:
...
@@ -276,7 +276,7 @@ def image_grid(imgs, batch_size, round_down=False, force_n_rows=None):
...
@@ -276,7 +276,7 @@ def image_grid(imgs, batch_size, round_down=False, force_n_rows=None):
rows
=
batch_size
rows
=
batch_size
else
:
else
:
rows
=
math
.
sqrt
(
len
(
imgs
))
rows
=
math
.
sqrt
(
len
(
imgs
))
rows
=
int
(
rows
)
if
round_down
else
round
(
rows
)
rows
=
round
(
rows
)
cols
=
math
.
ceil
(
len
(
imgs
)
/
rows
)
cols
=
math
.
ceil
(
len
(
imgs
)
/
rows
)
...
@@ -688,18 +688,19 @@ def process_images(outpath, func_init, func_sample, prompt, seed, sampler_index,
...
@@ -688,18 +688,19 @@ def process_images(outpath, func_init, func_sample, prompt, seed, sampler_index,
base_count
+=
1
base_count
+=
1
if
(
prompt_matrix
or
opts
.
grid_save
)
and
not
do_not_save_grid
:
if
(
prompt_matrix
or
opts
.
grid_save
)
and
not
do_not_save_grid
:
grid
=
image_grid
(
output_images
,
batch_size
,
round_down
=
prompt_matrix
)
if
prompt_matrix
:
if
prompt_matrix
:
grid
=
image_grid
(
output_images
,
batch_size
,
force_n_rows
=
1
<<
((
len
(
prompt_matrix_parts
)
-
1
)
//
2
))
try
:
try
:
grid
=
draw_prompt_matrix
(
grid
,
width
,
height
,
prompt_matrix_parts
)
grid
=
draw_prompt_matrix
(
grid
,
width
,
height
,
prompt_matrix_parts
)
except
Exception
:
except
:
import
traceback
import
traceback
print
(
"Error creating prompt_matrix text:"
,
file
=
sys
.
stderr
)
print
(
"Error creating prompt_matrix text:"
,
file
=
sys
.
stderr
)
print
(
traceback
.
format_exc
(),
file
=
sys
.
stderr
)
print
(
traceback
.
format_exc
(),
file
=
sys
.
stderr
)
output_images
.
insert
(
0
,
grid
)
output_images
.
insert
(
0
,
grid
)
else
:
grid
=
image_grid
(
output_images
,
batch_size
)
save_image
(
grid
,
outpath
,
f
"grid-{grid_count:04}"
,
seed
,
prompt
,
opts
.
grid_format
,
info
=
infotext
(),
short_filename
=
not
opts
.
grid_extended_filename
)
save_image
(
grid
,
outpath
,
f
"grid-{grid_count:04}"
,
seed
,
prompt
,
opts
.
grid_format
,
info
=
infotext
(),
short_filename
=
not
opts
.
grid_extended_filename
)
grid_count
+=
1
grid_count
+=
1
...
...
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