Nodes/ComfyUI-aihub-workflow-exposer/AIHub Utils Metadata Map
ComfyUI Node

AIHub Utils Metadata Map

Turn per-image batch metadata into one string — the exact thing LTXV's sampler wants

By otavanopisto·Created about a year ago·Updated 22 days ago· 7
AIHub Utils Metadata Map
  • metadata
  • STRING
fieldmy_field
separator,
true_valuet
false_valuef

The AIHubExposeImageBatch node in the otavanopisto ComfyUI-aihub-workflow-exposer pack doesn't just hand you a batch of images - it hands you a pile of metadata about them (frame numbers, per-image prompts, whatever the client chose to append). But metadata sitting in a JSON list is useless to most nodes, which want a plain string. AIHubUtilsMetadataMap is the bridge: it takes that metadata list, pulls one field out of every entry, and joins them into a single string with your separator of choice.

The README gives the killer example: the LTXV video sampler needs the frame indexes as a comma-separated string. The metadata has one frame value per image; this node turns that into "0,48,97" - ready to paste into the sampler's input. That's the whole design: one field, many values, one string.

The inputs that matter

  • metadata - the metadata output from the image batch expose (type AIHUB_METADATA). This is the only input that isn't a plain text field.
  • field - which key to pull out of each metadata entry (default my_field). Set it to whatever the client appends - frame, index, prompt, whatever.
  • separator - what goes between values (default ,). For the LTXV frame example you want a comma; for building a list of prompts you might want a newline.
  • true_value / false_value - how to render booleans (defaults t / f). If your metadata has a is_keyframe: true flag and you want "1,0,1", set these accordingly.

Output: a single STRING with the joined values.

How it behaves

The source walks the metadata list in order, grabs field from each entry that has it, stringifies numbers, maps booleans to your true_value/false_value, and joins with the separator. Missing field on some entries - they're just skipped. Empty or non-list metadata returns an empty string. The order matters: it's the batch order, which is exactly what a frame-index consumer needs, but if the client can send entries out of order, verify upstream.

When you'd use it

Any place a downstream node wants a packed string of per-image values. The LTXV frame-index case is the flagship; others include building a comma-separated list of strengths, frame numbers for video interpolation, or concatenating per-frame prompts into a delimited block. The README adds an important boundary though: "if more complex behaviour is required, like that on creating loras from image batches, it is expected that a custom node is to be written to handle it." This node maps one field to one string; anything cleverer is on you.

Gotchas

If you change the metadata field name in the batch expose after wiring this node, the field silently matches nothing and you get an empty string - there's no error, so an empty output usually means a field-name mismatch, not "no metadata." And remember the separator is literal: for the LTXV use case, no spaces.

Install

No requirements - pack standard:

cd ComfyUI/custom_nodes
git clone https://github.com/otavanopisto/ComfyUI-aihub-workflow-exposer

Restart ComfyUI. Small node, very specific job, and when you're building video workflows from image batches it's the piece that makes the metadata you already have usable.

Categoryaihub/utils

Inputs (5)

NameTypeDefaultDescription
metadataAIHUB_METADATAThe metadata string from the image batch expose node
fieldSTRINGmy_fieldThe field to concatenate from the metadata
separatorSTRING,The separator to use between multiple values
true_valueSTRINGtThe value to use for true boolean values
false_valueSTRINGfThe value to use for false boolean values

Outputs (1)

NameTypeDescription
STRINGSTRING