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
05321fd9
Commit
05321fd9
authored
Aug 03, 2023
by
comfyanonymous
Browse files
Add an experimental CTRL-B shortcut to bypass nodes.
parent
9ccc9658
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
1 deletion
+41
-1
web/scripts/app.js
web/scripts/app.js
+41
-1
No files found.
web/scripts/app.js
View file @
05321fd9
...
...
@@ -768,6 +768,19 @@ export class ComfyApp {
}
block_default
=
true
;
}
if
(
e
.
keyCode
==
66
&&
e
.
ctrlKey
)
{
if
(
this
.
selected_nodes
)
{
for
(
var
i
in
this
.
selected_nodes
)
{
if
(
this
.
selected_nodes
[
i
].
mode
===
4
)
{
// never
this
.
selected_nodes
[
i
].
mode
=
0
;
// always
}
else
{
this
.
selected_nodes
[
i
].
mode
=
4
;
// never
}
}
}
block_default
=
true
;
}
}
this
.
graph
.
change
();
...
...
@@ -914,14 +927,21 @@ export class ComfyApp {
const
origDrawNode
=
LGraphCanvas
.
prototype
.
drawNode
;
LGraphCanvas
.
prototype
.
drawNode
=
function
(
node
,
ctx
)
{
var
editor_alpha
=
this
.
editor_alpha
;
var
old_color
=
node
.
bgcolor
;
if
(
node
.
mode
===
2
)
{
// never
this
.
editor_alpha
=
0.4
;
}
if
(
node
.
mode
===
4
)
{
// never
node
.
bgcolor
=
"
#FF00FF
"
;
this
.
editor_alpha
=
0.2
;
}
const
res
=
origDrawNode
.
apply
(
this
,
arguments
);
this
.
editor_alpha
=
editor_alpha
;
node
.
bgcolor
=
old_color
;
return
res
;
};
...
...
@@ -1308,7 +1328,7 @@ export class ComfyApp {
continue
;
}
if
(
node
.
mode
===
2
)
{
if
(
node
.
mode
===
2
||
node
.
mode
===
4
)
{
// Don't serialize muted nodes
continue
;
}
...
...
@@ -1331,6 +1351,26 @@ export class ComfyApp {
let
parent
=
node
.
getInputNode
(
i
);
if
(
parent
)
{
let
link
=
node
.
getInputLink
(
i
);
while
(
parent
.
mode
===
4
)
{
let
found
=
false
;
if
(
link
)
{
let
all_inputs
=
[
link
.
origin_slot
].
concat
(
parent
.
inputs
)
for
(
let
parent_input
in
all_inputs
)
{
if
(
parent
.
inputs
[
parent_input
].
type
===
node
.
inputs
[
i
].
type
)
{
link
=
parent
.
getInputLink
(
parent_input
);
if
(
link
)
{
parent
=
parent
.
getInputNode
(
parent_input
);
}
found
=
true
;
break
;
}
}
}
if
(
!
found
)
{
break
;
}
}
while
(
parent
&&
parent
.
isVirtualNode
)
{
link
=
parent
.
getInputLink
(
link
.
origin_slot
);
if
(
link
)
{
...
...
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