feat: Add setting to hide / display schedulers

This commit is contained in:
blessedcoolant
2023-05-13 08:17:45 +12:00
committed by psychedelicious
parent 026d3260b4
commit d2ebc6741b
7 changed files with 98 additions and 23 deletions

View File

@ -1,7 +1,3 @@
import {
DIFFUSERS_SCHEDULERS,
IMG2IMG_DIFFUSERS_SCHEDULERS,
} from 'app/constants';
import { RootState } from 'app/store/store';
import { useAppDispatch, useAppSelector } from 'app/store/storeHooks';
import IAISelect from 'common/components/IAISelect';
@ -17,6 +13,12 @@ const ParamSampler = () => {
const activeTabName = useAppSelector(activeTabNameSelector);
const schedulers = useAppSelector((state: RootState) => state.ui.schedulers);
const img2imgSchedulers = schedulers.filter((scheduler) => {
return !['dpmpp_2s'].includes(scheduler);
});
const dispatch = useAppDispatch();
const { t } = useTranslation();
@ -31,9 +33,9 @@ const ParamSampler = () => {
value={sampler}
onChange={handleChange}
validValues={
activeTabName === 'img2img' || activeTabName == 'unifiedCanvas'
? IMG2IMG_DIFFUSERS_SCHEDULERS
: DIFFUSERS_SCHEDULERS
['img2img', 'unifiedCanvas'].includes(activeTabName)
? img2imgSchedulers
: schedulers
}
minWidth={36}
/>