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
16130c75
Commit
16130c75
authored
Mar 03, 2023
by
comfyanonymous
Browse files
Add support for new colour T2I adapter model.
parent
9d00235b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
2 deletions
+11
-2
comfy/sd.py
comfy/sd.py
+11
-2
No files found.
comfy/sd.py
View file @
16130c75
...
...
@@ -612,6 +612,15 @@ class T2IAdapter:
def
load_t2i_adapter
(
ckpt_path
,
model
=
None
):
t2i_data
=
load_torch_file
(
ckpt_path
)
keys
=
t2i_data
.
keys
()
if
"style_embedding"
in
keys
:
pass
# TODO
# model_ad = adapter.StyleAdapter(width=1024, context_dim=768, num_head=8, n_layes=3, num_token=8)
elif
"body.0.in_conv.weight"
in
keys
:
cin
=
t2i_data
[
'body.0.in_conv.weight'
].
shape
[
1
]
model_ad
=
adapter
.
Adapter_light
(
cin
=
cin
,
channels
=
[
320
,
640
,
1280
,
1280
],
nums_rb
=
4
)
else
:
cin
=
t2i_data
[
'conv_in.weight'
].
shape
[
1
]
model_ad
=
adapter
.
Adapter
(
cin
=
cin
,
channels
=
[
320
,
640
,
1280
,
1280
][:
4
],
nums_rb
=
2
,
ksize
=
1
,
sk
=
True
,
use_conv
=
False
)
model_ad
.
load_state_dict
(
t2i_data
)
...
...
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