InvokeAI/invokeai/app/services
psychedelicious d20f98fb4f fix(nodes): deep copy graph inputs
The change to memory session storage brings a subtle behaviour change.

Previously, we serialized and deserialized everything (e.g. field state, invocation outputs, etc) constantly. The meant we were effectively working with deep-copied objects at all time. We could mutate objects freely without worrying about other references to the object.

With memory storage, objects are now passed around by reference, and we cannot handle them in the same way.

This is problematic for nodes that mutate their own inputs. There are two ways this causes a problem:

- An output is used as input for multiple nodes. If the first node mutates the output object while `invoke`ing, the next node will get the mutated object.
- The invocation cache stores live python objects. When a node mutates an output pulled from the cache, the next node that uses the cached object will get the mutated object.

The solution is to deep-copy a node's inputs as they are set, effectively reproducing the same behaviour as we had with the SQLite session storage. Nodes can safely mutate their inputs and those changes never leave the node's scope.

Closes  #5665
2024-02-09 21:17:32 +11:00
..
board_image_records feat(db): add SQLiteMigrator to perform db migrations 2023-12-11 16:14:25 +11:00
board_images feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
board_records feat(db): add SQLiteMigrator to perform db migrations 2023-12-11 16:14:25 +11:00
boards feat(api): chore: pydantic & fastapi upgrade 2023-10-17 14:59:25 +11:00
config pref: annotate 2024-02-03 10:18:26 +11:00
download Port the command-line tools to use model_manager2 (#5546) 2024-02-02 17:18:47 +00:00
events Model Manager Refactor: Install remote models and store their tags and other metadata (#5361) 2024-01-14 19:54:53 +00:00
image_files feat: workflow library (#5148) 2023-12-09 09:48:38 +11:00
image_records feat(db): add SQLiteMigrator to perform db migrations 2023-12-11 16:14:25 +11:00
images feat: workflow library (#5148) 2023-12-09 09:48:38 +11:00
invocation_cache feat(api): chore: pydantic & fastapi upgrade 2023-10-17 14:59:25 +11:00
invocation_processor feat(nodes): move profiler/stats cleanup logic to function 2024-02-07 11:26:15 +11:00
invocation_queue feat: workflow library (#5148) 2023-12-09 09:48:38 +11:00
invocation_stats feat(nodes): do not log stats errors 2024-02-07 11:26:15 +11:00
item_storage chore(item-storage): improve types 2024-02-03 07:34:06 -05:00
latents_storage feat(backend): move logic to clear latents to method 2023-12-01 17:44:07 -08:00
model_install Port the command-line tools to use model_manager2 (#5546) 2024-02-02 17:18:47 +00:00
model_manager chore: flake8 2023-10-30 01:49:10 +11:00
model_records Model Manager Refactor: Install remote models and store their tags and other metadata (#5361) 2024-01-14 19:54:53 +00:00
names feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
session_processor feat: workflow library (#5148) 2023-12-09 09:48:38 +11:00
session_queue feat(db): add SQLiteMigrator to perform db migrations 2023-12-11 16:14:25 +11:00
shared fix(nodes): deep copy graph inputs 2024-02-09 21:17:32 +11:00
urls feat: refactor services folder/module structure 2023-10-12 12:15:06 -04:00
workflow_records add project as category to back-end 2024-01-24 10:59:04 +11:00
__init__.py all files migrated; tweaks needed 2023-03-03 00:02:15 -05:00
invocation_services.py [feature] Download Queue (#5225) 2023-12-22 12:35:57 -05:00
invoker.py feat: workflow library (#5148) 2023-12-09 09:48:38 +11:00