Files
DumiFlex-ComfyUI-Wildcard-P…/docs/help/WP_PromptAssembler.md
T
DumiFlex df95e81ec6 feat(assembler): round-trip template identity + richer Save/Load modals
Load now persists the picked template's {id,name} on node.properties
(workflow-serialized, survives reload), so Save can offer to update the
exact row the user loaded — the template-side analogue of the bundle
push-to-library identity. Clearing the template drops the ref.

Rebuilds both modals on ModalShell with the library look adapted from
ModulePickerModal / PushToLibraryModal:
- LoadTemplateModal: search + category/tags/favorites filter popover +
  scrollable rows, single-click pick (no kind tabs / multi-select).
- SaveTemplateModal: name/description/category/tags + live preview, with
  a dual footer — "Update existing" (the loaded or same-name row) and
  "Save as new entry" (create, auto-suffixed). Saving rebinds the load
  identity so the next Save defaults to updating that entry.

Bumps the total bundle budget 380 -> 385 KB for the two heavier lazy
modal chunks (~3 KB net gzip; entry untouched).
2026-05-27 02:22:41 +03:00

2.0 KiB

WP Prompt Assembler

Fill-in-the-blank prompt template. Anywhere you write $variable, the assembler substitutes the matching value from the upstream Context.

Inputs

  • context — PIPELINE_CONTEXT from any WP node.
  • template — your prompt text. Use $varname to reference bound values.

Output

  • prompt — the resolved STRING. Feed into CLIP encoders, WP Prompt Cleaner, etc.

How to use

  1. Wire a WP Context (or chain) into the context input.
  2. Write your template:
    A $style portrait of $subject, $lighting
    
  3. Run the workflow. Each $var gets replaced with its current value.

Helper widget

Below the template, the Variables strip lists every value available from upstream — click any chip to insert $name at the cursor.

Preview color-codes the resolved prompt:

  • purple highlight = resolved value
  • amber wavy underline = missing variable (will render empty)

Save / Load template

Two toolbar buttons next to Clear template:

  • Load — opens a library picker with search plus category / tags / favorites filters. Click a template to load it; this replaces the current template (confirms first if you've already typed something). The assembler remembers which template you loaded.
  • Save — opens a save dialog (name, category, tags, description, live preview). When the name matches an existing template — or you loaded one — you get two actions: Update existing (overwrite that library entry) and Save as new entry (create a fresh copy, auto-suffixed). Otherwise it's a plain Save. After saving, the assembler tracks that entry so the next Save defaults to updating it.

Any $vars the loaded template needs that aren't in the upstream chain show as the usual amber "missing" markers. Manage saved templates in the SPA Templates tab.

Tips

  • Use $$ for a literal $ in your prompt.
  • Variable names: letters, numbers, underscores only.
  • Pre-flight warning toasts surface missing $vars at queue time.