InvokeAI/invokeai/app/invocations
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
..
custom_nodes feat(nodes): change expected structure for custom nodes 2023-10-20 14:28:16 +11:00
__init__.py chore: ruff check - fix flake8-comprensions 2023-11-11 10:55:23 +11:00
baseinvocation.py chore: ruff format 2023-11-11 10:55:40 +11:00
collections.py feat(api): chore: pydantic & fastapi upgrade 2023-10-17 14:59:25 +11:00
compel.py fix(backend): apply clip skip after lora 2023-11-14 11:30:15 +11:00
controlnet_image_processors.py fix(nodes): bump version of nodes post-pydantic v2 2023-11-16 11:14:26 +11:00
cv.py fix(nodes): bump version of nodes post-pydantic v2 2023-11-16 11:14:26 +11:00
facetools.py fix(nodes): bump version of nodes post-pydantic v2 2023-11-16 11:14:26 +11:00
image.py fix(nodes,ui): fix missed/canvas temp images in gallery 2023-11-17 07:32:04 +11:00
infill.py fix(nodes): bump version of nodes post-pydantic v2 2023-11-16 11:14:26 +11:00
ip_adapter.py fix(nodes): create app/shared/ module to prevent circular imports 2023-11-09 16:41:55 +11:00
latent.py fix(nodes): bump version of nodes post-pydantic v2 2023-11-16 11:14:26 +11:00
math.py chore: ruff check - fix pycodestyle 2023-11-11 10:55:33 +11:00
metadata.py fix(nodes): fix hrf_enabled metadata item 2023-11-16 18:47:31 +11:00
model.py fix(nodes): create app/shared/ module to prevent circular imports 2023-11-09 16:41:55 +11:00
noise.py fix(nodes): create app/shared/ module to prevent circular imports 2023-11-09 16:41:55 +11:00
onnx.py fix(nodes): bump version of nodes post-pydantic v2 2023-11-16 11:14:26 +11:00
param_easing.py chore: ruff check - fix flake8-comprensions 2023-11-11 10:55:23 +11:00
primitives.py fix(nodes): create app/shared/ module to prevent circular imports 2023-11-09 16:41:55 +11:00
prompt.py feat(api): chore: pydantic & fastapi upgrade 2023-10-17 14:59:25 +11:00
sdxl.py fix(nodes): create app/shared/ module to prevent circular imports 2023-11-09 16:41:55 +11:00
strings.py Prompts from file support nodes (#3964) 2023-09-13 08:06:38 +00:00
t2i_adapter.py fix(nodes): create app/shared/ module to prevent circular imports 2023-11-09 16:41:55 +11:00
upscale.py fix(nodes): bump version of nodes post-pydantic v2 2023-11-16 11:14:26 +11:00