mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-20 14:30:41 +00:00
Display optional indicator on subgraphNode inputs
This commit is contained in:
@@ -8,8 +8,8 @@ import type { LGraphEventMap } from './LGraphEventMap'
|
||||
export interface SubgraphInputEventMap extends LGraphEventMap {
|
||||
'input-connected': {
|
||||
input: INodeInputSlot
|
||||
widget: IBaseWidget
|
||||
node: LGraphNode
|
||||
widget?: IBaseWidget
|
||||
node?: LGraphNode
|
||||
}
|
||||
|
||||
'input-disconnected': {
|
||||
|
||||
@@ -95,6 +95,8 @@ export class SubgraphInput extends SubgraphSlot {
|
||||
widget: inputWidget,
|
||||
node
|
||||
})
|
||||
} else {
|
||||
this.events.dispatch('input-connected', { input: slot })
|
||||
}
|
||||
|
||||
const link = new LLink(
|
||||
|
||||
@@ -764,6 +764,8 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
||||
'input-connected',
|
||||
(e) => {
|
||||
this._invalidatePromotedViewsCache()
|
||||
input.shape = e.detail.input.shape
|
||||
if (!e.detail.widget || !e.detail.node) return
|
||||
|
||||
// `SubgraphInput.connect()` dispatches before appending to `linkIds`,
|
||||
// so resolve by current links would miss this new connection.
|
||||
@@ -900,6 +902,9 @@ export class SubgraphNode extends LGraphNode implements BaseLGraph {
|
||||
name: slot.name,
|
||||
localized_name: slot.localized_name,
|
||||
label: slot.label,
|
||||
shape: this.subgraph.links[slot.linkIds[0]]?.resolve(
|
||||
this.subgraph
|
||||
)?.input?.shape,
|
||||
type: slot.type,
|
||||
link: null
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user