mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-19 14:30:07 +00:00
Use 'output_node_id' metadata from dropped file
- The file is displayed only on the node it was saved by. - No longer restricted to specific supported node types
This commit is contained in:
@@ -2227,7 +2227,8 @@ export class ComfyApp {
|
||||
restore_view: boolean = true,
|
||||
workflow: string | null | ComfyWorkflow = null,
|
||||
{ showMissingNodesDialog = true, showMissingModelsDialog = true } = {},
|
||||
droppedImageBlobUrl: string | undefined = undefined
|
||||
droppedImageBlobUrl: string | undefined = undefined,
|
||||
output_node_id = undefined
|
||||
) {
|
||||
if (clean !== false) {
|
||||
this.clean()
|
||||
@@ -2418,13 +2419,10 @@ export class ComfyApp {
|
||||
}
|
||||
}
|
||||
|
||||
// Show dropped image on output nodes
|
||||
if (
|
||||
droppedImageBlobUrl &&
|
||||
(node.type === 'SaveImage' || node.type === 'PreviewImage')
|
||||
) {
|
||||
// Show dropped image on its original output node
|
||||
if (droppedImageBlobUrl && String(node.id) === output_node_id) {
|
||||
// @ts-expect-error
|
||||
this.nodePreviewImages[String(node.id)] = [droppedImageBlobUrl]
|
||||
this.nodePreviewImages[output_node_id] = [droppedImageBlobUrl]
|
||||
}
|
||||
|
||||
this.#invokeExtensions('loadedGraphNode', node)
|
||||
@@ -2720,7 +2718,8 @@ export class ComfyApp {
|
||||
true,
|
||||
fileName,
|
||||
undefined,
|
||||
URL.createObjectURL(file)
|
||||
URL.createObjectURL(file),
|
||||
pngInfo.output_node_id
|
||||
)
|
||||
} else if (pngInfo?.prompt) {
|
||||
this.loadApiJson(JSON.parse(pngInfo.prompt), fileName)
|
||||
@@ -2744,7 +2743,8 @@ export class ComfyApp {
|
||||
true,
|
||||
fileName,
|
||||
undefined,
|
||||
URL.createObjectURL(file)
|
||||
URL.createObjectURL(file),
|
||||
pngInfo.output_node_id
|
||||
)
|
||||
} else if (prompt) {
|
||||
this.loadApiJson(JSON.parse(prompt), fileName)
|
||||
|
||||
Reference in New Issue
Block a user