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
b31daadc
Commit
b31daadc
authored
Feb 28, 2023
by
comfyanonymous
Browse files
Try to improve memory issues with del.
parent
cd85f876
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
comfy/sd.py
comfy/sd.py
+4
-1
No files found.
comfy/sd.py
View file @
b31daadc
...
@@ -222,8 +222,11 @@ class ModelPatcher:
...
@@ -222,8 +222,11 @@ class ModelPatcher:
return
self
.
model
return
self
.
model
def
unpatch_model
(
self
):
def
unpatch_model
(
self
):
model_sd
=
self
.
model
.
state_dict
()
model_sd
=
self
.
model
.
state_dict
()
for
k
in
self
.
backup
:
keys
=
list
(
self
.
backup
.
keys
())
for
k
in
keys
:
model_sd
[
k
][:]
=
self
.
backup
[
k
]
model_sd
[
k
][:]
=
self
.
backup
[
k
]
del
self
.
backup
[
k
]
self
.
backup
=
{}
self
.
backup
=
{}
def
load_lora_for_models
(
model
,
clip
,
lora_path
,
strength_model
,
strength_clip
):
def
load_lora_for_models
(
model
,
clip
,
lora_path
,
strength_model
,
strength_clip
):
...
...
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