Revert "Add support for LiteGraph to convert to classes (#334)" (#386)

This reverts commit e2141a81e2.
This commit is contained in:
Chenlei Hu
2024-08-12 09:19:10 -04:00
committed by GitHub
parent d9df0328c5
commit d607f6c7f7
7 changed files with 37 additions and 49 deletions

View File

@@ -1,8 +1,8 @@
import { ComfyWidgets, addValueControlWidgets } from '../../scripts/widgets'
import { app } from '../../scripts/app'
import { applyTextReplacements } from '../../scripts/utils'
import { LiteGraph, LGraphNode } from '@comfyorg/litegraph'
import type { INodeInputSlot, IWidget } from '@comfyorg/litegraph'
import { LiteGraph } from '@comfyorg/litegraph'
import type { LGraphNode, INodeInputSlot, IWidget } from '@comfyorg/litegraph'
const CONVERTED_TYPE = 'converted-widget'
const VALID_TYPES = ['STRING', 'combo', 'number', 'toggle', 'BOOLEAN']
@@ -13,12 +13,11 @@ const TARGET = Symbol() // Used for reroutes to specify the real target widget
interface PrimitiveNode extends LGraphNode {}
const replacePropertyName = 'Run widget replace on values'
class PrimitiveNode extends LGraphNode {
class PrimitiveNode {
controlValues: any[]
lastType: string
static category: string
constructor(title?: string) {
super(title)
constructor() {
this.addOutput('connect to widget input', '*')
this.serialize_widgets = true
this.isVirtualNode = true