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
1c012d69
Commit
1c012d69
authored
Aug 31, 2023
by
comfyanonymous
Browse files
It doesn't make sense for c_crossattn and c_concat to be lists.
parent
5f101f4d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
comfy/model_base.py
comfy/model_base.py
+2
-2
comfy/samplers.py
comfy/samplers.py
+2
-2
No files found.
comfy/model_base.py
View file @
1c012d69
...
@@ -50,10 +50,10 @@ class BaseModel(torch.nn.Module):
...
@@ -50,10 +50,10 @@ class BaseModel(torch.nn.Module):
def
apply_model
(
self
,
x
,
t
,
c_concat
=
None
,
c_crossattn
=
None
,
c_adm
=
None
,
control
=
None
,
transformer_options
=
{}):
def
apply_model
(
self
,
x
,
t
,
c_concat
=
None
,
c_crossattn
=
None
,
c_adm
=
None
,
control
=
None
,
transformer_options
=
{}):
if
c_concat
is
not
None
:
if
c_concat
is
not
None
:
xc
=
torch
.
cat
([
x
]
+
c_concat
,
dim
=
1
)
xc
=
torch
.
cat
([
x
]
+
[
c_concat
]
,
dim
=
1
)
else
:
else
:
xc
=
x
xc
=
x
context
=
torch
.
cat
(
c_crossattn
,
1
)
context
=
c_crossattn
dtype
=
self
.
get_dtype
()
dtype
=
self
.
get_dtype
()
xc
=
xc
.
to
(
dtype
)
xc
=
xc
.
to
(
dtype
)
t
=
t
.
to
(
dtype
)
t
=
t
.
to
(
dtype
)
...
...
comfy/samplers.py
View file @
1c012d69
...
@@ -165,9 +165,9 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
...
@@ -165,9 +165,9 @@ def sampling_function(model_function, x, timestep, uncond, cond, cond_scale, con
c_crossattn_out
.
append
(
c
)
c_crossattn_out
.
append
(
c
)
if
len
(
c_crossattn_out
)
>
0
:
if
len
(
c_crossattn_out
)
>
0
:
out
[
'c_crossattn'
]
=
[
torch
.
cat
(
c_crossattn_out
)
]
out
[
'c_crossattn'
]
=
torch
.
cat
(
c_crossattn_out
)
if
len
(
c_concat
)
>
0
:
if
len
(
c_concat
)
>
0
:
out
[
'c_concat'
]
=
[
torch
.
cat
(
c_concat
)
]
out
[
'c_concat'
]
=
torch
.
cat
(
c_concat
)
if
len
(
c_adm
)
>
0
:
if
len
(
c_adm
)
>
0
:
out
[
'c_adm'
]
=
torch
.
cat
(
c_adm
)
out
[
'c_adm'
]
=
torch
.
cat
(
c_adm
)
return
out
return
out
...
...
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