Skip to content

Commit af1a90b

Browse files
committed
Register two extensions so they can be individually enabled/disabled in
the new "extensions" page in ComfyUI options. #16
1 parent 4d3348a commit af1a90b

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

js/QuickConnection.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
export class QuickConnection {
1212
constructor() {
1313
this.insideConnection = null;
14-
this.enabled = true;
14+
this.enabled = false;
1515
// use inputs that already have a link to them.
1616
this.useInputsWithLinks = false;
1717
this.release_link_on_empty_shows_menu = true;
@@ -54,6 +54,7 @@ export class QuickConnection {
5454
}
5555

5656
initListeners(canvas) {
57+
this.enabled = true;
5758
this.graph = canvas.graph;
5859
this.canvas = canvas;
5960
if (!this.canvas.canvas) {

js/quick_conn_start.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,10 @@ import { CircuitBoardLines } from './CircuitBoardLines.js';
99
const quickConnection = new QuickConnection();
1010
quickConnection.init();
1111

12-
const circuitBoardLines = new CircuitBoardLines();
13-
circuitBoardLines.init();
14-
15-
const ext = {
12+
const quickConnectionsExt = {
1613
name: "Quick Connections",
17-
1814
init() {
1915
quickConnection.initListeners(app.canvas);
20-
circuitBoardLines.initOverrides(app.canvas);
21-
2216
const quickConnectionId = "quick-connections";
2317
const quickConnectionEnableId = `${quickConnectionId}.enable`;
2418
app.ui.settings.addSetting({
@@ -47,6 +41,15 @@ const ext = {
4741
return app.graph.change.apply(app.graph, args);
4842
},
4943
});
44+
},
45+
};
46+
47+
const circuitBoardLinesExt = {
48+
name: "Circuit Board Lines",
49+
init() {
50+
const circuitBoardLines = new CircuitBoardLines();
51+
circuitBoardLines.init();
52+
circuitBoardLines.initOverrides(app.canvas);
5053

5154
const circuitBoardId = "circuit-board-lines";
5255
const circuitBoardEnableId = `${circuitBoardId}.enable`;
@@ -91,4 +94,5 @@ const ext = {
9194
},
9295
};
9396

94-
app.registerExtension(ext);
97+
app.registerExtension(quickConnectionsExt);
98+
app.registerExtension(circuitBoardLinesExt);

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "quick-connections"
33
description = "Quick connections, Circuit board connections"
4-
version = "1.0.13"
4+
version = "1.0.14"
55
license = {text = "MIT License"}
66

77
[project.urls]

0 commit comments

Comments
 (0)