Basic operation
Add a setting
id must be unique across all extensions and will be used to fetch values.
If you do not provide a category, then the id will be split by
. to determine where it appears in the settings panel.
- If your
iddoesn’t contain any.then it will appear in the “Other” category and youridwill be used as the section heading. - If your
idcontains at least one.then the leftmost part will be used as the setting category and the second part will be used as the section heading. Any further parts are ignored.
Read a setting
React to changes
TheonChange() event handler will be called as soon as the user changes the
setting in the settings panel.
This will also be called when the extension is registered, on every page load.
Write a setting
Extra configuration
Each setting type renders a ComfyUI frontend form component. You can pass extra props to that component in anattrs field. The props each type
supports are listed under Types.
For instance, this limits a number input to a range and step:
showButtons,
maxFractionDigits, editable or filter, see PrimeVue removal
migration. The settings panel no
longer uses PrimeVue components, so those props have no effect.
Types
Boolean
This shows an on/off toggle.Text
This is freeform text.Number
This for entering numbers. The input always shows increment and decrement buttons. Supportedattrs are
min, max, step and formatOptions. formatOptions takes
Intl.NumberFormatOptions,
so maximumFractionDigits controls how many decimal places are shown.
Slider
This lets the user enter a number directly or via a slider. Supportedattrs are min, max and step. Ranges are not supported.
Combo
This lets the user pick from a drop-down list of values. You can provide options either as a plain string or as an object withtext
and value fields. If you only provide a plain string, then it will be used
for both.
You can let the user search the list by supplying the searchable: true
attribute. Groups and freeform text entry are not supported.
Color
This lets the user select a color from a color picker or type in a hex reference. Note that the format requires six full hex digits (or eight, with alpha). Three digit shorthand does not work.Image
This lets the user upload an image. The setting will be saved as a data URL.Hidden
Hidden settings aren’t displayed in the settings panel, but you can read and write to them from your code.Other
Categories
You can specify the categorisation of your setting separately to theid.
This means you can change the categorisation and naming without changing the
id and losing the values that have already been set by users.
Tooltips
You can add extra contextual help with thetooltip field. This adds a small ℹ︎
icon after the field name that will show the help text when the user hovers
over it.