Node source/id badge (#781)

* Add basic node badge

* Node source badge

* Prevent manager badge rendering

* Update litegraph (Badge support)

* Add playwright tests

* Separate nodes

* nit

* Checkout devtools repo for browser test expectation CI

* Fix failing unittests

* Rename setting

* Hide all badges in playwright tests

* Handle group node

* Update test expectations [skip ci]

* Fix unittest

---------

Co-authored-by: github-actions <github-actions@github.com>
This commit is contained in:
Chenlei Hu
2024-09-12 09:36:06 +09:00
committed by GitHub
parent f2a30ec197
commit 80ca1808f0
29 changed files with 301 additions and 29 deletions

View File

@@ -51,6 +51,7 @@ import { useToastStore } from '@/stores/toastStore'
import { ModelStore, useModelStore } from '@/stores/modelStore'
import type { ToastMessageOptions } from 'primevue/toast'
import { useWorkspaceStore } from '@/stores/workspaceStateStore'
import { ComfyLGraphNode } from '@/types/comfyLGraphNode'
export const ANIM_PREVIEW_WIDGET = '$$comfy_animation_preview'
@@ -2007,12 +2008,12 @@ export class ComfyApp {
async registerNodeDef(nodeId: string, nodeData: ComfyNodeDef) {
const self = this
const node = class ComfyNode extends LGraphNode {
const node: new () => ComfyLGraphNode = class ComfyNode extends LGraphNode {
static comfyClass? = nodeData.name
// TODO: change to "title?" once litegraph.d.ts has been updated
static title = nodeData.display_name || nodeData.name
static nodeData? = nodeData
static category?: string
static category: string = nodeData.category
constructor(title?: string) {
super(title)
@@ -2083,7 +2084,6 @@ export class ComfyApp {
app.#invokeExtensionsAsync('nodeCreated', this)
}
}
// @ts-expect-error
node.prototype.comfyClass = nodeData.name
this.#addNodeContextMenuHandler(node)
@@ -2092,7 +2092,6 @@ export class ComfyApp {
await this.#invokeExtensionsAsync('beforeRegisterNodeDef', node, nodeData)
LiteGraph.registerNodeType(nodeId, node)
node.category = nodeData.category
}
async registerNodesFromDefs(defs: Record<string, ComfyNodeDef>) {