ai-toolkit icon indicating copy to clipboard operation
ai-toolkit copied to clipboard

Images stretched instead of cropped

Open CypherNaught-0x opened this issue 1 year ago • 4 comments

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.

CypherNaught-0x avatar Aug 27 '24 15:08 CypherNaught-0x

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.

diodiogod avatar Aug 28 '24 00:08 diodiogod

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

AbstractEyes avatar Aug 28 '24 02:08 AbstractEyes

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.

rickrender avatar Aug 28 '24 06:08 rickrender

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.

CypherNaught-0x avatar Aug 29 '24 11:08 CypherNaught-0x