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
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
modules/sd_models.py
modules/sd_models.py
+3
-2
modules/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