add gfpgan

This commit is contained in:
Qing
2023-03-26 20:42:31 +08:00
parent e7c7896bfa
commit b200db920b
5 changed files with 72 additions and 21 deletions

View File

@@ -598,6 +598,15 @@ export default function Editor() {
}
}, [runRenderablePlugin])
useEffect(() => {
emitter.on(PluginName.GFPGAN, () => {
runRenderablePlugin(PluginName.GFPGAN)
})
return () => {
emitter.off(PluginName.GFPGAN)
}
}, [runRenderablePlugin])
useEffect(() => {
emitter.on(PluginName.RealESRGAN, (data: any) => {
runRenderablePlugin(PluginName.RealESRGAN, data)

View File

@@ -4,6 +4,7 @@ import { CursorArrowRaysIcon, GifIcon } from '@heroicons/react/24/outline'
import {
BoxModelIcon,
ChevronRightIcon,
FaceIcon,
HobbyKnifeIcon,
MixIcon,
} from '@radix-ui/react-icons'
@@ -20,6 +21,7 @@ import Button from '../shared/Button'
export enum PluginName {
RemoveBG = 'RemoveBG',
RealESRGAN = 'RealESRGAN',
GFPGAN = 'GFPGAN',
InteractiveSeg = 'InteractiveSeg',
MakeGIF = 'MakeGIF',
}
@@ -33,6 +35,10 @@ const pluginMap = {
IconClass: BoxModelIcon,
showName: 'RealESRGAN 4x',
},
[PluginName.GFPGAN]: {
IconClass: FaceIcon,
showName: 'GFPGAN',
},
[PluginName.InteractiveSeg]: {
IconClass: CursorArrowRaysIcon,
showName: 'Interactive Seg',