mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-20 23:04:06 +00:00
Use npm package @ComfyOrg/litegraph (#89)
* Use npm to manage litegraph * Fix merge issues caused by BetaUI change * Switch to @comfyorg/litegraph * Fix various import * Fix css apply order bug * Fix package lock * Update litegraph * Update litegraph * Update browsertest expectations * Update test expectations [skip ci] * Fix default view screenshot --------- Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
@@ -15,12 +15,21 @@ import { createImageHost, calculateImageGrid } from "./ui/imagePreview";
|
||||
import { DraggableList } from "./ui/draggableList";
|
||||
import { applyTextReplacements, addStylesheet } from "./utils";
|
||||
import type { ComfyExtension } from "/types/comfy";
|
||||
import type { LGraph, LGraphCanvas, LGraphNode } from "/types/litegraph";
|
||||
import { type ComfyWorkflow, parseComfyWorkflow } from "../types/comfyWorkflow";
|
||||
import { ComfyNodeDef } from "/types/apiTypes";
|
||||
import { ComfyAppMenu } from "./ui/menu/index.js";
|
||||
import { getStorageValue, setStorageValue } from "./utils.js";
|
||||
import { ComfyWorkflowManager } from "./workflows.js";
|
||||
import {
|
||||
LGraphCanvas,
|
||||
LGraph,
|
||||
LGraphNode,
|
||||
LiteGraph,
|
||||
} from "@comfyorg/litegraph";
|
||||
|
||||
// CSS imports. style.css must be imported later as it overwrites some litegraph styles.
|
||||
import "@comfyorg/litegraph/css/litegraph.css";
|
||||
import "../assets/css/style.css";
|
||||
|
||||
export const ANIM_PREVIEW_WIDGET = "$$comfy_animation_preview";
|
||||
|
||||
@@ -1839,12 +1848,10 @@ export class ComfyApp {
|
||||
this.#addApiUpdateHandlers();
|
||||
this.#addRestoreWorkflowView();
|
||||
|
||||
// @ts-ignore
|
||||
this.graph = new LGraph();
|
||||
|
||||
this.#addAfterConfigureHandler();
|
||||
|
||||
// @ts-ignore
|
||||
this.canvas = new LGraphCanvas(canvasEl, this.graph);
|
||||
this.ctx = canvasEl.getContext("2d");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user