diff --git a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.tsx b/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.tsx index 4f36656a00..4f98bd6a81 100644 --- a/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.tsx +++ b/invokeai/frontend/web/src/common/components/InvNumberInput/InvNumberInput.tsx @@ -24,6 +24,7 @@ export const InvNumberInput = memo( fineStep: _fineStep, onChange: _onChange, numberInputFieldProps, + defaultValue, ...rest } = props; @@ -69,7 +70,7 @@ export const InvNumberInput = memo( (e) => { if (!e.target.value) { // If the input is empty, we set it to the minimum value - onChange(String(min), min); + onChange(String(defaultValue ?? min), Number(defaultValue) ?? min); } else { // Otherwise, we round the value to the nearest multiple if integer, else 3 decimals const roundedValue = isInteger @@ -83,6 +84,7 @@ export const InvNumberInput = memo( [ _fineStep, _step, + defaultValue, isInteger, max, min, @@ -107,10 +109,11 @@ export const InvNumberInput = memo( return (