mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-03 14:54:37 +00:00
[Revert] Restrict applyToGraph to PrimitiveNode (#2746)
This commit is contained in:
8
src/types/litegraph-augmentation.d.ts
vendored
8
src/types/litegraph-augmentation.d.ts
vendored
@@ -84,6 +84,14 @@ declare module '@comfyorg/litegraph' {
|
||||
refreshComboInNode?(defs: Record<string, ComfyNodeDef>)
|
||||
/** @deprecated groupNode */
|
||||
updateLink?(link: LLink): LLink | null
|
||||
/**
|
||||
* @deprecated primitive node.
|
||||
* Used by virtual nodes (primitives) to insert their values into the graph prior to queueing.
|
||||
* Externally used by
|
||||
* - https://github.com/pythongosssss/ComfyUI-Custom-Scripts/blob/bbda5e52ad580c13ceaa53136d9c2bed9137bd2e/web/js/presetText.js#L160-L182
|
||||
* - https://github.com/Kosinkadink/ComfyUI-VideoHelperSuite/blob/4c7858ddd5126f7293dc3c9f6e0fc4c263cde079/web/js/VHS.core.js#L1889-L1889
|
||||
*/
|
||||
applyToGraph?(extraLinks?: LLink[]): void
|
||||
onExecutionStart?(): unknown
|
||||
/**
|
||||
* Callback invoked when the node is dragged over from an external source, i.e.
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { LGraph } from '@comfyorg/litegraph'
|
||||
import { LGraphEventMode } from '@comfyorg/litegraph'
|
||||
|
||||
import type { ComfyApiWorkflow, ComfyWorkflowJSON } from '@/types/comfyWorkflow'
|
||||
import { isPrimitiveNode } from '@/utils/typeGuardUtil'
|
||||
|
||||
/**
|
||||
* Converts the current graph workflow for sending to the API.
|
||||
@@ -18,7 +17,7 @@ export const graphToPrompt = async (
|
||||
for (const node of graph.computeExecutionOrder(false)) {
|
||||
const innerNodes = node.getInnerNodes ? node.getInnerNodes() : [node]
|
||||
for (const innerNode of innerNodes) {
|
||||
if (isPrimitiveNode(innerNode)) {
|
||||
if (innerNode.isVirtualNode) {
|
||||
innerNode.applyToGraph?.()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user