InvokeAI/invokeai/app
psychedelicious 91ef24e15c fix(nodes,ui): fix missed/canvas temp images in gallery
Resolves two bugs introduced in #5106:

1. Linear UI images sometimes didn't make it to the gallery.

This was a race condition. The VAE decode nodes were handled by the socketInvocationComplete listener. At that moment, the image was marked as intermediate. Immediately after this node was handled, a LinearUIOutputInvocation, introduced in #5106, was handled by socketInvocationComplete. This node internally sets changed the image to not intermediate.

During the handling of that socketInvocationComplete, RTK Query would sometimes use its cache instead of retrieving the image DTO again. The result is that the UI never got the message that the image was not intermediate, so it wasn't added to the gallery.

This is resolved by refactoring the socketInvocationComplete listener. We now skip the gallery processing for linear UI events, except for the LinearUIOutputInvocation. Images now always make it to the gallery, and network requests to get image DTOs are substantially reduced.

2. Canvas temp images always went into the gallery

The LinearUIOutputInvocation was always setting its image's is_intermediate to false. This included all canvas images and resulted in all canvas temp images going to gallery.

This is resolved by making LinearUIOutputInvocation set is_intermediate based on `self.is_intermediate`. The behaviour now more or less mirroring the behaviour of is_intermediate on other image-outputting nodes, except it doesn't save the image again - only changes it.

One extra minor change - LinearUIOutputInvocation only changes is_intermediate if it differs from the image's current setting. Very minor optimisation.
2023-11-17 07:32:04 +11:00
..
api fixed ruff formatting issues 2023-11-13 18:15:17 -05:00
assets/images tweaks in response to psychedelicious review of PR 2023-07-26 15:27:04 +10:00
invocations fix(nodes,ui): fix missed/canvas temp images in gallery 2023-11-17 07:32:04 +11:00
services resolve conflicts; blackify 2023-11-13 18:12:45 -05:00
shared fix(nodes): create app/shared/ module to prevent circular imports 2023-11-09 16:41:55 +11:00
util chore: ruff check - fix pycodestyle 2023-11-11 10:55:33 +11:00
api_app.py Merge branch 'main' into refactor/model-manager-2 2023-11-14 07:51:57 +11:00