wip
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import React, { ReactNode } from 'react'
|
||||
import { useRecoilState } from 'recoil'
|
||||
import { AIModel, settingState } from '../../store/Atoms'
|
||||
import { AIModel, SDSampler, settingState } from '../../store/Atoms'
|
||||
import Selector from '../shared/Selector'
|
||||
import { Switch, SwitchThumb } from '../shared/Switch'
|
||||
import Tooltip from '../shared/Tooltip'
|
||||
@@ -145,6 +145,8 @@ function ModelSettingBlock() {
|
||||
return undefined
|
||||
case AIModel.FCF:
|
||||
return renderFCFModelDesc()
|
||||
case AIModel.SD14:
|
||||
return undefined
|
||||
default:
|
||||
return <></>
|
||||
}
|
||||
@@ -182,6 +184,12 @@ function ModelSettingBlock() {
|
||||
'https://arxiv.org/abs/2208.03382',
|
||||
'https://github.com/SHI-Labs/FcF-Inpainting'
|
||||
)
|
||||
case AIModel.SD14:
|
||||
return renderModelDesc(
|
||||
'Stable Diffusion',
|
||||
'https://ommer-lab.com/research/latent-diffusion-models/',
|
||||
'https://github.com/CompVis/stable-diffusion'
|
||||
)
|
||||
default:
|
||||
return <></>
|
||||
}
|
||||
|
||||
@@ -4,14 +4,28 @@ import SettingBlock from './SettingBlock'
|
||||
|
||||
interface NumberInputSettingProps {
|
||||
title: string
|
||||
allowFloat?: boolean
|
||||
desc?: string
|
||||
value: string
|
||||
suffix?: string
|
||||
width?: number
|
||||
widthUnit?: string
|
||||
disable?: boolean
|
||||
onValue: (val: string) => void
|
||||
}
|
||||
|
||||
function NumberInputSetting(props: NumberInputSettingProps) {
|
||||
const { title, desc, value, suffix, onValue } = props
|
||||
const {
|
||||
title,
|
||||
allowFloat,
|
||||
desc,
|
||||
value,
|
||||
suffix,
|
||||
onValue,
|
||||
width,
|
||||
widthUnit,
|
||||
disable,
|
||||
} = props
|
||||
|
||||
return (
|
||||
<SettingBlock
|
||||
@@ -28,8 +42,10 @@ function NumberInputSetting(props: NumberInputSettingProps) {
|
||||
}}
|
||||
>
|
||||
<NumberInput
|
||||
style={{ width: '80px' }}
|
||||
allowFloat={allowFloat}
|
||||
style={{ width: `${width}${widthUnit}` }}
|
||||
value={`${value}`}
|
||||
disabled={disable}
|
||||
onValue={onValue}
|
||||
/>
|
||||
{suffix && <span>{suffix}</span>}
|
||||
@@ -39,4 +55,11 @@ function NumberInputSetting(props: NumberInputSettingProps) {
|
||||
)
|
||||
}
|
||||
|
||||
NumberInputSetting.defaultProps = {
|
||||
allowFloat: false,
|
||||
width: 80,
|
||||
widthUnit: 'px',
|
||||
disable: false,
|
||||
}
|
||||
|
||||
export default NumberInputSetting
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
import React from 'react'
|
||||
|
||||
import { useRecoilState } from 'recoil'
|
||||
import { settingState } from '../../store/Atoms'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { isSDState, settingState } from '../../store/Atoms'
|
||||
import Modal from '../shared/Modal'
|
||||
import ManualRunInpaintingSettingBlock from './ManualRunInpaintingSettingBlock'
|
||||
import HDSettingBlock from './HDSettingBlock'
|
||||
import ModelSettingBlock from './ModelSettingBlock'
|
||||
import GraduallyInpaintingSettingBlock from './GraduallyInpaintingSettingBlock'
|
||||
import DownloadMaskSettingBlock from './DownloadMaskSettingBlock'
|
||||
import useHotKey from '../../hooks/useHotkey'
|
||||
|
||||
interface SettingModalProps {
|
||||
onClose: () => void
|
||||
@@ -15,6 +16,7 @@ interface SettingModalProps {
|
||||
export default function SettingModal(props: SettingModalProps) {
|
||||
const { onClose } = props
|
||||
const [setting, setSettingState] = useRecoilState(settingState)
|
||||
const isSD = useRecoilValue(isSDState)
|
||||
|
||||
const handleOnClose = () => {
|
||||
setSettingState(old => {
|
||||
@@ -23,6 +25,17 @@ export default function SettingModal(props: SettingModalProps) {
|
||||
onClose()
|
||||
}
|
||||
|
||||
useHotKey(
|
||||
's',
|
||||
() => {
|
||||
setSettingState(old => {
|
||||
return { ...old, show: !old.show }
|
||||
})
|
||||
},
|
||||
{},
|
||||
[]
|
||||
)
|
||||
|
||||
return (
|
||||
<Modal
|
||||
onClose={handleOnClose}
|
||||
@@ -30,11 +43,12 @@ export default function SettingModal(props: SettingModalProps) {
|
||||
className="modal-setting"
|
||||
show={setting.show}
|
||||
>
|
||||
<ManualRunInpaintingSettingBlock />
|
||||
{isSD ? <></> : <ManualRunInpaintingSettingBlock />}
|
||||
|
||||
<GraduallyInpaintingSettingBlock />
|
||||
<DownloadMaskSettingBlock />
|
||||
<ModelSettingBlock />
|
||||
<HDSettingBlock />
|
||||
{isSD ? <></> : <HDSettingBlock />}
|
||||
</Modal>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user