ComfyUI Node

Metadata Force Include

When the scanner keeps skipping a node, force it

By xxmjskxx·Created about a year ago·Updated about a month ago· 25
Metadata Force Include
    • forced_classes
    • forced_classes_str
    force_include_node_class
    reset_forcedfalse
    dry_runfalse

    The Metadata Rule Scanner has a keyword blacklist so aggressive that it can filter out nodes you actually care about. Your favorite LoRA loader's class name contains "scale", your sampler's class name trips a filter, and suddenly the scanner quietly never suggests rules for it - and the save node, lacking rules, doesn't capture it. Metadata Force Include is the answer to exactly this: a node that maintains a global list of node class names that are always treated as required when loading your metadata definitions, regardless of what the scanner's filters or modes say.

    Where the scanner's force_include_node_class input handles forcing on a per-scan basis, this node makes it global - the forced set persists and applies to every scan and every rule merge. It's the set-and-forget version of the same idea.

    The inputs

    • force_include_node_class - a multiline string of node class names, comma or newline separated. These get added to the global forced set. Find the exact class name from the node's type in ComfyUI, or by exporting the workflow JSON and copying the class_type.
    • reset_forced - a boolean. True clears the previously forced classes before applying the new list. Useful when you want to start over instead of accumulating.
    • dry_run - a boolean. When True, nothing is modified; the node just echoes the current forced list. Use it to check your state without touching it.

    The outputs

    • forced_classes - a FORCED_CLASSES type: a semantic marker with the current forced list. It's mainly for tooling.
    • forced_classes_str - a plain comma-separated STRING of the forced classes. This is the one you wire around, e.g. into Show Text (UniMeta) to audit what's actually forced, or into the scanner as a manual cross-check.

    Why you'd bother

    The failure mode this fixes is real and common. You scan, the diff report says nothing new, but you know a node's values aren't landing in metadata. Nine times out of ten the class name tripped the exclude filter. Instead of fighting the filter - which exists to keep the scanner output readable - you force the class name and move on. When the scanner outputs a forced node as {}, that's expected: the empty object is an anchor guaranteeing the class is present so you can hand-write its rules via the save-rules flow.

    A quick workflow to sanity-check your configuration:

    1. Add your node class names to force_include_node_class, leave dry_run off.
    2. Wire forced_classes_strShow Text (UniMeta) to see the list.
    3. Re-run the scanner - your classes now appear even if the filters would have dropped them.

    One caveat: forcing a class guarantees it's considered when loading rules - it doesn't invent heuristics for a node the scanner can't map. For those, you still pair this with the scanner's force_include_metafields to bias suggestions toward the fields you actually want captured. Think of this node as the bouncer: it gets your node in the door, and the scanner's outputs decide what happens once it's inside.

    CategorySaveImageWithMetaDataUniversal

    Inputs (3)

    NameTypeDefaultDescription
    force_include_node_classSTRINGComma/newline separated node class names to always treat as required for loading user metadata definitions.
    reset_forcedBOOLEANfalseIf true, clear previously forced classes before applying new list.
    dry_runoptBOOLEANfalseIf true, do not modify global set; just echo the current list.

    Outputs (2)

    NameTypeDescription
    forced_classesFORCED_CLASSES
    forced_classes_strSTRING