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

Images stretched instead of cropped #135

Open
CypherNaught-0x opened this issue Aug 27, 2024 · 4 comments · May be fixed by #138
Open

Images stretched instead of cropped #135

CypherNaught-0x opened this issue Aug 27, 2024 · 4 comments · May be fixed by #138

Comments

@CypherNaught-0x
Copy link

CypherNaught-0x commented Aug 27, 2024

This is for bugs only

Did you already ask in the discord?

Yes/No: No (Link is invalid?)

You verified that this is a bug and not a feature request or question by asking in the discord?

Yes/No: No (Link is invalid?)

Describe the bug

Really enjoying the toolkit and the workflow using the config files.

I had a suspicion that at least some images were not being handled correctly, since many of my training runs showed extreme stretching in resulting images at some steps, usually vertical squashing.
Trying to confirm my suspicion, I've tested a few images by dumping the transformation results as images (using img.save in dataloader.mixins.py ~L500).
In my limited testing with 19 images, 4 of the images (~20%) were squished instead of cropped.
Unless I have a huge misunderstanding of the Flux architecture, I believe this to be a bug in the implementation.

@diodiogod
Copy link

diodiogod commented Aug 28, 2024

I've had some epoch version showing this stretching results as well, specially at higher weight. And there were no stretched images in my the dataset, so I imagine you are correct.

@AbstractEyes
Copy link

AbstractEyes commented Aug 28, 2024

I also had this bug show up. It's likely causing massive amounts of problems in the higher step counts.

@rickrender
Copy link

Same issue here, I thought it was just me, a likeness lora trained on iPhone images. Instead of looking cropped the heads look horizontally squashed. All of my images were in portrait orientation so I'm pretty sure it's a bug.

CypherNaught-0x pushed a commit to CypherNaught-0x/ai-toolkit that referenced this issue Aug 28, 2024
@CypherNaught-0x
Copy link
Author

CypherNaught-0x commented Aug 29, 2024

Just finished a new training run and evaluation using the fix, and it seems to have fixed the issue completely. Training is much more stable now, even at higher steps.

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 a pull request may close this issue.

4 participants