Settings
You can provide a settings object to ComfyUI that will show up when the user opens the ComfyUI settings panel.
Basic operation
Add a setting
The 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
id
doesn’t contain any.
then it will appear in the “Other” category and yourid
will be used as the section heading. - If your
id
contains 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
The onChange()
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
The setting types are based on PrimeVue components.
Props described in the PrimeVue documentation can be defined for ComfyUI
settings by adding them in an attrs
field.
For instance, this adds increment/decrement buttons to a number input:
Types
Boolean
This shows an on/off toggle.
Based on the ToggleSwitch PrimeVue component.
Text
This is freeform text.
Based on the InputText PrimeVue component.
Number
This for entering numbers.
To allow decimal places, set the maxFractionDigits
attribute to a number greater than zero.
Based on the InputNumber PrimeVue component.
Slider
This lets the user enter a number directly or via a slider.
Based on the Slider PrimeVue component. 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 with text
and value
fields. If you only provide a plain string, then it will be used
for both.
You can let the user enter freeform text by supplying the editable: true
attribute, or search by supplying the filter: true
attribute.
Based on the Select PrimeVue component. Groups 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 - three digit shorthand does not work.
Based on the ColorPicker PrimeVue component.
Image
This lets the user upload an image.
The setting will be saved as a data URL.
Based on the FileUpload PrimeVue component.
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 the id
.
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 the tooltip
field. This adds a small ℹ︎
icon after the field name that will show the help text when the user hovers
over it.
Was this page helpful?