Skip to content

Conversation

@phazei
Copy link

@phazei phazei commented Jul 5, 2025

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)

#Return this file with audio to the webui.
#It will be muted unless opened or saved with right click
file = output_file_with_audio
preview['filename'] = output_file_with_audio
Copy link
Author

@phazei phazei Jul 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this isn't entirely complete because if there is audio, the metadata will still only point to the intermediate video file, but that's kept by default anyway, and this is still better than it was and covers most cases.

To be complete, the audio a_waveform check could be done much earlier, while keeping the processing where it is.

@phazei
Copy link
Author

phazei commented Jul 30, 2025

@AustinMroz mind giving this a review? Would love getting this merged in

@phazei phazei force-pushed the file-file-metadata-paths branch from 31e9eaf to 3b446ae Compare July 30, 2025 00:10
@phazei phazei force-pushed the file-file-metadata-paths branch from 3b446ae to 74e2488 Compare September 10, 2025 04:39
@phazei phazei force-pushed the file-file-metadata-paths branch from 74e2488 to 14a871f Compare November 7, 2025 21:30
@phazei phazei force-pushed the file-file-metadata-paths branch from 14a871f to 48b2d8e Compare December 4, 2025 21:49
@phazei phazei force-pushed the file-file-metadata-paths branch from 48b2d8e to 33d9896 Compare January 3, 2026 21:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant