mirror of
https://github.com/lllyasviel/stable-diffusion-webui-forge.git
synced 2026-02-28 10:43:58 +00:00
fix inpaint
This commit is contained in:
@@ -21,6 +21,11 @@ class PreprocessorInpaint(Preprocessor):
|
||||
self.model_filename_filters = ['inpaint']
|
||||
self.slider_resolution = PreprocessorParameter(visible=False)
|
||||
|
||||
def process_before_every_sampling(self, process, cond, mask, *args, **kwargs):
|
||||
mask = mask.round()
|
||||
mixed_cond = cond * (1.0 - mask) - mask
|
||||
return mixed_cond, None
|
||||
|
||||
|
||||
class PreprocessorInpaintOnly(PreprocessorInpaint):
|
||||
def __init__(self):
|
||||
@@ -32,6 +37,7 @@ class PreprocessorInpaintOnly(PreprocessorInpaint):
|
||||
self.fill_mask_with_one_when_resize_and_fill = True
|
||||
|
||||
def process_before_every_sampling(self, process, cond, mask, *args, **kwargs):
|
||||
mask = mask.round()
|
||||
self.image = cond
|
||||
self.mask = mask
|
||||
|
||||
|
||||
Reference in New Issue
Block a user