New settings API (#1292)

* Add settings API

* Add playwright test

* Update README
This commit is contained in:
Chenlei Hu
2024-10-24 16:26:01 +02:00
committed by GitHub
parent 3553c8e0d4
commit 957a767ed0
9 changed files with 109 additions and 4 deletions

View File

@@ -169,6 +169,23 @@ export class ComfySettingsDialog extends ComfyDialog<HTMLDialogElement> {
this.#dispatchChange(id, value)
}
/**
* Deprecated for external callers/extensions. Use `ComfyExtension.settings` field instead.
* Example:
* ```ts
* app.registerExtension({
* name: 'My Extension',
* settings: [
* {
* id: 'My.Setting',
* name: 'My Setting',
* type: 'text',
* defaultValue: 'Hello, world!'
* }
* ]
* })
* ```
*/
addSetting(params: SettingParams) {
const {
id,