Make max batch count configurable (#1060)

This commit is contained in:
Chenlei Hu
2024-10-01 15:42:12 -04:00
committed by GitHub
parent 98a0291bbd
commit 0194d76722
4 changed files with 22 additions and 2 deletions

View File

@@ -31,8 +31,10 @@
<script lang="ts" setup>
import { useQueueSettingsStore } from '@/stores/queueStore'
import { useSettingStore } from '@/stores/settingStore'
import { storeToRefs } from 'pinia'
import InputNumber from 'primevue/inputnumber'
import { computed } from 'vue'
interface Props {
class?: string
@@ -45,7 +47,11 @@ const props = withDefaults(defineProps<Props>(), {
const queueSettingsStore = useQueueSettingsStore()
const { batchCount } = storeToRefs(queueSettingsStore)
const minQueueCount = 1
const maxQueueCount = 100
const settingStore = useSettingStore()
const maxQueueCount = computed(() =>
settingStore.get('Comfy.QueueButton.BatchCountLimit')
)
const handleClick = (increment: boolean) => {
let newCount: number

View File

@@ -386,5 +386,14 @@ export const CORE_SETTINGS: SettingParams[] = [
name: 'Show graph canvas menu',
type: 'boolean',
defaultValue: true
},
{
id: 'Comfy.QueueButton.BatchCountLimit',
name: 'Batch count limit',
tooltip:
'The maximum number of tasks added to the queue at one button click',
type: 'number',
defaultValue: 100,
versionAdded: '1.3.5'
}
]

View File

@@ -503,7 +503,8 @@ const zSettings = z.record(z.any()).and(
'Comfy.Window.UnloadConfirmation': z.boolean(),
'Comfy.NodeBadge.NodeSourceBadgeMode': zNodeBadgeMode,
'Comfy.NodeBadge.NodeIdBadgeMode': zNodeBadgeMode,
'Comfy.NodeBadge.NodeLifeCycleBadgeMode': zNodeBadgeMode
'Comfy.NodeBadge.NodeLifeCycleBadgeMode': zNodeBadgeMode,
'Comfy.QueueButton.BatchCountLimit': z.number()
})
.optional()
)

View File

@@ -47,4 +47,8 @@ export interface SettingParams {
deprecated?: boolean
// Deprecated values are mapped to new values.
migrateDeprecatedValue?: (value: any) => any
// Version of the setting when it was added
versionAdded?: string
// Version of the setting when it was last modified
versionModified?: string
}