when use Upscaler with API mode(ex. /sdapi/v1/extra-single-image), it always remove background.
bug & reason
</scripts/postprocessing_rembg.py >
def process(self, pp: scripts_postprocessing.PostprocessedImage, model, return_mask, alpha_matting, alpha_matting_foreground_threshold, alpha_matting_background_threshold, alpha_matting_erode_size):
if model == "None":
return
input model value is None (no quotation marks)
Solution
def process(self, pp: scripts_postprocessing.PostprocessedImage, model, return_mask, alpha_matting, alpha_matting_foreground_threshold, alpha_matting_background_threshold, alpha_matting_erode_size):
if (model == "None" or model == 'None' or model == None):
return
when use Upscaler with API mode(ex. /sdapi/v1/extra-single-image), it always remove background.
def process(self, pp: scripts_postprocessing.PostprocessedImage, model, return_mask, alpha_matting, alpha_matting_foreground_threshold, alpha_matting_background_threshold, alpha_matting_erode_size): if model == "None":
return
input model value is None (no quotation marks)