Add files via upload

This commit is contained in:
AI Lab
2025-07-27 13:46:20 -07:00
committed by GitHub
parent fe109d4a23
commit 75dc006dfc
9 changed files with 751 additions and 165 deletions
+2 -1
View File
@@ -445,7 +445,8 @@ class BiRefNetRMBG:
else:
raise ValueError("Invalid color format")
return (r, g, b, a)
rgba = hex_to_rgba(params["background_color"])
background_color = params.get("background_color", "#222222")
rgba = hex_to_rgba(background_color)
bg_image = Image.new('RGBA', orig_image.size, rgba)
composite_image = Image.alpha_composite(bg_image, foreground)
processed_images.append(pil2tensor(composite_image.convert("RGB")))