Revert "Use npm to manage litegraph dependency (#45)" (#47)

This reverts commit 4640eaf0ac.
This commit is contained in:
Chenlei Hu
2024-06-20 13:55:36 -04:00
committed by GitHub
parent 4640eaf0ac
commit 3ace859106
31 changed files with 16985 additions and 45 deletions

View File

@@ -1,4 +1,3 @@
import { LiteGraph, LGraphCanvas } from "comfyui-litegraph";
import {app} from "../../scripts/app";
import {$el} from "../../scripts/ui";
import type { ColorPalettes } from "/types/colorPalette";
@@ -761,7 +760,8 @@ app.registerExtension({
BACKGROUND_IMAGE = base.BACKGROUND_IMAGE;
CLEAR_BACKGROUND_COLOR = base.CLEAR_BACKGROUND_COLOR;
}
// @ts-ignore
// litegraph.extensions.js
app.canvas.updateBackground(BACKGROUND_IMAGE, CLEAR_BACKGROUND_COLOR);
},
});

View File

@@ -1,4 +1,3 @@
import { LiteGraph } from "comfyui-litegraph";
import {app} from "../../scripts/app";
// Adds filtering to combo context menus

View File

@@ -2,8 +2,7 @@ import { app } from "../../scripts/app";
import { api } from "../../scripts/api";
import { mergeIfValid } from "./widgetInputs";
import { ManageGroupDialog } from "./groupNodeManage";
import type { LGraphNode } from "comfyui-litegraph";
import { LGraphCanvas, LiteGraph } from "comfyui-litegraph";
import type { LGraphNode } from "/types/litegraph";
const GROUP = Symbol();

View File

@@ -3,7 +3,7 @@ import { DraggableList } from "../../scripts/ui/draggableList";
import { GroupNodeConfig, GroupNodeHandler } from "./groupNode";
import "./groupNodeManage.css";
import type { ComfyApp } from "/scripts/app";
import { LiteGraph, type LGraphNode, type LGraphNodeConstructor } from "comfyui-litegraph";
import type { LGraphNode, LGraphNodeConstructor } from "/types/litegraph";
const ORDER: symbol = Symbol();

View File

@@ -1,5 +1,4 @@
import {app} from "../../scripts/app";
import { LGraphCanvas, LiteGraph } from "comfyui-litegraph";
function setNodeMode(node, mode) {
node.mode = mode;

View File

@@ -1,4 +1,3 @@
import { LiteGraph } from "comfyui-litegraph";
import { app } from "../../scripts/app";
// Inverts the scrolling of context menus

View File

@@ -1,5 +1,5 @@
import { app } from "../../scripts/app";
import { LiteGraph } from "comfyui-litegraph";
const id = "Comfy.LinkRenderMode";
const ext = {
name: id,

View File

@@ -2,7 +2,6 @@ import { app } from "../../scripts/app";
import { api } from "../../scripts/api";
import { ComfyDialog, $el } from "../../scripts/ui";
import { GroupNodeConfig, GroupNodeHandler } from "./groupNode";
import { LGraphCanvas } from "comfyui-litegraph";
// Adds the ability to save and add multiple nodes as a template
// To save:

View File

@@ -1,4 +1,3 @@
import { LiteGraph } from "comfyui-litegraph";
import {app} from "../../scripts/app";
import {ComfyWidgets} from "../../scripts/widgets";
// Node that add notes to your project

View File

@@ -1,6 +1,5 @@
import { app } from "../../scripts/app";
import { mergeIfValid, getWidgetConfig, setWidgetConfig } from "./widgetInputs";
import { LiteGraph, LGraphCanvas } from "comfyui-litegraph";
// Node that allows you to redirect connections for cleaner graphs

View File

@@ -1,5 +1,4 @@
import { app } from "../../scripts/app";
import { LGraphCanvas, LiteGraph } from "comfyui-litegraph";
let touchZooming;
let touchCount = 0;

View File

@@ -1,6 +1,5 @@
import { app } from "../../scripts/app";
import { ComfyWidgets } from "../../scripts/widgets";
import { LiteGraph } from "comfyui-litegraph";
// Adds defaults for quickly adding nodes with middle click on the input/output
app.registerExtension({

View File

@@ -1,5 +1,4 @@
import { app } from "../../scripts/app";
import { LGraphCanvas, LGraphNode, LGraphGroup, LiteGraph } from "comfyui-litegraph";
// Shift + drag/resize to snap to grid
@@ -70,14 +69,12 @@ app.registerExtension({
let w, h;
if (node.flags.collapsed) {
// @ts-ignore
w = node._collapsed_width;
h = LiteGraph.NODE_TITLE_HEIGHT;
shiftY -= LiteGraph.NODE_TITLE_HEIGHT;
} else {
w = node.size[0];
h = node.size[1];
// @ts-ignore
let titleMode = node.constructor.title_mode;
if (titleMode !== LiteGraph.TRANSPARENT_TITLE && titleMode !== LiteGraph.NO_TITLE) {
h += LiteGraph.NODE_TITLE_HEIGHT;
@@ -97,7 +94,7 @@ app.registerExtension({
* The currently moving, selected group only. Set after the `selected_group` has actually started
* moving.
*/
let selectedAndMovingGroup: LGraphGroup | null = null;
let selectedAndMovingGroup = null;
/**
* Handles moving a group; tracking when a group has been moved (to show the ghost in `drawGroups`
@@ -144,13 +141,11 @@ app.registerExtension({
if (this.selected_group_resizing) {
roundVectorToGrid(this.selected_group.size);
} else if (selectedAndMovingGroup) {
// @ts-ignore
const [x, y] = roundVectorToGrid([...selectedAndMovingGroup.pos]);
const f = ctx.fillStyle;
const s = ctx.strokeStyle;
ctx.fillStyle = "rgba(100, 100, 100, 0.33)";
ctx.strokeStyle = "rgba(100, 100, 100, 0.66)";
// @ts-ignore
ctx.rect(x, y, ...selectedAndMovingGroup.size);
ctx.fill();
ctx.stroke();

View File

@@ -1,6 +1,5 @@
import { app } from "../../scripts/app";
import { api } from "../../scripts/api";
import { LGraphCanvas, LiteGraph } from "comfyui-litegraph";
const MAX_HISTORY = 50;

View File

@@ -1,7 +1,6 @@
import { ComfyWidgets, addValueControlWidgets } from "../../scripts/widgets";
import { app } from "../../scripts/app";
import { applyTextReplacements } from "../../scripts/utils";
import { LiteGraph } from "comfyui-litegraph";
const CONVERTED_TYPE = "converted-widget";
const VALID_TYPES = ["STRING", "combo", "number", "BOOLEAN"];