fix(ui): sets cfg_rescael_multiplier to 0 if there is no default. Also fixes issue with truthiness check causing 0 value to be missed. See https://github.com/invoke-ai/InvokeAI/issues/7584

This commit is contained in:
Jeremy Gooch
2025-07-03 10:43:17 -05:00
committed by psychedelicious
parent 9930440f33
commit d794aedb43

View File

@@ -1,4 +1,5 @@
import type { AppStartListening } from 'app/store/middleware/listenerMiddleware';
import { isNil } from 'es-toolkit';
import { bboxHeightChanged, bboxWidthChanged } from 'features/controlLayers/store/canvasSlice';
import { selectIsStaging } from 'features/controlLayers/store/canvasStagingAreaSlice';
import {
@@ -86,10 +87,16 @@ export const addSetDefaultSettingsListener = (startAppListening: AppStartListeni
}
}
if (cfg_rescale_multiplier) {
if (!isNil(cfg_rescale_multiplier)) {
if (isParameterCFGRescaleMultiplier(cfg_rescale_multiplier)) {
dispatch(setCfgRescaleMultiplier(cfg_rescale_multiplier));
}
} else {
// Set this to 0 if it doesn't have a default. This value is
// easy to miss in the UI when users are resetting defaults
// and leaving it non-zero could lead to detrimental
// effects.
dispatch(setCfgRescaleMultiplier(0));
}
if (steps) {