diff --git a/.gitignore b/.gitignore index 723ef36..71d0153 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea \ No newline at end of file +.idea +__pycache__/* diff --git a/__init__.py b/__init__.py index 58e334a..fc5340a 100644 --- a/__init__.py +++ b/__init__.py @@ -1,14 +1,15 @@ import os import shutil -comfy_path = '../..' +comfy_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) failfast_path = os.path.abspath(os.path.dirname(__file__)) def setup_js(): try: js_dest_path = os.path.join(comfy_path, "web", "extensions", "failfast-comfyui-extensions") js_src_path = os.path.join(failfast_path, "extensions") - + print(js_src_path) + print(js_dest_path) if os.path.exists(js_dest_path): shutil.rmtree(js_dest_path) diff --git a/disable.py b/disable.py index 86b234f..1f865b3 100644 --- a/disable.py +++ b/disable.py @@ -5,7 +5,7 @@ import shutil import subprocess -comfy_path = '../..' +comfy_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def rmtree(path): retry_count = 3 diff --git a/extensions/arrange.js b/extensions/arrange.js index 2d187d9..12b7bc5 100644 --- a/extensions/arrange.js +++ b/extensions/arrange.js @@ -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"; /** * Render Shadow @@ -32,13 +32,13 @@ app.registerExtension({ callback: () => app.graph.arrange( LiteGraph.CANVAS_GRID_SIZE * 4, - LiteGraph.VERTICAL_LAYOUT, + LiteGraph.VERTICAL_LAYOUT ), }, { content: "Arrange (horizontal)", callback: () => app.graph.arrange(LiteGraph.CANVAS_GRID_SIZE * 2), - }, + } ); return menuOptions; diff --git a/extensions/colors.js b/extensions/colors.js index 1ced7a1..874e96a 100644 --- a/extensions/colors.js +++ b/extensions/colors.js @@ -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 @@ -311,9 +311,9 @@ app.registerExtension({ node.setDirtyCanvas(true, true); }, }), - ], + ] ), - ]), + ]) ); if (isGroup) { menuRoot.append( @@ -351,9 +351,9 @@ app.registerExtension({ node.setDirtyCanvas(true, true); }, }), - ], + ] ), - ]), + ]) ); } return response; @@ -385,7 +385,7 @@ app.registerExtension({ value: index, selected: index === +value, }); - }), + }) ), $el( "label", @@ -398,19 +398,19 @@ app.registerExtension({ type: "checkbox", checked: window.localStorage.getItem( - `Comfy.Settings.${colorsName}-posneg`, + `Comfy.Settings.${colorsName}-posneg` ) === "true", onchange: (event) => { window.localStorage.setItem( `Comfy.Settings.${colorsName}-posneg`, - event.target.checked.toString(), + event.target.checked.toString() ); if (event.target.checked) { colorPositiveNegative(app); } }, }), - ], + ] ), ]), ]); diff --git a/extensions/connectionsWidth.js b/extensions/connectionsWidth.js index 6a1dd33..3646d72 100644 --- a/extensions/connectionsWidth.js +++ b/extensions/connectionsWidth.js @@ -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 diff --git a/extensions/forceBoxNodes.js b/extensions/forceBoxNodes.js index 3d31a10..ae37515 100644 --- a/extensions/forceBoxNodes.js +++ b/extensions/forceBoxNodes.js @@ -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 diff --git a/extensions/forceSnapToGrid.js b/extensions/forceSnapToGrid.js index 0accfd5..b3a6c63 100644 --- a/extensions/forceSnapToGrid.js +++ b/extensions/forceSnapToGrid.js @@ -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 diff --git a/extensions/groups.js b/extensions/groups.js index eb542ed..065373f 100644 --- a/extensions/groups.js +++ b/extensions/groups.js @@ -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 @@ -52,7 +52,7 @@ app.registerExtension({ node.flags.pinned = true; }); }, - }, + } ); return menuOptions; @@ -92,7 +92,7 @@ app.registerExtension({ }); }); }, - }, + } ); return menuOptions; diff --git a/extensions/linksRenderMode.js b/extensions/linksRenderMode.js index c15373f..bfcee98 100644 --- a/extensions/linksRenderMode.js +++ b/extensions/linksRenderMode.js @@ -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 @@ -50,7 +50,7 @@ app.registerExtension({ value: index, selected: index === +value, }); - }), + }) ), ]), ]); diff --git a/extensions/nodes.js b/extensions/nodes.js index 03cc1b3..61ebe07 100644 --- a/extensions/nodes.js +++ b/extensions/nodes.js @@ -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 @@ -35,7 +35,7 @@ app.registerExtension({ async setup(app) { app.graph._nodes.forEach(function (node) { let active = JSON.parse( - window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false", + window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false" ); const onResize = node.onResize; node.onResize = function (size) { @@ -63,7 +63,7 @@ app.registerExtension({ const onMouseDown = node.onMouseDown; node.onMouseDown = function () { active = JSON.parse( - window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false", + window.localStorage.getItem(`Comfy.Settings.${nodesName}`) ?? "false" ); return onMouseDown?.apply(this, arguments); }; diff --git a/extensions/pinNodes.js b/extensions/pinNodes.js index fccc13e..c6b60f3 100644 --- a/extensions/pinNodes.js +++ b/extensions/pinNodes.js @@ -9,8 +9,7 @@ * 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"; /** * Pin/Unpin all nodes on canvas @@ -41,7 +40,7 @@ app.registerExtension({ node.flags.pinned = false; }); }, - }, + } ); return menuOptions; diff --git a/extensions/renderShadows.js b/extensions/renderShadows.js index c9abaa2..7a0b24e 100644 --- a/extensions/renderShadows.js +++ b/extensions/renderShadows.js @@ -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 diff --git a/extensions/textFields.js b/extensions/textFields.js index 4d3cf46..32f33e5 100644 --- a/extensions/textFields.js +++ b/extensions/textFields.js @@ -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 diff --git a/uninstall.py b/uninstall.py index 86b234f..1f865b3 100644 --- a/uninstall.py +++ b/uninstall.py @@ -5,7 +5,7 @@ import shutil import subprocess -comfy_path = '../..' +comfy_path = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) def rmtree(path): retry_count = 3