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
915d1da1
Commit
915d1da1
authored
Jun 01, 2023
by
AUTOMATIC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
assign devices.dtype early because it's needed before the model is loaded
parent
88443579
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
2 deletions
+4
-2
modules/sd_models.py
modules/sd_models.py
+0
-2
modules/shared.py
modules/shared.py
+4
-0
No files found.
modules/sd_models.py
View file @
915d1da1
...
...
@@ -313,8 +313,6 @@ def load_model_weights(model, checkpoint_info: CheckpointInfo, state_dict, timer
timer
.
record
(
"apply half()"
)
devices
.
dtype
=
torch
.
float32
if
shared
.
cmd_opts
.
no_half
else
torch
.
float16
devices
.
dtype_vae
=
torch
.
float32
if
shared
.
cmd_opts
.
no_half
or
shared
.
cmd_opts
.
no_half_vae
else
torch
.
float16
devices
.
dtype_unet
=
model
.
model
.
diffusion_model
.
dtype
devices
.
unet_needs_upcast
=
shared
.
cmd_opts
.
upcast_sampling
and
devices
.
dtype
==
torch
.
float16
and
devices
.
dtype_unet
==
torch
.
float16
...
...
modules/shared.py
View file @
915d1da1
...
...
@@ -6,6 +6,7 @@ import threading
import
time
import
gradio
as
gr
import
torch
import
tqdm
import
modules.interrogate
...
...
@@ -76,6 +77,9 @@ cmd_opts.disable_extension_access = (cmd_opts.share or cmd_opts.listen or cmd_op
devices
.
device
,
devices
.
device_interrogate
,
devices
.
device_gfpgan
,
devices
.
device_esrgan
,
devices
.
device_codeformer
=
\
(
devices
.
cpu
if
any
(
y
in
cmd_opts
.
use_cpu
for
y
in
[
x
,
'all'
])
else
devices
.
get_optimal_device
()
for
x
in
[
'sd'
,
'interrogate'
,
'gfpgan'
,
'esrgan'
,
'codeformer'
])
devices
.
dtype
=
torch
.
float32
if
cmd_opts
.
no_half
else
torch
.
float16
devices
.
dtype_vae
=
torch
.
float32
if
cmd_opts
.
no_half
or
cmd_opts
.
no_half_vae
else
torch
.
float16
device
=
devices
.
device
weight_load_location
=
None
if
cmd_opts
.
lowram
else
"cpu"
...
...
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