add GFPGAN model

This commit is contained in:
Qing
2023-03-26 13:39:09 +08:00
parent d938f2da3c
commit e7c7896bfa
7 changed files with 171 additions and 1 deletions

View File

@@ -19,7 +19,13 @@ from lama_cleaner.const import SD15_MODELS
from lama_cleaner.file_manager import FileManager
from lama_cleaner.model.utils import torch_gc
from lama_cleaner.model_manager import ModelManager
from lama_cleaner.plugins import InteractiveSeg, RemoveBG, RealESRGANUpscaler, MakeGIF
from lama_cleaner.plugins import (
InteractiveSeg,
RemoveBG,
RealESRGANUpscaler,
MakeGIF,
GFPGANPlugin,
)
from lama_cleaner.schema import Config
try:
@@ -423,6 +429,9 @@ def build_plugins(args):
plugins[RealESRGANUpscaler.name] = RealESRGANUpscaler(
args.realesrgan_model, args.realesrgan_device
)
if args.enable_gfpgan:
logger.info(f"Initialize {GFPGANPlugin.name} plugin")
plugins[GFPGANPlugin.name] = GFPGANPlugin(args.gfpgan_device)
if args.enable_gif:
logger.info(f"Initialize GIF plugin")
plugins[MakeGIF.name] = MakeGIF()