Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix using wrong values for WEBP format caching #86

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

aria1th
Copy link

@aria1th aria1th commented Aug 17, 2024

WEBP files will use wrong size for latent cache.

Here, you can see the part that would use h,w
https://github.com/ostris/ai-toolkit/blob/main/toolkit/data_transfer_object/data_loader.py#L58

However, the original code did not have fix in latent caching part.

the function load_unconditional_image throws error, load_mask_image swaps the sizes.

It is actually problem of data_loader.py, we can just use

                if self.path.endswith('.webp'):
                    w, h = img.size
                else:
                    h, w = img.size

*note, the cache created before patch has to be removed for sanity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant