stop crash on text mask generation

This commit is contained in:
Lincoln Stein 2022-11-12 18:23:02 +00:00
parent 98db0d746c
commit 72e011a4e4

View File

@ -613,6 +613,7 @@ def do_textmask(gen, opt, callback):
image_path = os.path.join(opt.outdir,image_path)
assert os.path.exists(image_path), '** "{opt.prompt}" not found. Please enter the name of an existing image file to mask **'
assert opt.text_mask is not None and len(opt.text_mask) >= 1, '** Please provide a text mask with -tm **'
opt.input_file_path = image_path
tm = opt.text_mask[0]
threshold = float(opt.text_mask[1]) if len(opt.text_mask) > 1 else 0.5
gen.apply_textmask(
@ -633,6 +634,7 @@ def do_postprocess (gen, opt, callback):
file_path = os.path.join(opt.outdir,file_path)
opt.input_file_path = file_path
tool=None
if opt.facetool_strength > 0:
tool = opt.facetool