mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 03:04:11 +00:00
Add support for LiteGraph to convert to classes (#334)
* Add support for LiteGraph to convert to classes * Fix large context menu search regression * Remove debug code * Fix regression from rename & prototype change * Fix super() calls to match LGraphNode
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
import { ComfyWidgets, addValueControlWidgets } from '../../scripts/widgets'
|
||||
import { app } from '../../scripts/app'
|
||||
import { applyTextReplacements } from '../../scripts/utils'
|
||||
import { LiteGraph } from '@comfyorg/litegraph'
|
||||
import type { LGraphNode, INodeInputSlot, IWidget } from '@comfyorg/litegraph'
|
||||
import { LiteGraph, LGraphNode } from '@comfyorg/litegraph'
|
||||
import type { INodeInputSlot, IWidget } from '@comfyorg/litegraph'
|
||||
|
||||
const CONVERTED_TYPE = 'converted-widget'
|
||||
const VALID_TYPES = ['STRING', 'combo', 'number', 'toggle', 'BOOLEAN']
|
||||
@@ -13,11 +13,12 @@ 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 {
|
||||
class PrimitiveNode extends LGraphNode {
|
||||
controlValues: any[]
|
||||
lastType: string
|
||||
static category: string
|
||||
constructor() {
|
||||
constructor(title?: string) {
|
||||
super(title)
|
||||
this.addOutput('connect to widget input', '*')
|
||||
this.serialize_widgets = true
|
||||
this.isVirtualNode = true
|
||||
|
||||
Reference in New Issue
Block a user