daquanzhou
merge github repos and lfs track ckpt/path/safetensors/pt
613c9ab
raw
history blame
229 Bytes
from PIL import Image
def flatten(img, bgcolor):
# Replace transparency with bgcolor
if img.mode in ("RGB"):
return img
return Image.alpha_composite(Image.new("RGBA", img.size, bgcolor), img).convert("RGB")