mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Diffusers Samplers
DIsplay sampler list based on the active model.
This commit is contained in:
parent
f121dfe120
commit
fcffcf5602
@ -16,6 +16,20 @@ export const SAMPLERS: Array<string> = [
|
|||||||
'k_heun',
|
'k_heun',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
// Valid Diffusers Samplers
|
||||||
|
export const DIFFUSERS_SAMPLERS: Array<string> = [
|
||||||
|
'ddim',
|
||||||
|
'plms',
|
||||||
|
'k_lms',
|
||||||
|
'dpmpp_2',
|
||||||
|
'k_dpm_2',
|
||||||
|
'k_dpm_2_a',
|
||||||
|
'k_dpmpp_2',
|
||||||
|
'k_euler',
|
||||||
|
'k_euler_a',
|
||||||
|
'k_heun',
|
||||||
|
];
|
||||||
|
|
||||||
// Valid image widths
|
// Valid image widths
|
||||||
export const WIDTHS: Array<number> = [
|
export const WIDTHS: Array<number> = [
|
||||||
64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960,
|
64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960,
|
||||||
|
@ -1,13 +1,16 @@
|
|||||||
import React, { ChangeEvent } from 'react';
|
import React, { ChangeEvent } from 'react';
|
||||||
import { SAMPLERS } from 'app/constants';
|
import { DIFFUSERS_SAMPLERS, SAMPLERS } from 'app/constants';
|
||||||
import { RootState } from 'app/store';
|
import { RootState } from 'app/store';
|
||||||
import { useAppDispatch, useAppSelector } from 'app/storeHooks';
|
import { useAppDispatch, useAppSelector } from 'app/storeHooks';
|
||||||
import IAISelect from 'common/components/IAISelect';
|
import IAISelect from 'common/components/IAISelect';
|
||||||
import { setSampler } from 'features/options/store/optionsSlice';
|
import { setSampler } from 'features/options/store/optionsSlice';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import _ from 'lodash';
|
||||||
|
import { activeModelSelector } from 'features/system/store/systemSelectors';
|
||||||
|
|
||||||
export default function MainSampler() {
|
export default function MainSampler() {
|
||||||
const sampler = useAppSelector((state: RootState) => state.options.sampler);
|
const sampler = useAppSelector((state: RootState) => state.options.sampler);
|
||||||
|
const activeModel = useAppSelector(activeModelSelector);
|
||||||
const dispatch = useAppDispatch();
|
const dispatch = useAppDispatch();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
@ -19,7 +22,9 @@ export default function MainSampler() {
|
|||||||
label={t('options:sampler')}
|
label={t('options:sampler')}
|
||||||
value={sampler}
|
value={sampler}
|
||||||
onChange={handleChangeSampler}
|
onChange={handleChangeSampler}
|
||||||
validValues={SAMPLERS}
|
validValues={
|
||||||
|
activeModel.format === 'diffusers' ? DIFFUSERS_SAMPLERS : SAMPLERS
|
||||||
|
}
|
||||||
styleClass="main-option-block"
|
styleClass="main-option-block"
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user