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
8515d963
Commit
8515d963
authored
Mar 06, 2023
by
comfyanonymous
Browse files
It's more logical for the StyleModelApply to append it directly.
parent
7ec1dd25
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
22 deletions
+8
-22
nodes.py
nodes.py
+8
-22
No files found.
nodes.py
View file @
8515d963
...
...
@@ -425,33 +425,20 @@ class StyleModelLoader:
class
StyleModelApply
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"clip_vision_output"
:
(
"CLIP_VISION_OUTPUT"
,
),
"style_model"
:
(
"STYLE_MODEL"
,
)
return
{
"required"
:
{
"conditioning"
:
(
"CONDITIONING"
,
),
"style_model"
:
(
"STYLE_MODEL"
,
),
"clip_vision_output"
:
(
"CLIP_VISION_OUTPUT"
,
),
}}
RETURN_TYPES
=
(
"CONDITIONING"
,)
FUNCTION
=
"apply_stylemodel"
CATEGORY
=
"conditioning/style_model"
def
apply_stylemodel
(
self
,
clip_vision_output
,
style_model
):
c
=
style_model
.
get_cond
(
clip_vision_output
)
return
([[
c
,
{}]],
)
class
ConditioningAppend
:
@
classmethod
def
INPUT_TYPES
(
s
):
return
{
"required"
:
{
"conditioning_to"
:
(
"CONDITIONING"
,
),
"conditioning_from"
:
(
"CONDITIONING"
,
)}}
RETURN_TYPES
=
(
"CONDITIONING"
,)
FUNCTION
=
"append"
CATEGORY
=
"conditioning/style_model"
def
append
(
self
,
conditioning_to
,
conditioning_from
):
def
apply_stylemodel
(
self
,
clip_vision_output
,
style_model
,
conditioning
):
cond
=
style_model
.
get_cond
(
clip_vision_output
)
c
=
[]
to_append
=
conditioning_from
[
0
][
0
]
for
t
in
conditioning_to
:
n
=
[
torch
.
cat
((
t
[
0
],
to_append
),
dim
=
1
),
t
[
1
].
copy
()]
for
t
in
conditioning
:
n
=
[
torch
.
cat
((
t
[
0
],
cond
),
dim
=
1
),
t
[
1
].
copy
()]
c
.
append
(
n
)
return
(
c
,
)
...
...
@@ -952,8 +939,7 @@ NODE_CLASS_MAPPINGS = {
"LoraLoader"
:
LoraLoader
,
"CLIPLoader"
:
CLIPLoader
,
"CLIPVisionEncode"
:
CLIPVisionEncode
,
"StyleModelApply"
:
StyleModelApply
,
"ConditioningAppend"
:
ConditioningAppend
,
"StyleModelApply"
:
StyleModelApply
,
"ControlNetApply"
:
ControlNetApply
,
"ControlNetLoader"
:
ControlNetLoader
,
"DiffControlNetLoader"
:
DiffControlNetLoader
,
...
...
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