feat: make compatible to single files

This commit is contained in:
pixelass
2023-07-30 23:09:46 +02:00
parent 9e31d21b88
commit ea45fc6554
11 changed files with 19 additions and 19 deletions
+6 -6
View File
@@ -9,8 +9,8 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { $el } from "../../../scripts/ui.js";
import { app } from "../scripts/app.js";
import { $el } from "../scripts/ui.js";
function getColor(index, lengthOfItems, l = 0.5) {
// Normalize the index value to be between 0 and 360 for full spectrum of hue
@@ -154,28 +154,28 @@ function setColorMode(value, app) {
case 1:
app.graph.afterChange = function () {
uncolor(app);
return applyChanges?.apply(this, arguments);
return afterChange?.apply(this, arguments);
};
uncolor(app);
break;
case 2:
app.graph.afterChange = function () {
rainbowify(app);
return applyChanges?.apply(this, arguments);
return afterChange?.apply(this, arguments);
};
rainbowify(app);
break;
case 3:
app.graph.afterChange = function () {
colorByType(app);
return applyChanges?.apply(this, arguments);
return afterChange?.apply(this, arguments);
};
colorByType(app);
break;
case 4:
app.graph.afterChange = function () {
colorPositiveNegative(app);
return applyChanges?.apply(this, arguments);
return afterChange?.apply(this, arguments);
};
colorPositiveNegative(app);
break;
+1 -1
View File
@@ -9,7 +9,7 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { app } from "../scripts/app.js";
/**
* Connections Width
+1 -1
View File
@@ -9,7 +9,7 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { app } from "../scripts/app.js";
/**
* Render all nodes as box
+1 -1
View File
@@ -9,7 +9,7 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { app } from "../scripts/app.js";
/**
* Always snap to grid
+2 -2
View File
@@ -10,8 +10,8 @@
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { $el } from "../../../scripts/ui.js";
import { app } from "../scripts/app.js";
import { $el } from "../scripts/ui.js";
/**
* Toggle links render mode
+1 -3
View File
@@ -9,7 +9,7 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { app } from "../scripts/app.js";
/**
* Nodes
@@ -33,14 +33,12 @@ app.registerExtension({
});
},
async setup(app) {
console.log(app);
app.graph._nodes.forEach((node) => {
let active = JSON.parse(
window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false",
);
const onResize = node.onResize;
node.onResize = function (size) {
console.log(active);
if (active) {
Array.from(store.stack)
.filter((node_) => node_ !== node)
+2 -2
View File
@@ -9,8 +9,8 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { $el } from "../../../scripts/ui.js";
import { app } from "../scripts/app.js";
import { $el } from "../scripts/ui.js";
/**
* Pin/Unpin all nodes on canvas
+1 -1
View File
@@ -9,7 +9,7 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { app } from "../scripts/app.js";
/**
* Render Shadow
+2 -2
View File
@@ -9,8 +9,8 @@
* GitHub: https://github.com/failfa-st
* Discord: https://discord.com/invite/m3TBB9XEkb
*/
import { app } from "../../../scripts/app.js";
import { $el } from "../../../scripts/ui.js";
import { app } from "../scripts/app.js";
import { $el } from "../scripts/ui.js";
/**
* Font size of prompt fields
+1
View File
@@ -0,0 +1 @@
export * from "../../../scripts/app.js";
+1
View File
@@ -0,0 +1 @@
export * from "../../../scripts/ui.js";