add restoreformer

This commit is contained in:
Qing
2023-03-30 16:07:38 +08:00
parent f2e90d3f84
commit c52f733214
9 changed files with 103 additions and 21 deletions

View File

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

View File

@@ -48,7 +48,7 @@
border-radius: 3px;
display: flex;
align-items: center;
height: 25px;
height: 32px;
padding: 0 5px;
position: relative;
user-select: none;

View File

@@ -22,6 +22,7 @@ export enum PluginName {
RemoveBG = 'RemoveBG',
RealESRGAN = 'RealESRGAN',
GFPGAN = 'GFPGAN',
RestoreFormer = 'RestoreFormer',
InteractiveSeg = 'InteractiveSeg',
MakeGIF = 'MakeGIF',
}
@@ -39,6 +40,10 @@ const pluginMap = {
IconClass: FaceIcon,
showName: 'GFPGAN',
},
[PluginName.RestoreFormer]: {
IconClass: FaceIcon,
showName: 'RestoreFormer',
},
[PluginName.InteractiveSeg]: {
IconClass: CursorArrowRaysIcon,
showName: 'Interactive Seg',