sd-scripts
sd-scripts copied to clipboard
Handle icc profiles and images with transparency
Convert images with icc profile into sRGB. If the conversion fails due to image using color profile that pillow doesn't know an error is raised.
Raises error if image is an animation. The script currently ignores GIFs. Those could be added in now. PNG and JXL can also contain animations.
When training without alpha adds white background to transparent images.
Just calling image = image.convert("RGB") on image with transparency will often result in ugly background.
Instead of raising errors the problem images could be silently ignored. But I think telling the user something is wrong is better.
Closes #2179