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
210cb4c1
Commit
210cb4c1
authored
Nov 21, 2022
by
Tim Patton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use GPU for loading safetensors, disable export
parent
e134b74c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
sd_models.py
modules/sd_models.py
+3
-2
ui.py
modules/ui.py
+2
-1
No files found.
modules/sd_models.py
View file @
210cb4c1
...
...
@@ -147,8 +147,9 @@ def torch_load(model_filename, model_info, map_override=None):
map_override
=
shared
.
weight_load_location
if
not
map_override
else
map_override
if
(
checkpoint_types
[
model_info
.
exttype
]
==
'safetensors'
):
# safely load weights
# TODO: safetensors supports zero copy fast load to gpu, see issue #684
return
load_file
(
model_filename
,
device
=
map_override
)
# TODO: safetensors supports zero copy fast load to gpu, see issue #684.
# GPU only for now, see https://github.com/huggingface/safetensors/issues/95
return
load_file
(
model_filename
,
device
=
'cuda'
)
else
:
return
torch
.
load
(
model_filename
,
map_location
=
map_override
)
...
...
modules/ui.py
View file @
210cb4c1
...
...
@@ -1187,7 +1187,8 @@ def create_ui(wrap_gradio_gpu_call):
interp_amount
=
gr
.
Slider
(
minimum
=
0.0
,
maximum
=
1.0
,
step
=
0.05
,
label
=
'Multiplier (M) - set to 0 to get model A'
,
value
=
0.3
)
interp_method
=
gr
.
Radio
(
choices
=
[
"Weighted sum"
,
"Add difference"
],
value
=
"Weighted sum"
,
label
=
"Interpolation Method"
)
save_as_half
=
gr
.
Checkbox
(
value
=
False
,
label
=
"Save as float16"
)
save_as_safetensors
=
gr
.
Checkbox
(
value
=
False
,
label
=
"Save as safetensors format"
)
# invisible until feature can be verified
save_as_safetensors
=
gr
.
Checkbox
(
value
=
False
,
label
=
"Save as safetensors format"
,
visible
=
False
)
modelmerger_merge
=
gr
.
Button
(
elem_id
=
"modelmerger_merge"
,
label
=
"Merge"
,
variant
=
'primary'
)
with
gr
.
Column
(
variant
=
'panel'
):
...
...
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