feat(ui): expand config options

now may disable individual SD features eg Noise, Variation, etc - stuff which is not ready for consumption in commercial.
This commit is contained in:
psychedelicious
2023-05-11 22:42:13 +10:00
parent 52aa0c9bbd
commit 9af385468d
10 changed files with 86 additions and 21 deletions

View File

@ -6,6 +6,7 @@ import IAICollapse from 'common/components/IAICollapse';
import { memo } from 'react';
import { ParamHiresStrength } from './ParamHiresStrength';
import { setHiresFix } from 'features/parameters/store/postprocessingSlice';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
const ParamHiresCollapse = () => {
const { t } = useTranslation();
@ -13,10 +14,16 @@ const ParamHiresCollapse = () => {
(state: RootState) => state.postprocessing.hiresFix
);
const isHiresEnabled = useFeatureStatus('hires').isFeatureEnabled;
const dispatch = useAppDispatch();
const handleToggle = () => dispatch(setHiresFix(!hiresFix));
if (!isHiresEnabled) {
return null;
}
return (
<IAICollapse
label={t('parameters.hiresOptim')}

View File

@ -7,9 +7,13 @@ import { RootState } from 'app/store/store';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { setShouldUseNoiseSettings } from 'features/parameters/store/generationSlice';
import { memo } from 'react';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
const ParamNoiseCollapse = () => {
const { t } = useTranslation();
const isNoiseEnabled = useFeatureStatus('noise').isFeatureEnabled;
const shouldUseNoiseSettings = useAppSelector(
(state: RootState) => state.generation.shouldUseNoiseSettings
);
@ -19,6 +23,10 @@ const ParamNoiseCollapse = () => {
const handleToggle = () =>
dispatch(setShouldUseNoiseSettings(!shouldUseNoiseSettings));
if (!isNoiseEnabled) {
return null;
}
return (
<IAICollapse
label={t('parameters.noiseSettings')}

View File

@ -9,6 +9,7 @@ import { generationSelector } from 'features/parameters/store/generationSelector
import { defaultSelectorOptions } from 'app/store/util/defaultMemoizeOptions';
import ParamSeamlessXAxis from './ParamSeamlessXAxis';
import ParamSeamlessYAxis from './ParamSeamlessYAxis';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
const selector = createSelector(
generationSelector,
@ -24,10 +25,16 @@ const ParamSeamlessCollapse = () => {
const { t } = useTranslation();
const { shouldUseSeamless } = useAppSelector(selector);
const isSeamlessEnabled = useFeatureStatus('seamless').isFeatureEnabled;
const dispatch = useAppDispatch();
const handleToggle = () => dispatch(setSeamless(!shouldUseSeamless));
if (!isSeamlessEnabled) {
return null;
}
return (
<IAICollapse
label={t('parameters.seamlessTiling')}

View File

@ -8,6 +8,7 @@ import IAICollapse from 'common/components/IAICollapse';
import { RootState } from 'app/store/store';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import { setShouldUseSymmetry } from 'features/parameters/store/generationSlice';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
const ParamSymmetryCollapse = () => {
const { t } = useTranslation();
@ -15,10 +16,16 @@ const ParamSymmetryCollapse = () => {
(state: RootState) => state.generation.shouldUseSymmetry
);
const isSymmetryEnabled = useFeatureStatus('symmetry').isFeatureEnabled;
const dispatch = useAppDispatch();
const handleToggle = () => dispatch(setShouldUseSymmetry(!shouldUseSymmetry));
if (!isSymmetryEnabled) {
return null;
}
return (
<IAICollapse
label={t('parameters.symmetry')}

View File

@ -7,6 +7,7 @@ import { setShouldGenerateVariations } from 'features/parameters/store/generatio
import { Flex } from '@chakra-ui/react';
import IAICollapse from 'common/components/IAICollapse';
import { memo } from 'react';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
const ParamVariationCollapse = () => {
const { t } = useTranslation();
@ -14,11 +15,17 @@ const ParamVariationCollapse = () => {
(state: RootState) => state.generation.shouldGenerateVariations
);
const isVariationEnabled = useFeatureStatus('variation').isFeatureEnabled;
const dispatch = useAppDispatch();
const handleToggle = () =>
dispatch(setShouldGenerateVariations(!shouldGenerateVariations));
if (!isVariationEnabled) {
return null;
}
return (
<IAICollapse
label={t('parameters.variations')}