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
1fc278bc
Commit
1fc278bc
authored
Oct 21, 2022
by
wywywywy
Committed by
GitHub
Oct 21, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed job count & single-output grid
parent
18df060c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
scripts/outpainting_mk_2.py
scripts/outpainting_mk_2.py
+5
-9
No files found.
scripts/outpainting_mk_2.py
View file @
1fc278bc
...
...
@@ -172,10 +172,6 @@ class Script(scripts.Script):
if
down
>
0
:
down
=
target_h
-
init_img
.
height
-
up
init_image
=
p
.
init_images
[
0
]
state
.
job_count
=
(
1
if
left
>
0
else
0
)
+
(
1
if
right
>
0
else
0
)
+
(
1
if
up
>
0
else
0
)
+
(
1
if
down
>
0
else
0
)
def
expand
(
init
,
count
,
expand_pixels
,
is_left
=
False
,
is_right
=
False
,
is_top
=
False
,
is_bottom
=
False
):
is_horiz
=
is_left
or
is_right
is_vert
=
is_top
or
is_bottom
...
...
@@ -250,7 +246,7 @@ class Script(scripts.Script):
batch_count
=
p
.
n_iter
batch_size
=
p
.
batch_size
p
.
n_iter
=
1
state
.
job_count
=
batch_count
state
.
job_count
=
batch_count
*
batch_size
*
((
1
if
left
>
0
else
0
)
+
(
1
if
right
>
0
else
0
)
+
(
1
if
up
>
0
else
0
)
+
(
1
if
down
>
0
else
0
))
all_processed_images
=
[]
for
i
in
range
(
batch_count
):
...
...
@@ -268,10 +264,11 @@ class Script(scripts.Script):
all_processed_images
+=
imgs
combined_grid_image
=
images
.
image_grid
(
all_processed_images
)
all_images
=
all_processed_images
if
opts
.
return_grid
:
combined_grid_image
=
images
.
image_grid
(
all_processed_images
)
unwanted_grid_because_of_img_count
=
len
(
all_processed_images
)
<
2
and
opts
.
grid_only_if_multiple
if
opts
.
return_grid
and
not
unwanted_grid_because_of_img_count
:
all_images
=
[
combined_grid_image
]
+
all_processed_images
res
=
Processed
(
p
,
all_images
,
initial_seed_and_info
[
0
],
initial_seed_and_info
[
1
])
...
...
@@ -280,8 +277,7 @@ class Script(scripts.Script):
for
img
in
all_processed_images
:
images
.
save_image
(
img
,
p
.
outpath_samples
,
""
,
res
.
seed
,
p
.
prompt
,
opts
.
grid_format
,
info
=
res
.
info
,
p
=
p
)
if
opts
.
grid_save
:
if
opts
.
grid_save
and
not
unwanted_grid_because_of_img_count
:
images
.
save_image
(
combined_grid_image
,
p
.
outpath_grids
,
"grid"
,
res
.
seed
,
p
.
prompt
,
opts
.
grid_format
,
info
=
res
.
info
,
short_filename
=
not
opts
.
grid_extended_filename
,
grid
=
True
,
p
=
p
)
return
res
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