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
6991f2cb
Commit
6991f2cb
authored
Sep 15, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SD upscale with Batch count>1 results broken images #512
parent
0fde1f3e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
modules/img2img.py
modules/img2img.py
+5
-3
No files found.
modules/img2img.py
View file @
6991f2cb
...
...
@@ -76,6 +76,7 @@ def img2img(prompt: str, negative_prompt: str, prompt_style: str, prompt_style2:
grid
=
images
.
split_grid
(
img
,
tile_w
=
width
,
tile_h
=
height
,
overlap
=
upscale_overlap
)
batch_size
=
p
.
batch_size
upscale_count
=
p
.
n_iter
p
.
n_iter
=
1
p
.
do_not_save_grid
=
True
...
...
@@ -87,7 +88,7 @@ def img2img(prompt: str, negative_prompt: str, prompt_style: str, prompt_style2:
for
tiledata
in
row
:
work
.
append
(
tiledata
[
2
])
batch_count
=
math
.
ceil
(
len
(
work
)
/
p
.
batch_size
)
batch_count
=
math
.
ceil
(
len
(
work
)
/
batch_size
)
state
.
job_count
=
batch_count
*
upscale_count
print
(
f
"SD upscaling will process a total of {len(work)} images tiled as {len(grid.tiles[0][2])}x{len(grid.tiles)} per upscale in a total of {state.job_count} batches."
)
...
...
@@ -99,9 +100,10 @@ def img2img(prompt: str, negative_prompt: str, prompt_style: str, prompt_style2:
work_results
=
[]
for
i
in
range
(
batch_count
):
p
.
init_images
=
work
[
i
*
p
.
batch_size
:(
i
+
1
)
*
p
.
batch_size
]
p
.
batch_size
=
batch_size
p
.
init_images
=
work
[
i
*
batch_size
:(
i
+
1
)
*
batch_size
]
state
.
job
=
f
"Batch {i + 1} out of {state.job_count}"
state
.
job
=
f
"Batch {i + 1
+ n * batch_count
} out of {state.job_count}"
processed
=
process_images
(
p
)
if
initial_info
is
None
:
...
...
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