Skip to content

custom metadata nodes#9216

Open
parsee-mizuhashi wants to merge 3 commits intoComfy-Org:masterfrom
parsee-mizuhashi:master
Open

custom metadata nodes#9216
parsee-mizuhashi wants to merge 3 commits intoComfy-Org:masterfrom
parsee-mizuhashi:master

Conversation

@parsee-mizuhashi
Copy link

(continuation of #8737 since i dont know how to git, my bad)

explanation of what the nodes do:
GetWorkflowMetadata: gets the pnginfo metadata (e.g. the one saved by default in SaveImage
EmptyMetadata: makes a new empty metadata to add upon
AddMetadataValue: adds a new value to the metadata
SaveImageCustomMetadata: saves image with custom metadata

this time its defined with v3 spec, ty comfy for showing me how to do do pnginfo in v3 spec
(note: should prob replace custom type with another type? feels too niche to require a whole new type so left it just as a custom type, also might help people making v3 nodes in the future)

@Kosinkadink
Copy link
Member

Since the metadata is a special type that would be supported by core, assuming it will be accepted, the type should be defined within _io.py of latest API (comfy_api/latest/_io.py). Nice to see nodes written in v3 schema lol.

@asagi4
Copy link
Contributor

asagi4 commented Aug 7, 2025

Is the PngInfo object sufficient to contain metadata for all filetypes that could contain metadata? Maybe it could use a custom container type instead so you could extend the system to more than just images, like safetensors files or videos, without having to have separate types for all of them.

@parsee-mizuhashi
Copy link
Author

Since the metadata is a special type that would be supported by core, assuming it will be accepted, the type should be defined within _io.py of latest API (comfy_api/latest/_io.py). Nice to see nodes written in v3 schema lol.

will add the custom type into the _io.py file then

Is the PngInfo object sufficient to contain metadata for all filetypes that could contain metadata? Maybe it could use a custom container type instead so you could extend the system to more than just images, like safetensors files or videos, without having to have separate types for all of them.

i mostly intended this as just a way to give images custom metadata, but will try and add webm / checkpoint metadata

@comfy-pr-bot
Copy link
Member

Test Evidence Check

⚠️ Warning: Test Explanation Missing

If this PR modifies behavior that requires testing, a test explanation is required. PRs lacking applicable test explanations may not be reviewed until added. Please add test explanations to ensure code quality and prevent regressions.

⚠️ Warning: Visual Documentation Missing

If this PR changes user-facing behavior, visual proof (screen recording or screenshot) is required. PRs without applicable visual documentation may not be reviewed until provided.

You can add it by:

  • GitHub: Drag & drop media directly into the PR description
  • YouTube: Include a link to a short demo

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.

4 participants