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
519890a5
Commit
519890a5
authored
Apr 02, 2023
by
pythongosssss
Browse files
Adds middle click for default node creation
Enable two useful properties
parent
27fc64ad
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
0 deletions
+24
-0
web/extensions/core/slotDefaults.js
web/extensions/core/slotDefaults.js
+21
-0
web/scripts/app.js
web/scripts/app.js
+3
-0
No files found.
web/extensions/core/slotDefaults.js
0 → 100644
View file @
519890a5
import
{
app
}
from
"
/scripts/app.js
"
;
// Adds defaults for quickly adding nodes with middle click on the input/output
app
.
registerExtension
({
name
:
"
Comfy.SlotDefaults
"
,
init
()
{
LiteGraph
.
middle_click_slot_add_default_node
=
true
;
LiteGraph
.
slot_types_default_in
=
{
MODEL
:
"
CheckpointLoaderSimple
"
,
LATENT
:
"
EmptyLatentImage
"
,
VAE
:
"
VAELoader
"
,
};
LiteGraph
.
slot_types_default_out
=
{
LATENT
:
"
VAEDecode
"
,
IMAGE
:
"
SaveImage
"
,
CLIP
:
"
CLIPTextEncode
"
,
};
},
});
web/scripts/app.js
View file @
519890a5
...
@@ -676,6 +676,9 @@ class ComfyApp {
...
@@ -676,6 +676,9 @@ class ComfyApp {
const
canvas
=
(
this
.
canvas
=
new
LGraphCanvas
(
canvasEl
,
this
.
graph
));
const
canvas
=
(
this
.
canvas
=
new
LGraphCanvas
(
canvasEl
,
this
.
graph
));
this
.
ctx
=
canvasEl
.
getContext
(
"
2d
"
);
this
.
ctx
=
canvasEl
.
getContext
(
"
2d
"
);
LiteGraph
.
release_link_on_empty_shows_menu
=
true
;
LiteGraph
.
alt_drag_do_clone_nodes
=
true
;
this
.
graph
.
start
();
this
.
graph
.
start
();
function
resizeCanvas
()
{
function
resizeCanvas
()
{
...
...
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