diff --git a/js/betterCombos.js b/js/betterCombos.js index 7e4a45b..db956fc 100644 --- a/js/betterCombos.js +++ b/js/betterCombos.js @@ -1,6 +1,6 @@ -import { app } from "/scripts/app.js"; -import { ComfyWidgets } from "/scripts/widgets.js"; -import { $el } from "/scripts/ui.js"; +import { app } from "../../../scripts/app.js"; +import { ComfyWidgets } from "../../../scripts/widgets.js"; +import { $el } from "../../../scripts/ui.js"; app.registerExtension({ name: "pysssss.Combo++", diff --git a/js/common/lightbox.js b/js/common/lightbox.js index 1591d3a..7e07445 100644 --- a/js/common/lightbox.js +++ b/js/common/lightbox.js @@ -1,4 +1,4 @@ -import { $el } from "/scripts/ui.js"; +import { $el } from "../../../../scripts/ui.js"; import { addStylesheet, getUrl, loadImage } from "./utils.js"; import { createSpinner } from "./spinner.js"; diff --git a/js/common/utils.js b/js/common/utils.js index 26efb19..91d9a23 100644 --- a/js/common/utils.js +++ b/js/common/utils.js @@ -1,4 +1,4 @@ -import { $el } from "/scripts/ui.js"; +import { $el } from "../../../../scripts/ui.js"; export function addStylesheet(url) { $el("link", { diff --git a/js/contextMenuHook.js b/js/contextMenuHook.js index 8698474..c493e70 100644 --- a/js/contextMenuHook.js +++ b/js/contextMenuHook.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; app.registerExtension({ name: "pysssss.ContextMenuHook", init() { diff --git a/js/customColors.js b/js/customColors.js index 4d129ee..2975c87 100644 --- a/js/customColors.js +++ b/js/customColors.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { $el } from "/scripts/ui.js"; +import { app } from "../../../scripts/app.js"; +import { $el } from "../../../scripts/ui.js"; const colorShade = (col, amt) => { col = col.replace(/^#/, ""); diff --git a/js/faviconStatus.js b/js/faviconStatus.js index 14137ce..a1bcd7b 100644 --- a/js/faviconStatus.js +++ b/js/faviconStatus.js @@ -1,5 +1,5 @@ -import { api } from "/scripts/api.js"; -import { app } from "/scripts/app.js"; +import { api } from "../../../scripts/api.js"; +import { app } from "../../../scripts/app.js"; // Simple script that adds the current queue size to the window title // Adds a favicon that changes color while active diff --git a/js/graphArrange.js b/js/graphArrange.js index ce16d23..063d954 100644 --- a/js/graphArrange.js +++ b/js/graphArrange.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; // Adds right click -> arrange to the canvas diff --git a/js/imageFeed.js b/js/imageFeed.js index 5f76b08..94ce127 100644 --- a/js/imageFeed.js +++ b/js/imageFeed.js @@ -1,6 +1,6 @@ -import { api } from "/scripts/api.js"; -import { app } from "/scripts/app.js"; -import { $el } from "/scripts/ui.js"; +import { api } from "../../../scripts/api.js"; +import { app } from "../../../scripts/app.js"; +import { $el } from "../../../scripts/ui.js"; import { lightbox } from "./common/lightbox.js"; $el("style", { diff --git a/js/kSamplerAdvDenoise.js b/js/kSamplerAdvDenoise.js index 026a2a0..7b92d4f 100644 --- a/js/kSamplerAdvDenoise.js +++ b/js/kSamplerAdvDenoise.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; app.registerExtension({ name: "pysssss.KSamplerAdvDenoise", async beforeRegisterNodeDef(nodeType) { diff --git a/js/linkRenderMode.js b/js/linkRenderMode.js index 72dcf81..010de6e 100644 --- a/js/linkRenderMode.js +++ b/js/linkRenderMode.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { $el } from "/scripts/ui.js"; +import { app } from "../../../scripts/app.js"; +import { $el } from "../../../scripts/ui.js"; const id = "pysssss.LinkRenderMode"; const ext = { diff --git a/js/locking.js b/js/locking.js index 65cd873..9e18308 100644 --- a/js/locking.js +++ b/js/locking.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; // Adds lock/unlock menu item for nodes + groups to prevent moving / resizing them diff --git a/js/mathExpression.js b/js/mathExpression.js index b61693c..28e5088 100644 --- a/js/mathExpression.js +++ b/js/mathExpression.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { ComfyWidgets } from "/scripts/widgets.js"; +import { app } from "../../../scripts/app.js"; +import { ComfyWidgets } from "../../../scripts/widgets.js"; app.registerExtension({ name: "pysssss.MathExpression", diff --git a/js/nodeFinder.js b/js/nodeFinder.js index 62363a2..d372772 100644 --- a/js/nodeFinder.js +++ b/js/nodeFinder.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { api } from "/scripts/api.js"; +import { app } from "../../../scripts/app.js"; +import { api } from "../../../scripts/api.js"; // Adds a menu option to toggle follow the executing node // Adds a menu option to go to the currently executing node diff --git a/js/playSound.js b/js/playSound.js index 5afb1f6..e472170 100644 --- a/js/playSound.js +++ b/js/playSound.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; app.registerExtension({ name: "pysssss.PlaySound", diff --git a/js/presetText.js b/js/presetText.js index 8b89daa..4418dfb 100644 --- a/js/presetText.js +++ b/js/presetText.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; // Allows you to manage preset tags for e.g. common negative prompt // Also performs replacements on any text field e.g. allowing you to use preset text in CLIP Text encode fields diff --git a/js/quickNodes.js b/js/quickNodes.js index f76fdc8..02dfa48 100644 --- a/js/quickNodes.js +++ b/js/quickNodes.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; // Adds a bunch of context menu entries for quickly adding common steps diff --git a/js/reroutePrimitive.js b/js/reroutePrimitive.js index b8c13ac..1b94894 100644 --- a/js/reroutePrimitive.js +++ b/js/reroutePrimitive.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { ComfyWidgets } from "/scripts/widgets.js"; +import { app } from "../../../scripts/app.js"; +import { ComfyWidgets } from "../../../scripts/widgets.js"; const REROUTE_PRIMITIVE = "ReroutePrimitive|pysssss"; const MULTI_PRIMITIVE = "MultiPrimitive|pysssss"; diff --git a/js/showImageOnMenu.js b/js/showImageOnMenu.js index 74c1295..00ea3b5 100644 --- a/js/showImageOnMenu.js +++ b/js/showImageOnMenu.js @@ -1,6 +1,6 @@ -import { app } from "/scripts/app.js"; -import { api } from "/scripts/api.js"; -import { $el } from "/scripts/ui.js"; +import { app } from "../../../scripts/app.js"; +import { api } from "../../../scripts/api.js"; +import { $el } from "../../../scripts/ui.js"; const id = "pysssss.ShowImageOnMenu"; const ext = { diff --git a/js/showText.js b/js/showText.js index a79ad9f..f52b2b2 100644 --- a/js/showText.js +++ b/js/showText.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { ComfyWidgets } from "/scripts/widgets.js"; +import { app } from "../../../scripts/app.js"; +import { ComfyWidgets } from "../../../scripts/widgets.js"; // Displays input text on a node diff --git a/js/snapToGrid.js b/js/snapToGrid.js index 0c905a8..1184475 100644 --- a/js/snapToGrid.js +++ b/js/snapToGrid.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; let setting; const id = "pysssss.SnapToGrid"; diff --git a/js/stringFunction.js b/js/stringFunction.js index 2b15caf..cc150df 100644 --- a/js/stringFunction.js +++ b/js/stringFunction.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { ComfyWidgets } from "/scripts/widgets.js"; +import { app } from "../../../scripts/app.js"; +import { ComfyWidgets } from "../../../scripts/widgets.js"; // Displays input text on a node diff --git a/js/touchEvents.js b/js/touchEvents.js index f89ce54..e983e34 100644 --- a/js/touchEvents.js +++ b/js/touchEvents.js @@ -1,4 +1,4 @@ -import { app } from "/scripts/app.js"; +import { app } from "../../../scripts/app.js"; // Adds mapping of touch events to mouse events for mobile. This isnt great but it is somewhat usable diff --git a/js/widgetDefaults.js b/js/widgetDefaults.js index a47084f..e74862a 100644 --- a/js/widgetDefaults.js +++ b/js/widgetDefaults.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { $el, ComfyDialog } from "/scripts/ui.js"; +import { app } from "../../../scripts/app.js"; +import { $el, ComfyDialog } from "../../../scripts/ui.js"; // Allows you to specify custom default values for any widget on any node diff --git a/js/workflowImage.js b/js/workflowImage.js index 2991e97..5973b61 100644 --- a/js/workflowImage.js +++ b/js/workflowImage.js @@ -1,5 +1,5 @@ -import { app } from "/scripts/app.js"; -import { ComfyWidgets } from "/scripts/widgets.js"; +import { app } from "../../../scripts/app.js"; +import { ComfyWidgets } from "../../../scripts/widgets.js"; let getDrawTextConfig = null; let fileInput; diff --git a/js/workflows.js b/js/workflows.js index 003a89e..9e3687a 100644 --- a/js/workflows.js +++ b/js/workflows.js @@ -1,5 +1,6 @@ -import { app } from "/scripts/app.js"; -import { $el } from "/scripts/ui.js"; +import { app } from "../../../scripts/app.js"; +import { api } from "../../../scripts/api.js" +import { $el } from "../../../scripts/ui.js"; // Adds workflow management // Original implementation by https://github.com/i-h4x @@ -47,18 +48,18 @@ const style = ` `; async function getWorkflows() { - const response = await fetch("/pysssss/workflows", { cache: "no-store" }); + const response = await api.fetchApi("/pysssss/workflows", { cache: "no-store" }); return await response.json(); } async function getWorkflow(name) { - const response = await fetch(`/pysssss/workflows/${encodeURIComponent(name)}`, { cache: "no-store" }); + const response = await api.fetchApi(`/pysssss/workflows/${encodeURIComponent(name)}`, { cache: "no-store" }); return await response.json(); } async function saveWorkflow(name, workflow, overwrite) { try { - const response = await fetch("/pysssss/workflows", { + const response = await api.fetchApi("/pysssss/workflows", { method: "POST", headers: { "Content-Type": "application/json",