mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
remove unneeded generate initializer routines
This commit is contained in:
parent
8ca91b1774
commit
6a77634b34
@ -1,35 +0,0 @@
|
|||||||
import os
|
|
||||||
import sys
|
|
||||||
import torch
|
|
||||||
import traceback
|
|
||||||
from argparse import Namespace
|
|
||||||
from omegaconf import OmegaConf
|
|
||||||
|
|
||||||
import invokeai.version
|
|
||||||
from ...backend import Globals
|
|
||||||
|
|
||||||
def load_face_restoration(opt):
|
|
||||||
try:
|
|
||||||
gfpgan, codeformer, esrgan = None, None, None
|
|
||||||
if opt.restore or opt.esrgan:
|
|
||||||
from invokeai.backend.restoration import Restoration
|
|
||||||
|
|
||||||
restoration = Restoration()
|
|
||||||
if opt.restore:
|
|
||||||
gfpgan, codeformer = restoration.load_face_restore_models(
|
|
||||||
opt.gfpgan_model_path
|
|
||||||
)
|
|
||||||
else:
|
|
||||||
print(">> Face restoration disabled")
|
|
||||||
if opt.esrgan:
|
|
||||||
esrgan = restoration.load_esrgan(opt.esrgan_bg_tile)
|
|
||||||
else:
|
|
||||||
print(">> Upscaling disabled")
|
|
||||||
else:
|
|
||||||
print(">> Face restoration and upscaling disabled")
|
|
||||||
except (ModuleNotFoundError, ImportError):
|
|
||||||
print(traceback.format_exc(), file=sys.stderr)
|
|
||||||
print(">> You may need to install the ESRGAN and/or GFPGAN modules")
|
|
||||||
return gfpgan, codeformer, esrgan
|
|
||||||
|
|
||||||
|
|
@ -90,7 +90,7 @@ class ModelManager(object):
|
|||||||
"""
|
"""
|
||||||
return model_name in self.config
|
return model_name in self.config
|
||||||
|
|
||||||
def get_model(self, model_name: str=None):
|
def get_model(self, model_name: str=None)->dict:
|
||||||
"""
|
"""
|
||||||
Given a model named identified in models.yaml, return
|
Given a model named identified in models.yaml, return
|
||||||
the model object. If in RAM will load into GPU VRAM.
|
the model object. If in RAM will load into GPU VRAM.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user