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
d7b67d9b
Commit
d7b67d9b
authored
Sep 03, 2022
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
load GFPGAN once and keep it in memory for #53
parent
e5fc7bb5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
webui.py
webui.py
+9
-1
No files found.
webui.py
View file @
d7b67d9b
...
@@ -179,8 +179,16 @@ def gfpgan_model_path():
...
@@ -179,8 +179,16 @@ def gfpgan_model_path():
return
found
[
0
]
return
found
[
0
]
loaded_gfpgan_model
=
None
def
gfpgan
():
def
gfpgan
():
return
GFPGANer
(
model_path
=
gfpgan_model_path
(),
upscale
=
1
,
arch
=
'clean'
,
channel_multiplier
=
2
,
bg_upsampler
=
None
)
global
loaded_gfpgan_model
if
loaded_gfpgan_model
is
None
:
loaded_gfpgan_model
=
GFPGANer
(
model_path
=
gfpgan_model_path
(),
upscale
=
1
,
arch
=
'clean'
,
channel_multiplier
=
2
,
bg_upsampler
=
None
)
return
loaded_gfpgan_model
def
gfpgan_fix_faces
(
gfpgan_model
,
np_image
):
def
gfpgan_fix_faces
(
gfpgan_model
,
np_image
):
np_image_bgr
=
np_image
[:,
:,
::
-
1
]
np_image_bgr
=
np_image
[:,
:,
::
-
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