Skip to content

Commit add2f9b

Browse files
authored
Group comfy core settings (#508)
* Add category overwrite * Group settings
1 parent ec5f115 commit add2f9b

File tree

12 files changed

+47
-10
lines changed

12 files changed

+47
-10
lines changed

src/extensions/core/colorPalette.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,7 @@ app.registerExtension({
714714

715715
app.ui.settings.addSetting({
716716
id,
717+
category: ['Comfy', 'ColorPalette'],
717718
name: 'Color Palette',
718719
type: (name, setter, value) => {
719720
const options = [

src/extensions/core/invertMenuScrolling.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ app.registerExtension({
2323
}
2424
app.ui.settings.addSetting({
2525
id,
26-
name: 'Invert Menu Scrolling',
26+
category: ['Comfy', 'Graph', 'InvertMenuScrolling'],
27+
name: 'Invert Context Menu Scrolling',
2728
type: 'boolean',
2829
defaultValue: false,
2930
onChange(value) {

src/extensions/core/linkRenderMode.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const ext = {
66
async setup(app) {
77
app.ui.settings.addSetting({
88
id,
9+
category: ['Comfy', 'Graph', 'LinkRenderMode'],
910
name: 'Link Render Mode',
1011
defaultValue: 2,
1112
type: 'combo',

src/extensions/core/slotDefaults.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ app.registerExtension({
1111
LiteGraph.middle_click_slot_add_default_node = true
1212
this.suggestionsNumber = app.ui.settings.addSetting({
1313
id: 'Comfy.NodeSuggestions.number',
14+
category: ['Comfy', 'Node Search Box', 'NodeSuggestions'],
1415
name: 'Number of nodes suggestions',
16+
tooltip: 'Only for litegraph searchbox/context menu',
1517
type: 'slider',
1618
attrs: {
1719
min: 1,

src/extensions/core/snapToGrid.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ app.registerExtension({
2323
// Add setting to control grid size
2424
app.ui.settings.addSetting({
2525
id: 'Comfy.SnapToGrid.GridSize',
26-
name: 'Grid Size',
26+
category: ['Comfy', 'Graph', 'GridSize'],
27+
name: 'Snap to gird size',
2728
type: 'slider',
2829
attrs: {
2930
min: 1,

src/scripts/app.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,7 @@ export class ComfyApp {
418418
}
419419
this.enableWorkflowViewRestore = this.ui.settings.addSetting({
420420
id: 'Comfy.EnableWorkflowViewRestore',
421+
category: ['Comfy', 'Workflow', 'EnableWorkflowViewRestore'],
421422
name: 'Save and restore canvas position and zoom level in workflows',
422423
type: 'boolean',
423424
defaultValue: true

src/scripts/domWidget.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ let enableDomClipping = true
245245
export function addDomClippingSetting(): void {
246246
app.ui.settings.addSetting({
247247
id: 'Comfy.DOMClippingEnabled',
248+
category: ['Comfy', 'Node', 'DOMClippingEnabled'],
248249
name: 'Enable DOM element clipping (enabling may reduce performance)',
249250
type: 'boolean',
250251
defaultValue: enableDomClipping,

src/scripts/ui.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ function dragElement(dragEl, settings): () => void {
167167
let savePos = undefined
168168
settings.addSetting({
169169
id: 'Comfy.MenuPosition',
170-
name: 'Save menu position',
170+
category: ['Comfy', 'Menu', 'MenuPosition'],
171+
name: "Save legacy menu's position",
171172
type: 'boolean',
172173
defaultValue: savePos,
173174
onChange(value) {
@@ -369,13 +370,15 @@ export class ComfyUI {
369370

370371
const confirmClear = this.settings.addSetting({
371372
id: 'Comfy.ConfirmClear',
373+
category: ['Comfy', 'Workflow', 'ConfirmClear'],
372374
name: 'Require confirmation when clearing workflow',
373375
type: 'boolean',
374376
defaultValue: true
375377
})
376378

377379
const promptFilename = this.settings.addSetting({
378380
id: 'Comfy.PromptFilename',
381+
category: ['Comfy', 'Workflow', 'PromptFilename'],
379382
name: 'Prompt for filename when saving workflow',
380383
type: 'boolean',
381384
defaultValue: true
@@ -394,28 +397,37 @@ export class ComfyUI {
394397
*/
395398
const previewImage = this.settings.addSetting({
396399
id: 'Comfy.PreviewFormat',
397-
name: 'When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc.',
400+
category: ['Comfy', 'Node Widget', 'PreviewFormat'],
401+
name: 'Preview image format',
402+
tooltip:
403+
'When displaying a preview in the image widget, convert it to a lightweight image, e.g. webp, jpeg, webp;50, etc.',
398404
type: 'text',
399405
defaultValue: ''
400406
})
401407

402408
this.settings.addSetting({
403409
id: 'Comfy.DisableSliders',
410+
category: ['Comfy', 'Node Widget', 'DisableSliders'],
404411
name: 'Disable node widget sliders',
405412
type: 'boolean',
406413
defaultValue: false
407414
})
408415

409416
this.settings.addSetting({
410417
id: 'Comfy.DisableFloatRounding',
411-
name: 'Disable rounding floats (requires page reload).',
418+
category: ['Comfy', 'Node Widget', 'DisableFloatRounding'],
419+
name: 'Disable default float widget rounding.',
420+
tooltip:
421+
'(requires page reload) Cannot disable round when round is set by the node in the backend.',
412422
type: 'boolean',
413423
defaultValue: false
414424
})
415425

416426
this.settings.addSetting({
417427
id: 'Comfy.FloatRoundingPrecision',
418-
name: 'Decimal places [0 = auto] (requires page reload).',
428+
category: ['Comfy', 'Node Widget', 'FloatRoundingPrecision'],
429+
name: 'Float widget rounding decimal places [0 = auto].',
430+
tooltip: '(requires page reload)',
419431
type: 'slider',
420432
attrs: {
421433
min: 0,
@@ -427,6 +439,7 @@ export class ComfyUI {
427439

428440
this.settings.addSetting({
429441
id: 'Comfy.EnableTooltips',
442+
category: ['Comfy', 'Node', 'EnableTooltips'],
430443
name: 'Enable Tooltips',
431444
type: 'boolean',
432445
defaultValue: true

src/scripts/ui/menu/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,10 @@ export class ComfyAppMenu {
158158
let resizeHandler: () => void
159159
this.menuPositionSetting = app.ui.settings.addSetting({
160160
id: 'Comfy.UseNewMenu',
161+
category: ['Comfy', 'Menu', 'UseNewMenu'],
161162
defaultValue: 'Disabled',
162-
name: '[Beta] Use new menu and workflow management. Note: On small screens the menu will always be at the top.',
163+
name: '[Beta] Use new menu and workflow management.',
164+
tooltip: 'On small screens the menu will always be at the top.',
163165
type: 'combo',
164166
options: ['Disabled', 'Top', 'Bottom'],
165167
onChange: async (v: MenuPosition) => {

src/scripts/widgets.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,10 @@ function isSlider(display, app) {
347347
export function initWidgets(app) {
348348
app.ui.settings.addSetting({
349349
id: 'Comfy.WidgetControlMode',
350-
name: 'Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.',
350+
category: ['Comfy', 'Node Widget', 'WidgetControlMode'],
351+
name: 'Widget control mode',
352+
tooltip:
353+
'Controls when widget values are updated (randomize/increment/decrement), either before the prompt is queued or after.',
351354
type: 'combo',
352355
defaultValue: 'after',
353356
options: ['before', 'after'],

0 commit comments

Comments
 (0)