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
809cc85a
Commit
809cc85a
authored
Jun 02, 2024
by
comfyanonymous
Browse files
Remove useless code.
parent
b2498620
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
comfy/model_patcher.py
comfy/model_patcher.py
+2
-4
No files found.
comfy/model_patcher.py
View file @
809cc85a
...
@@ -76,9 +76,7 @@ class ModelPatcher:
...
@@ -76,9 +76,7 @@ class ModelPatcher:
def
model_size
(
self
):
def
model_size
(
self
):
if
self
.
size
>
0
:
if
self
.
size
>
0
:
return
self
.
size
return
self
.
size
model_sd
=
self
.
model
.
state_dict
()
self
.
size
=
comfy
.
model_management
.
module_size
(
self
.
model
)
self
.
size
=
comfy
.
model_management
.
module_size
(
self
.
model
)
self
.
model_keys
=
set
(
model_sd
.
keys
())
return
self
.
size
return
self
.
size
def
clone
(
self
):
def
clone
(
self
):
...
@@ -90,7 +88,6 @@ class ModelPatcher:
...
@@ -90,7 +88,6 @@ class ModelPatcher:
n
.
object_patches
=
self
.
object_patches
.
copy
()
n
.
object_patches
=
self
.
object_patches
.
copy
()
n
.
model_options
=
copy
.
deepcopy
(
self
.
model_options
)
n
.
model_options
=
copy
.
deepcopy
(
self
.
model_options
)
n
.
model_keys
=
self
.
model_keys
n
.
backup
=
self
.
backup
n
.
backup
=
self
.
backup
n
.
object_patches_backup
=
self
.
object_patches_backup
n
.
object_patches_backup
=
self
.
object_patches_backup
return
n
return
n
...
@@ -210,8 +207,9 @@ class ModelPatcher:
...
@@ -210,8 +207,9 @@ class ModelPatcher:
def
add_patches
(
self
,
patches
,
strength_patch
=
1.0
,
strength_model
=
1.0
):
def
add_patches
(
self
,
patches
,
strength_patch
=
1.0
,
strength_model
=
1.0
):
p
=
set
()
p
=
set
()
model_sd
=
self
.
model
.
state_dict
()
for
k
in
patches
:
for
k
in
patches
:
if
k
in
self
.
model_
key
s
:
if
k
in
model_s
d
:
p
.
add
(
k
)
p
.
add
(
k
)
current_patches
=
self
.
patches
.
get
(
k
,
[])
current_patches
=
self
.
patches
.
get
(
k
,
[])
current_patches
.
append
((
strength_patch
,
patches
[
k
],
strength_model
))
current_patches
.
append
((
strength_patch
,
patches
[
k
],
strength_model
))
...
...
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