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
4201181b
"app/git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "2e339c2bab50049b9ab0a7f6913571293e0438d4"
Commit
4201181b
authored
Apr 09, 2024
by
comfyanonymous
Browse files
Add ModelMergeSD1, ModelMergeSD2 and ModelMergeSDXL.
parent
30abc324
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
0 deletions
+61
-0
comfy_extras/nodes_model_merging_model_specific.py
comfy_extras/nodes_model_merging_model_specific.py
+60
-0
nodes.py
nodes.py
+1
-0
No files found.
comfy_extras/nodes_model_merging_model_specific.py
0 → 100644
View file @
4201181b
import
comfy_extras.nodes_model_merging
class
ModelMergeSD1
(
comfy_extras
.
nodes_model_merging
.
ModelMergeBlocks
):
CATEGORY
=
"advanced/model_merging/model_specific"
@
classmethod
def
INPUT_TYPES
(
s
):
arg_dict
=
{
"model1"
:
(
"MODEL"
,),
"model2"
:
(
"MODEL"
,)}
argument
=
(
"FLOAT"
,
{
"default"
:
1.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.01
})
arg_dict
[
"time_embed."
]
=
argument
arg_dict
[
"label_emb."
]
=
argument
for
i
in
range
(
12
):
arg_dict
[
"input_blocks.{}."
.
format
(
i
)]
=
argument
for
i
in
range
(
3
):
arg_dict
[
"middle_block.{}."
.
format
(
i
)]
=
argument
for
i
in
range
(
12
):
arg_dict
[
"output_blocks.{}."
.
format
(
i
)]
=
argument
arg_dict
[
"out."
]
=
argument
return
{
"required"
:
arg_dict
}
class
ModelMergeSDXL
(
comfy_extras
.
nodes_model_merging
.
ModelMergeBlocks
):
CATEGORY
=
"advanced/model_merging/model_specific"
@
classmethod
def
INPUT_TYPES
(
s
):
arg_dict
=
{
"model1"
:
(
"MODEL"
,),
"model2"
:
(
"MODEL"
,)}
argument
=
(
"FLOAT"
,
{
"default"
:
1.0
,
"min"
:
0.0
,
"max"
:
1.0
,
"step"
:
0.01
})
arg_dict
[
"time_embed."
]
=
argument
arg_dict
[
"label_emb."
]
=
argument
for
i
in
range
(
9
):
arg_dict
[
"input_blocks.{}"
.
format
(
i
)]
=
argument
for
i
in
range
(
3
):
arg_dict
[
"middle_block.{}"
.
format
(
i
)]
=
argument
for
i
in
range
(
9
):
arg_dict
[
"output_blocks.{}"
.
format
(
i
)]
=
argument
arg_dict
[
"out."
]
=
argument
return
{
"required"
:
arg_dict
}
NODE_CLASS_MAPPINGS
=
{
"ModelMergeSD1"
:
ModelMergeSD1
,
"ModelMergeSD2"
:
ModelMergeSD1
,
#SD1 and SD2 have the same blocks
"ModelMergeSDXL"
:
ModelMergeSDXL
,
}
nodes.py
View file @
4201181b
...
...
@@ -1941,6 +1941,7 @@ def init_custom_nodes():
"nodes_stable_cascade.py"
,
"nodes_differential_diffusion.py"
,
"nodes_ip2p.py"
,
"nodes_model_merging_model_specific.py"
,
]
import_failed
=
[]
...
...
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