@@ -7,7 +7,10 @@ import {
77 imageSelected ,
88} from 'features/gallery/store/gallerySlice' ;
99import { IMAGE_CATEGORIES } from 'features/gallery/store/types' ;
10- import { CANVAS_OUTPUT } from 'features/nodes/util/graphBuilders/constants' ;
10+ import {
11+ LINEAR_UI_OUTPUT ,
12+ nodeIDDenyList ,
13+ } from 'features/nodes/util/graphBuilders/constants' ;
1114import { boardsApi } from 'services/api/endpoints/boards' ;
1215import { imagesApi } from 'services/api/endpoints/images' ;
1316import { isImageOutput } from 'services/api/guards' ;
@@ -19,7 +22,7 @@ import {
1922import { startAppListening } from '../..' ;
2023
2124// These nodes output an image, but do not actually *save* an image, so we don't want to handle the gallery logic on them
22- const nodeDenylist = [ 'load_image' , 'image' ] ;
25+ const nodeTypeDenylist = [ 'load_image' , 'image' ] ;
2326
2427export const addInvocationCompleteEventListener = ( ) => {
2528 startAppListening ( {
@@ -32,22 +35,31 @@ export const addInvocationCompleteEventListener = () => {
3235 `Invocation complete (${ action . payload . data . node . type } )`
3336 ) ;
3437
35- const { result, node, queue_batch_id } = data ;
38+ const { result, node, queue_batch_id, source_node_id } = data ;
3639
3740 // This complete event has an associated image output
38- if ( isImageOutput ( result ) && ! nodeDenylist . includes ( node . type ) ) {
41+ if (
42+ isImageOutput ( result ) &&
43+ ! nodeTypeDenylist . includes ( node . type ) &&
44+ ! nodeIDDenyList . includes ( source_node_id )
45+ ) {
3946 const { image_name } = result . image ;
4047 const { canvas, gallery } = getState ( ) ;
4148
4249 // This populates the `getImageDTO` cache
43- const imageDTO = await dispatch (
44- imagesApi . endpoints . getImageDTO . initiate ( image_name )
45- ) . unwrap ( ) ;
50+ const imageDTORequest = dispatch (
51+ imagesApi . endpoints . getImageDTO . initiate ( image_name , {
52+ forceRefetch : true ,
53+ } )
54+ ) ;
55+
56+ const imageDTO = await imageDTORequest . unwrap ( ) ;
57+ imageDTORequest . unsubscribe ( ) ;
4658
4759 // Add canvas images to the staging area
4860 if (
4961 canvas . batchIds . includes ( queue_batch_id ) &&
50- [ CANVAS_OUTPUT ] . includes ( data . source_node_id )
62+ [ LINEAR_UI_OUTPUT ] . includes ( data . source_node_id )
5163 ) {
5264 dispatch ( addImageToStagingArea ( imageDTO ) ) ;
5365 }
0 commit comments