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
1b9faaa1
Unverified
Commit
1b9faaa1
authored
Nov 04, 2022
by
AUTOMATIC1111
Committed by
GitHub
Nov 04, 2022
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4196 from cobryan05/extras_no_rehash
extras - skip unnecessary second hash of image
parents
faa79b08
313e14de
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
extras.py
modules/extras.py
+3
-2
No files found.
modules/extras.py
View file @
1b9faaa1
...
@@ -136,12 +136,13 @@ def run_extras(extras_mode, resize_mode, image, image_folder, input_dir, output_
...
@@ -136,12 +136,13 @@ def run_extras(extras_mode, resize_mode, image, image_folder, input_dir, output_
def
run_upscalers_blend
(
params
:
List
[
UpscaleParams
],
image
:
Image
.
Image
,
info
:
str
)
->
Tuple
[
Image
.
Image
,
str
]:
def
run_upscalers_blend
(
params
:
List
[
UpscaleParams
],
image
:
Image
.
Image
,
info
:
str
)
->
Tuple
[
Image
.
Image
,
str
]:
blended_result
:
Image
.
Image
=
None
blended_result
:
Image
.
Image
=
None
image_hash
:
str
=
hash
(
np
.
array
(
image
.
getdata
())
.
tobytes
())
for
upscaler
in
params
:
for
upscaler
in
params
:
upscale_args
=
(
upscaler
.
upscaler_idx
,
upscaling_resize
,
resize_mode
,
upscale_args
=
(
upscaler
.
upscaler_idx
,
upscaling_resize
,
resize_mode
,
upscaling_resize_w
,
upscaling_resize_h
,
upscaling_crop
)
upscaling_resize_w
,
upscaling_resize_h
,
upscaling_crop
)
cache_key
=
LruCache
.
Key
(
image_hash
=
hash
(
np
.
array
(
image
.
getdata
())
.
tobytes
())
,
cache_key
=
LruCache
.
Key
(
image_hash
=
image_hash
,
info_hash
=
hash
(
info
),
info_hash
=
hash
(
info
),
args_hash
=
hash
(
(
upscale_args
,
upscale_first
)
))
args_hash
=
hash
(
upscale_args
))
cached_entry
=
cached_images
.
get
(
cache_key
)
cached_entry
=
cached_images
.
get
(
cache_key
)
if
cached_entry
is
None
:
if
cached_entry
is
None
:
res
=
upscale
(
image
,
*
upscale_args
)
res
=
upscale
(
image
,
*
upscale_args
)
...
...
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