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) => {
|
||||
const { initial, min, sliderMax, inputMax, fineStep, coarseStep } =
|
||||
config.sd.height;
|
||||
const { height } = generation;
|
||||
const { height, shouldFitToWidthHeight, isImageToImageEnabled } =
|
||||
generation;
|
||||
|
||||
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 { height, initial, min, sliderMax, inputMax, step } =
|
||||
useAppSelector(selector);
|
||||
const {
|
||||
height,
|
||||
initial,
|
||||
min,
|
||||
sliderMax,
|
||||
inputMax,
|
||||
step,
|
||||
shouldFitToWidthHeight,
|
||||
isImageToImageEnabled,
|
||||
} = useAppSelector(selector);
|
||||
const dispatch = useAppDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
@ -40,6 +58,7 @@ const HeightSlider = () => {
|
||||
|
||||
return (
|
||||
<IAISlider
|
||||
isDisabled={!shouldFitToWidthHeight && isImageToImageEnabled}
|
||||
label={t('parameters.height')}
|
||||
value={height}
|
||||
min={min}
|
||||
|
@ -13,17 +13,34 @@ const selector = createSelector(
|
||||
(generation, hotkeys, config) => {
|
||||
const { initial, min, sliderMax, inputMax, fineStep, coarseStep } =
|
||||
config.sd.width;
|
||||
const { width } = generation;
|
||||
const { width, shouldFitToWidthHeight, isImageToImageEnabled } = generation;
|
||||
|
||||
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 { width, initial, min, sliderMax, inputMax, step } =
|
||||
useAppSelector(selector);
|
||||
const {
|
||||
width,
|
||||
initial,
|
||||
min,
|
||||
sliderMax,
|
||||
inputMax,
|
||||
step,
|
||||
shouldFitToWidthHeight,
|
||||
isImageToImageEnabled,
|
||||
} = useAppSelector(selector);
|
||||
const dispatch = useAppDispatch();
|
||||
const { t } = useTranslation();
|
||||
|
||||
@ -40,6 +57,7 @@ const WidthSlider = () => {
|
||||
|
||||
return (
|
||||
<IAISlider
|
||||
isDisabled={!shouldFitToWidthHeight && isImageToImageEnabled}
|
||||
label={t('parameters.width')}
|
||||
value={width}
|
||||
min={min}
|
||||
|
Loading…
Reference in New Issue
Block a user