invoke-ai / invoke-ai/InvokeAI

[enhancement]: Metadata node rework - Streamline and avoids iterate andcollect node issues

Open
#5,107 3 comments 0 reactions 0 assignees View on GitHub
enhancement nodes / workflows
Dominant language
Python
Stars
28.2k
Forks
3k
Avg merge
6d 5h
Merged PRs (30d)
19

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Contact Details

skunkworxdark

### What should this feature add?

As already discussed with @psychedelicious on discord. Update the Metadata collection nodes to make it more streamlined and avoid use of the `collect` node, which currently causes issues if it used while also using an `iterate` node as it collects everything over all iterations not just the current one.

Alter the `Metadata Item` by adding an optional MetadataDict as an input. It would add/update the MetadataDict with the passed in label & value, If no MetadataDict is passed in it just creates a new one and passes it out. The `Metadata Item` nodes can be chained together one `Metadata Item` to another inside an iterate node.

Additionally a `Metadata Join` node would replace the current `Merge Metadata` node. This takes two MetadataDicts and combines them with the second one replacing any duplicates in the first. This would avoid using the `collect` node again that the existing `Merge Metadata` needs.

This approach also removes the need for the final Metadata Invocation as the data is always in a MetadataDict. At each stage you would need to check if the label already exists and update it if it did but that should be minor and the same in the Join node with a simple rule that the second Dict would override the first if you have duplicate labels.

Finally I think an additional `Metadata Core Item` node could be created that is a copy of the `Metadata Item` node but it has a fixed list of labels that match or is a subset (the fields that make sense) of the fields presented by the `Core Metadata` node. This would allow easy adding or core metadata fields without the user having to remember or type the exact names of the metadata labels and avoid using the overly large `Core Metadata` node (which currently doesn't work in the node editor anyway).

### Alternatives

_No response_

### Additional Content

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.