AUTOMATIC1111 / stable-diffusion-webui-rembg

Removes backgrounds from pictures. Extension for webui.
MIT License
1.17k stars 173 forks source link

when API mode, always remove background. #10

Closed scparktop closed 1 year ago

scparktop commented 1 year ago

when use Upscaler with API mode(ex. /sdapi/v1/extra-single-image), it always remove background.

  1. 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)

  1. 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