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
68fbf455
Commit
68fbf455
authored
Jan 04, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'Narsil/fix_safetensors_load_speed'
parents
c4796bcc
5a523d13
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
sd_models.py
modules/sd_models.py
+4
-1
requirements_versions.txt
requirements_versions.txt
+1
-1
No files found.
modules/sd_models.py
View file @
68fbf455
...
...
@@ -171,7 +171,10 @@ def get_state_dict_from_checkpoint(pl_sd):
def
read_state_dict
(
checkpoint_file
,
print_global_state
=
False
,
map_location
=
None
):
_
,
extension
=
os
.
path
.
splitext
(
checkpoint_file
)
if
extension
.
lower
()
==
".safetensors"
:
pl_sd
=
safetensors
.
torch
.
load_file
(
checkpoint_file
,
device
=
map_location
or
shared
.
weight_load_location
)
device
=
map_location
or
shared
.
weight_load_location
if
device
is
None
:
device
=
"cuda:0"
if
torch
.
cuda
.
is_available
()
else
"cpu"
pl_sd
=
safetensors
.
torch
.
load_file
(
checkpoint_file
,
device
=
device
)
else
:
pl_sd
=
torch
.
load
(
checkpoint_file
,
map_location
=
map_location
or
shared
.
weight_load_location
)
...
...
requirements_versions.txt
View file @
68fbf455
...
...
@@ -26,5 +26,5 @@ lark==1.1.2
inflection==0.5.1
GitPython==3.1.27
torchsde==0.2.5
safetensors==0.2.
5
safetensors==0.2.
7
httpcore<=0.15
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