ldm add plms sampler

This commit is contained in:
Qing
2022-06-12 13:14:17 +08:00
parent 55197f2209
commit 35b92ba9de
11 changed files with 478 additions and 207 deletions

View File

@@ -11,6 +11,11 @@ export enum HDStrategy {
CROP = 'Crop',
}
export enum LDMSampler {
ddim = 'ddim',
plms = 'plms',
}
function HDSettingBlock() {
const [setting, setSettingState] = useRecoilState(settingState)

View File

@@ -2,6 +2,7 @@ import React, { ReactNode } from 'react'
import { useRecoilState } from 'recoil'
import { settingState } from '../../store/Atoms'
import Selector from '../shared/Selector'
import { LDMSampler } from './HDSettingBlock'
import NumberInputSetting from './NumberInputSetting'
import SettingBlock from './SettingBlock'
@@ -19,6 +20,12 @@ function ModelSettingBlock() {
})
}
const onLDMSamplerChange = (value: LDMSampler) => {
setSettingState(old => {
return { ...old, ldmSampler: value }
})
}
const renderModelDesc = (
name: string,
paperUrl: string,
@@ -65,6 +72,19 @@ function ModelSettingBlock() {
})
}}
/>
<SettingBlock
className="sub-setting-block"
title="Sampler"
input={
<Selector
width={80}
value={setting.ldmSampler as string}
options={Object.values(LDMSampler)}
onChange={val => onLDMSamplerChange(val as LDMSampler)}
/>
}
/>
</div>
)
}