ldm add plms sampler
This commit is contained in:
@@ -16,6 +16,7 @@ export default async function inpaint(
|
||||
fd.append('mask', mask)
|
||||
|
||||
fd.append('ldmSteps', settings.ldmSteps.toString())
|
||||
fd.append('ldmSampler', settings.ldmSampler.toString())
|
||||
fd.append('hdStrategy', settings.hdStrategy)
|
||||
fd.append('hdStrategyCropMargin', settings.hdStrategyCropMargin.toString())
|
||||
fd.append(
|
||||
|
||||
@@ -11,6 +11,11 @@ export enum HDStrategy {
|
||||
CROP = 'Crop',
|
||||
}
|
||||
|
||||
export enum LDMSampler {
|
||||
ddim = 'ddim',
|
||||
plms = 'plms',
|
||||
}
|
||||
|
||||
function HDSettingBlock() {
|
||||
const [setting, setSettingState] = useRecoilState(settingState)
|
||||
|
||||
|
||||
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ export default function ShortcutsModal() {
|
||||
/>
|
||||
<ShortCut content="Undo Inpainting" keys={[CmdOrCtrl, 'Z']} />
|
||||
<ShortCut content="Pan" keys={['Space & Drag']} />
|
||||
<ShortCut content="View Original Image" keys={['Hold Tag']} />
|
||||
<ShortCut content="View Original Image" keys={['Hold Tab']} />
|
||||
<ShortCut content="Reset Zoom/Pan" keys={['Esc']} />
|
||||
<ShortCut content="Cancel Mask Drawing" keys={['Esc']} />
|
||||
<ShortCut content="Run Inpainting Manually" keys={['Shift', 'R']} />
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
all: unset;
|
||||
flex: 1 0 auto;
|
||||
border-radius: 0.5rem;
|
||||
padding: 0.4rem 0.8rem;
|
||||
padding: 0 0.8rem;
|
||||
outline: 1px solid var(--border-color);
|
||||
height: 36px;
|
||||
|
||||
&:focus-visible {
|
||||
outline: 1px solid var(--yellow-accent);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { atom } from 'recoil'
|
||||
import { HDStrategy } from '../components/Settings/HDSettingBlock'
|
||||
import { HDStrategy, LDMSampler } from '../components/Settings/HDSettingBlock'
|
||||
import { AIModel } from '../components/Settings/ModelSettingBlock'
|
||||
import { ToastState } from '../components/shared/Toast'
|
||||
|
||||
@@ -43,6 +43,7 @@ export interface Settings {
|
||||
|
||||
// For LDM
|
||||
ldmSteps: number
|
||||
ldmSampler: LDMSampler
|
||||
}
|
||||
|
||||
export const settingStateDefault = {
|
||||
@@ -50,6 +51,7 @@ export const settingStateDefault = {
|
||||
runInpaintingManually: false,
|
||||
model: AIModel.LAMA,
|
||||
ldmSteps: 50,
|
||||
ldmSampler: LDMSampler.plms,
|
||||
hdStrategy: HDStrategy.RESIZE,
|
||||
hdStrategyResizeLimit: 2048,
|
||||
hdStrategyCropTrigerSize: 2048,
|
||||
|
||||
Reference in New Issue
Block a user