mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
feat(ui): disable w/h when img2img & not fit
This commit is contained in:
parent
b49d76ebee
commit
276dfc591b
@ -13,17 +13,35 @@ const selector = createSelector(
|
|||||||
(generation, hotkeys, config) => {
|
(generation, hotkeys, config) => {
|
||||||
const { initial, min, sliderMax, inputMax, fineStep, coarseStep } =
|
const { initial, min, sliderMax, inputMax, fineStep, coarseStep } =
|
||||||
config.sd.height;
|
config.sd.height;
|
||||||
const { height } = generation;
|
const { height, shouldFitToWidthHeight, isImageToImageEnabled } =
|
||||||
|
generation;
|
||||||
|
|
||||||
const step = hotkeys.shift ? fineStep : coarseStep;
|
const step = hotkeys.shift ? fineStep : coarseStep;
|
||||||
|
|
||||||
return { height, initial, min, sliderMax, inputMax, step };
|
return {
|
||||||
|
height,
|
||||||
|
initial,
|
||||||
|
min,
|
||||||
|
sliderMax,
|
||||||
|
inputMax,
|
||||||
|
step,
|
||||||
|
shouldFitToWidthHeight,
|
||||||
|
isImageToImageEnabled,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const HeightSlider = () => {
|
const HeightSlider = () => {
|
||||||
const { height, initial, min, sliderMax, inputMax, step } =
|
const {
|
||||||
useAppSelector(selector);
|
height,
|
||||||
|
initial,
|
||||||
|
min,
|
||||||
|
sliderMax,
|
||||||
|
inputMax,
|
||||||
|
step,
|
||||||
|
shouldFitToWidthHeight,
|
||||||
|
isImageToImageEnabled,
|
||||||
|
} = useAppSelector(selector);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@ -40,6 +58,7 @@ const HeightSlider = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IAISlider
|
<IAISlider
|
||||||
|
isDisabled={!shouldFitToWidthHeight && isImageToImageEnabled}
|
||||||
label={t('parameters.height')}
|
label={t('parameters.height')}
|
||||||
value={height}
|
value={height}
|
||||||
min={min}
|
min={min}
|
||||||
|
@ -13,17 +13,34 @@ const selector = createSelector(
|
|||||||
(generation, hotkeys, config) => {
|
(generation, hotkeys, config) => {
|
||||||
const { initial, min, sliderMax, inputMax, fineStep, coarseStep } =
|
const { initial, min, sliderMax, inputMax, fineStep, coarseStep } =
|
||||||
config.sd.width;
|
config.sd.width;
|
||||||
const { width } = generation;
|
const { width, shouldFitToWidthHeight, isImageToImageEnabled } = generation;
|
||||||
|
|
||||||
const step = hotkeys.shift ? fineStep : coarseStep;
|
const step = hotkeys.shift ? fineStep : coarseStep;
|
||||||
|
|
||||||
return { width, initial, min, sliderMax, inputMax, step };
|
return {
|
||||||
|
width,
|
||||||
|
initial,
|
||||||
|
min,
|
||||||
|
sliderMax,
|
||||||
|
inputMax,
|
||||||
|
step,
|
||||||
|
shouldFitToWidthHeight,
|
||||||
|
isImageToImageEnabled,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
const WidthSlider = () => {
|
const WidthSlider = () => {
|
||||||
const { width, initial, min, sliderMax, inputMax, step } =
|
const {
|
||||||
useAppSelector(selector);
|
width,
|
||||||
|
initial,
|
||||||
|
min,
|
||||||
|
sliderMax,
|
||||||
|
inputMax,
|
||||||
|
step,
|
||||||
|
shouldFitToWidthHeight,
|
||||||
|
isImageToImageEnabled,
|
||||||
|
} = useAppSelector(selector);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@ -40,6 +57,7 @@ const WidthSlider = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<IAISlider
|
<IAISlider
|
||||||
|
isDisabled={!shouldFitToWidthHeight && isImageToImageEnabled}
|
||||||
label={t('parameters.width')}
|
label={t('parameters.width')}
|
||||||
value={width}
|
value={width}
|
||||||
min={min}
|
min={min}
|
||||||
|
Loading…
Reference in New Issue
Block a user