ini inpaint

This commit is contained in:
lllyasviel
2024-01-30 12:53:21 -08:00
parent 015f0967e1
commit 7b0a202f89
5 changed files with 108 additions and 49 deletions
@@ -0,0 +1,39 @@
from modules_forge.supported_preprocessor import Preprocessor, PreprocessorParameter
from modules_forge.shared import add_supported_preprocessor
from modules_forge.forge_util import numpy_to_pytorch
class PreprocessorInpaint(Preprocessor):
def __init__(self, name, use_inpaint_sampler=False, use_lama=False):
super().__init__()
self.name = name
self.use_inpaint_sampler = use_inpaint_sampler
self.use_lama = use_lama
self.tags = ['Inpaint']
self.model_filename_filters = ['inpaint']
self.slider_resolution = PreprocessorParameter(visible=False)
def process_before_every_sampling(self, process, cond, *args, **kwargs):
return
def process_after_every_sampling(self, process, params, *args, **kwargs):
return
add_supported_preprocessor(PreprocessorInpaint(
name='inpaint_global_harmonious',
use_inpaint_sampler=False,
use_lama=False
))
add_supported_preprocessor(PreprocessorInpaint(
name='inpaint_only',
use_inpaint_sampler=False,
use_lama=False
))
add_supported_preprocessor(PreprocessorInpaint(
name='inpaint_only+lama',
use_inpaint_sampler=False,
use_lama=False
))