1
1
import { defineStore } from 'pinia'
2
2
3
- import { LGraphNode , SubgraphNode } from '@/lib/litegraph/src/litegraph'
3
+ import {
4
+ LGraphNode ,
5
+ Subgraph ,
6
+ SubgraphNode
7
+ } from '@/lib/litegraph/src/litegraph'
4
8
import {
5
9
ExecutedWsMessage ,
6
10
ResultItem ,
@@ -136,17 +140,22 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
136
140
) {
137
141
if ( ! filenames || ! node ) return
138
142
143
+ const locatorId =
144
+ node . graph instanceof Subgraph
145
+ ? nodeIdToNodeLocatorId ( node . id , node . graph ?? undefined )
146
+ : `${ node . id } `
147
+ if ( ! locatorId ) return
139
148
if ( typeof filenames === 'string' ) {
140
- setNodeOutputsByNodeId (
141
- node . id ,
149
+ setOutputsByLocatorId (
150
+ locatorId ,
142
151
createOutputs ( [ filenames ] , folder , isAnimated )
143
152
)
144
153
} else if ( ! Array . isArray ( filenames ) ) {
145
- setNodeOutputsByNodeId ( node . id , filenames )
154
+ setOutputsByLocatorId ( locatorId , filenames )
146
155
} else {
147
156
const resultItems = createOutputs ( filenames , folder , isAnimated )
148
157
if ( ! resultItems ?. images ?. length ) return
149
- setNodeOutputsByNodeId ( node . id , resultItems )
158
+ setOutputsByLocatorId ( locatorId , resultItems )
150
159
}
151
160
}
152
161
@@ -170,26 +179,6 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
170
179
setOutputsByLocatorId ( nodeLocatorId , outputs , options )
171
180
}
172
181
173
- /**
174
- * Set node outputs by node ID.
175
- * Uses the current graph context to create the appropriate NodeLocatorId.
176
- *
177
- * @param nodeId - The node ID
178
- * @param outputs - The outputs to store
179
- * @param options - Options for setting outputs
180
- * @param options.merge - If true, merge with existing outputs (arrays are concatenated)
181
- */
182
- function setNodeOutputsByNodeId (
183
- nodeId : string | number ,
184
- outputs : ExecutedWsMessage [ 'output' ] | ResultItem ,
185
- options : SetOutputOptions = { }
186
- ) {
187
- const nodeLocatorId = nodeIdToNodeLocatorId ( nodeId )
188
- if ( ! nodeLocatorId ) return
189
-
190
- setOutputsByLocatorId ( nodeLocatorId , outputs , options )
191
- }
192
-
193
182
/**
194
183
* Set node preview images by execution ID (hierarchical ID from backend).
195
184
* Converts the execution ID to a NodeLocatorId before storing.
@@ -288,7 +277,6 @@ export const useNodeOutputStore = defineStore('nodeOutput', () => {
288
277
getNodePreviews,
289
278
setNodeOutputs,
290
279
setNodeOutputsByExecutionId,
291
- setNodeOutputsByNodeId,
292
280
setNodePreviewsByExecutionId,
293
281
setNodePreviewsByNodeId,
294
282
revokePreviewsByExecutionId,
0 commit comments