Skip to content

Commit

Permalink
Adds support for Knob display option in IntWidget
Browse files Browse the repository at this point in the history
  • Loading branch information
Immac committed Feb 25, 2025
1 parent 79be18a commit faa8923
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/composables/widgets/useIntWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ export const useIntWidget = () => {
) => {
const settingStore = useSettingStore()
const sliderEnabled = !settingStore.get('Comfy.DisableSliders')
const knobEnabled = !settingStore.get('Comfy.DisableKnobs')
const inputOptions = inputData[1]
const widgetType = sliderEnabled
? inputOptions?.display === 'slider'
? 'slider'
: 'number'
: 'number'
const widgetType = (() => {
switch (inputOptions?.display) {
case 'slider':
return sliderEnabled ? 'slider' : 'number'
case 'knob':
return knobEnabled ? 'knob' : 'number'
default:
return 'number'
}
})()

const { val, config } = getNumberDefaults(inputOptions, {
defaultStep: 1,
Expand Down

0 comments on commit faa8923

Please sign in to comment.