Send 'auto' as the render_device from the UI

, if no GPU is selected and CPU is unchecked)
This commit is contained in:
cmdr2
2022-11-10 22:23:15 +05:30
parent b9a12d1562
commit baef31b2c7
2 changed files with 7 additions and 3 deletions

View File

@ -814,7 +814,11 @@ function getCurrentRenderDeviceSelection() {
return 'cpu'
}
return $(useGPUsField).val().join(',')
let selectedGPUs = $(useGPUsField).val()
if (selectedGPUs.length == 0) {
selectedGPUs = ['auto']
}
return selectedGPUs.join(',')
}
function makeImage() {
@ -1134,7 +1138,7 @@ useCPUField.addEventListener('click', function() {
let gpuSettingEntry = getParameterSettingsEntry('use_gpus')
if (this.checked) {
gpuSettingEntry.style.display = 'none'
} else if ($(useGPUsField).val().length >= MIN_GPUS_TO_SHOW_SELECTION) {
} else if (useGPUsField.options.length >= MIN_GPUS_TO_SHOW_SELECTION) {
gpuSettingEntry.style.display = ''
}
})