mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
ready for merge after documentation added
This commit is contained in:
@ -428,10 +428,11 @@ class Generate:
|
||||
fit=fit,
|
||||
text_mask=text_mask,
|
||||
invert_mask=invert_mask,
|
||||
force_outpaint=force_outpaint,
|
||||
)
|
||||
|
||||
# TODO: Hacky selection of operation to perform. Needs to be refactored.
|
||||
generator = self.select_generator(init_image, mask_image, embiggen, hires_fix)
|
||||
generator = self.select_generator(init_image, mask_image, embiggen, hires_fix, force_outpaint)
|
||||
|
||||
generator.set_variation(
|
||||
self.seed, variation_amount, with_variations
|
||||
@ -649,6 +650,7 @@ class Generate:
|
||||
mask_image:Image.Image=None,
|
||||
embiggen:bool=False,
|
||||
hires_fix:bool=False,
|
||||
force_outpaint:bool=False,
|
||||
):
|
||||
inpainting_model_in_use = self.sampler.uses_inpainting_model()
|
||||
|
||||
@ -678,6 +680,7 @@ class Generate:
|
||||
fit=False,
|
||||
text_mask=None,
|
||||
invert_mask=False,
|
||||
force_outpaint=False,
|
||||
):
|
||||
init_image = None
|
||||
init_mask = None
|
||||
@ -691,7 +694,7 @@ class Generate:
|
||||
|
||||
# if image has a transparent area and no mask was provided, then try to generate mask
|
||||
if self._has_transparency(image):
|
||||
self._transparency_check_and_warning(image, mask)
|
||||
self._transparency_check_and_warning(image, mask, force_outpaint)
|
||||
init_mask = self._create_init_mask(image, width, height, fit=fit)
|
||||
|
||||
if (image.width * image.height) > (self.width * self.height) and self.size_matters:
|
||||
@ -1005,11 +1008,11 @@ class Generate:
|
||||
colored += 1
|
||||
return colored == 0
|
||||
|
||||
def _transparency_check_and_warning(self,image, mask):
|
||||
def _transparency_check_and_warning(self,image, mask, force_outpaint=False):
|
||||
if not mask:
|
||||
print(
|
||||
'>> Initial image has transparent areas. Will inpaint in these regions.')
|
||||
if self._check_for_erasure(image):
|
||||
if (not force_outpaint) and self._check_for_erasure(image):
|
||||
print(
|
||||
'>> WARNING: Colors underneath the transparent region seem to have been erased.\n',
|
||||
'>> Inpainting will be suboptimal. Please preserve the colors when making\n',
|
||||
|
Reference in New Issue
Block a user