Fix proper generated file paths in metadata #503
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This would resolve this issue:
#462
In the comments of that ticket I put a code stub. While it kind of works, that only updates the metadata for any items with metadata saved outside and after this node runs. The issue turned out to be a little more complicated because the metadata was being written before the filename and path were being calculated. So that needed a little adjusting.
This solves the issue, so now, if I drag the mp4 or png that are generated back into Comfy, it will load the video it generated instead of the previous one generated.
There is one bug in ComfyUI that will make one think this PR doesn't work that I discovered while debugging it. When loading a generation from the Queue panel, it doesn't actually load the workflow from what's written to the file, but from a stale copy that hasn't been updated with any dynamically updated data from execution. (Comfy-Org/ComfyUI#8799)