mirror of
https://github.com/kohya-ss/sd-scripts.git
synced 2026-04-14 16:22:28 +00:00
fix reused variable
This commit is contained in:
@@ -2514,8 +2514,9 @@ def load_image(image_path, alpha=False):
|
||||
|
||||
if "A" in image.getbands():
|
||||
# Replace transparency with white background.
|
||||
alpha_layer = image.convert('RGBA').split()[-1]
|
||||
bg = Image.new("RGBA", image.size, (255, 255, 255, 255) )
|
||||
bg.paste(image, mask=alpha)
|
||||
bg.paste( image, mask=alpha_layer )
|
||||
image = bg.convert('RGB')
|
||||
|
||||
if not image.mode == "RGB":
|
||||
|
||||
Reference in New Issue
Block a user