Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
ComfyUI
Commits
c3e96e63
Commit
c3e96e63
authored
Jul 03, 2023
by
comfyanonymous
Browse files
Pass device to CLIP model.
parent
5e6bc824
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
comfy/sd.py
comfy/sd.py
+2
-1
No files found.
comfy/sd.py
View file @
c3e96e63
...
...
@@ -526,12 +526,13 @@ class CLIP:
def
__init__
(
self
,
target
=
None
,
embedding_directory
=
None
,
no_init
=
False
):
if
no_init
:
return
params
=
target
.
params
params
=
target
.
params
.
copy
()
clip
=
target
.
clip
tokenizer
=
target
.
tokenizer
load_device
=
model_management
.
text_encoder_device
()
offload_device
=
model_management
.
text_encoder_offload_device
()
params
[
'device'
]
=
load_device
self
.
cond_stage_model
=
clip
(
**
(
params
))
#TODO: make sure this doesn't have a quality loss before enabling.
# if model_management.should_use_fp16(load_device):
...
...
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