mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-21 23:34:31 +00:00
Relands "Add support for LiteGraph to convert to classes" (#667)
* Revert "Revert "Add support for LiteGraph to convert to classes (#334)" (#386)"
This reverts commit d607f6c7f7.
* Format
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