PotionUI Docs v0.3.0

Contributing modes to an existing preset

An enabled plugin can add one or more generation MODES to a preset it doesn't own — e.g. an img2img mode for a preset that only shipped txt2img — without forking or editing that preset. This is distinct from presets: (a plugin shipping a whole new preset of its own; see Presets). Declare it in manifest.yml:

yaml
preset_modes:
  - target: "01KX46YCC5RB5EGYY38SBMVKR5"   # the target preset's id
    modes_root: "contributed"              # a dir in the plugin, relative to the plugin root

modes_root is laid out like a preset root minus preset.yml: a modes/<name>/ subtree, each with the same pipeline.yml/form.yml(/variants) shape a core mode has. Every mode dir found there is contributed to target — there's no separate per-mode enable list. A contributed mode is schema-validated through the exact same loader path a core mode is; a target that isn't installed, or a disabled owning plugin, means the contribution is simply absent, not an error.

A contributed mode declares its own prompting in its default form.yml, since it cannot edit the target's vars: and llm:: prompt: required | optional | none (adds the mode to the target's optional_prompt_modes or promptless_modes), prompt_label: / prompt_placeholder: (what the prompt box is for, and an example), llm_guide: (the mode's llm.modes.<name>.guide) and segment_templates: (the mode's vars.prompt.modes.<name>.segment_templates). They are merged into the target preset when the contribution is accepted; see Plugin-Contributed Presets.

Name collisions are resolved deterministically, never silently: a core mode of the target preset always wins over a contribution; between two contributions for the same target+mode name, the first one (contributions sorted by plugin id, then declaration order) wins and the rest are rejected with a load error attributed to the plugin. A contributed mode inherits the target's speed_profiles: and admin configuration: (its fields' @config:<key> filter_tags resolve against the target, same as a core mode's) — there is no separate per-contribution mechanism for either. See Plugin-Contributed Presets for the full contract, including how provenance (source_plugin) surfaces in GET /api/presets/{id}/modes and the mode picker.