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
a89cbb66
Commit
a89cbb66
authored
Apr 29, 2023
by
comfyanonymous
Browse files
Merge branch 'filter-search-by-type' of
https://github.com/pythongosssss/ComfyUI
parents
15a4c0db
ffd0f9f4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
web/extensions/core/slotDefaults.js
web/extensions/core/slotDefaults.js
+19
-0
No files found.
web/extensions/core/slotDefaults.js
View file @
a89cbb66
...
...
@@ -6,6 +6,7 @@ app.registerExtension({
name
:
"
Comfy.SlotDefaults
"
,
suggestionsNumber
:
null
,
init
()
{
LiteGraph
.
search_filter_enabled
=
true
;
LiteGraph
.
middle_click_slot_add_default_node
=
true
;
this
.
suggestionsNumber
=
app
.
ui
.
settings
.
addSetting
({
id
:
"
Comfy.NodeSuggestions.number
"
,
...
...
@@ -43,6 +44,14 @@ app.registerExtension({
}
if
(
this
.
slot_types_default_out
[
type
].
includes
(
nodeId
))
continue
;
this
.
slot_types_default_out
[
type
].
push
(
nodeId
);
// Input types have to be stored as lower case
// Store each node that can handle this input type
const
lowerType
=
type
.
toLocaleLowerCase
();
if
(
!
(
lowerType
in
LiteGraph
.
registered_slot_in_types
))
{
LiteGraph
.
registered_slot_in_types
[
lowerType
]
=
{
nodes
:
[]
};
}
LiteGraph
.
registered_slot_in_types
[
lowerType
].
nodes
.
push
(
nodeType
.
comfyClass
);
}
var
outputs
=
nodeData
[
"
output
"
];
...
...
@@ -53,6 +62,16 @@ app.registerExtension({
}
this
.
slot_types_default_in
[
type
].
push
(
nodeId
);
// Store each node that can handle this output type
if
(
!
(
type
in
LiteGraph
.
registered_slot_out_types
))
{
LiteGraph
.
registered_slot_out_types
[
type
]
=
{
nodes
:
[]
};
}
LiteGraph
.
registered_slot_out_types
[
type
].
nodes
.
push
(
nodeType
.
comfyClass
);
if
(
!
LiteGraph
.
slot_types_out
.
includes
(
type
))
{
LiteGraph
.
slot_types_out
.
push
(
type
);
}
}
var
maxNum
=
this
.
suggestionsNumber
.
value
;
this
.
setDefaults
(
maxNum
);
...
...
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