Nodes/DiffusionGemma Prompt Builder/DiffusionGemma H3 Reference Policy
ComfyUI Node

DiffusionGemma H3 Reference Policy

Stop hand-typing Ref2VA manifests — pick a layout from a dropdown

By exportAnything·Created 2 months ago·Updated a day ago· 44
DiffusionGemma H3 Reference Policy
    • reference_policy_config
    • policy_json
    • policy_preview
    layoutAuto (recommended)
    expected_subject_count0
    custom_manifest

    Writing a MiniMax H3 Ref2VA reference manifest by hand means getting the <Picture 1> / <Video 1> / <Audio 1> roles, their one-based ordering, and their [dg:...] annotations exactly right - every time. It's mechanical, error-prone, and exactly the kind of thing a dropdown should own. DiffusionGemma H3 Reference Policy is that dropdown: a thin configuration node that turns a named layout into a DG_H3_REFERENCE_POLICY_CONFIG bundle describing how your visual references map to native H3 asset roles.

    It's a small node with a small job, and that's fine - the pack puts the real complexity in the H3 Reference Context node that turns your manifest into a DG_CONTEXT. This node sits in the family as the preset picker for the reference contract, and it pairs naturally with the context node when you'd rather choose "2 images - main subject + same-subject contact sheet" than retype the role rows.

    The inputs

    • layout - seven choices, defaulting to Auto (recommended), which derives a safe manifest from the ordered visual references carried by your DG_CONTEXT:
      • One picture - all visual attributes
      • Primary subject + environment/style
      • Primary subject + same-subject contact sheet
      • Primary subject + supporting subjects/objects contact sheet
      • Ordered independent subjects/objects
      • Custom manifest
    • expected_subject_count - 0 is Auto. For a primary subject plus K selected secondary contact-sheet entities, enter 1 + K; repeated views of one entity still count once. The tooltip's phrasing is worth keeping in mind: this counts semantic subjects, not pictures.
    • custom_manifest - the free-text role box, used only when layout is Custom manifest. Write one exact <Picture N>, <Video N>, or <Audio N> role per line; the named dropdown layouts ignore this box.

    Outputs are reference_policy_config, policy_json, and policy_preview - the preview being the thing you actually read to confirm the generated manifest says what you think it says before it costs a Director run.

    The two details that trip people up

    Contact-sheet layouts treat the entire sheet as one Picture. That's the anti-drift design: if a contact sheet of a subject were treated as a grid of separate images, H3 could start treating its grid lines and labels as scene content. The preset prevents that by keeping the whole sheet one role. Choose the contact-sheet layouts when your source genuinely is a sheet; choose the plain layouts for single images.

    Named layouts override the text box. If you've typed a manifest into custom_manifest but left layout on a named preset, the named preset wins at execution. Keep layout on Custom manifest whenever you're hand-authoring, or your carefully ordered roles silently never run.

    Installing it

    Part of the exportAnything/ComfyUI-DiffusionGemmaPromptBuilder pack, under prompt/diffusiongemma/optional:

    cd ComfyUI/custom_nodes
    git clone https://github.com/exportAnything/ComfyUI-DiffusionGemmaPromptBuilder
    

    or search DiffusionGemma Prompt Builder in ComfyUI Manager and restart. It's pure string/config generation - no model, no VRAM. The only heavy dependency anywhere in this graph is the DiffusionGemma model folder (ComfyUI/models/LLM/diffusiongemma-26B-A4B-it-NVFP4) that runs upstream when the Director compiles the actual prompt.

    When to reach for it

    If you're running one or two well-worn Ref2VA setups, this node turns "keep the manifest in my head" into a choice you can see and hand to a colleague. If you're doing novel multi-reference layouts every session, you'll probably still want the raw editable manifest on the H3 Reference Context - but even then, using this node to generate a policy and previewing it is a decent way to sanity-check your mental model of the asset order before you pay for a 110-second prompt run.

    Categoryprompt/diffusiongemma/optional

    Inputs (3)

    NameTypeDefaultDescription
    layoutCOMBOAuto (recommended)Auto derives a safe manifest from the ordered visual references carried by DG_CONTEXT. Contact-sheet choices treat the entire sheet as one Picture and prevent its grid or labels from becoming scene content.
    expected_subject_countINT00–990 is Auto. For a primary subject plus K selected secondary contact-sheet entities, enter 1 + K. Repeated views of one entity still count once.
    custom_manifestSTRINGUsed only by Custom manifest. Write one exact <Picture N>, <Video N>, or <Audio N> role per line. Named dropdown layouts ignore this box.

    Outputs (3)

    NameTypeDescription
    reference_policy_configDG_H3_REFERENCE_POLICY_CONFIG
    policy_jsonSTRING
    policy_previewSTRING