mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): use config for all numerical params
Centralize the initial/min/max/etc values for all numerical params. We used this for some but at some point stopped updating it. All numerical params now use their respective configs. Far fewer hardcoded values throughout the app now. Also updated the config types a bit to better accommodate slider vs number input constraints.
This commit is contained in:
@ -8,8 +8,14 @@ import { useTranslation } from 'react-i18next';
|
||||
const ParamHrfStrength = () => {
|
||||
const hrfStrength = useAppSelector((s) => s.hrf.hrfStrength);
|
||||
const initial = useAppSelector((s) => s.config.sd.hrfStrength.initial);
|
||||
const min = useAppSelector((s) => s.config.sd.hrfStrength.min);
|
||||
const sliderMin = useAppSelector((s) => s.config.sd.hrfStrength.sliderMin);
|
||||
const sliderMax = useAppSelector((s) => s.config.sd.hrfStrength.sliderMax);
|
||||
const numberInputMin = useAppSelector(
|
||||
(s) => s.config.sd.hrfStrength.numberInputMin
|
||||
);
|
||||
const numberInputMax = useAppSelector(
|
||||
(s) => s.config.sd.hrfStrength.numberInputMax
|
||||
);
|
||||
const coarseStep = useAppSelector((s) => s.config.sd.hrfStrength.coarseStep);
|
||||
const fineStep = useAppSelector((s) => s.config.sd.hrfStrength.fineStep);
|
||||
const dispatch = useAppDispatch();
|
||||
@ -25,7 +31,7 @@ const ParamHrfStrength = () => {
|
||||
return (
|
||||
<InvControl label={t('parameters.denoisingStrength')}>
|
||||
<InvSlider
|
||||
min={min}
|
||||
min={sliderMin}
|
||||
max={sliderMax}
|
||||
step={coarseStep}
|
||||
fineStep={fineStep}
|
||||
@ -34,6 +40,8 @@ const ParamHrfStrength = () => {
|
||||
onChange={onChange}
|
||||
marks
|
||||
withNumberInput
|
||||
numberInputMin={numberInputMin}
|
||||
numberInputMax={numberInputMax}
|
||||
/>
|
||||
</InvControl>
|
||||
);
|
||||
|
Reference in New Issue
Block a user