Kilvoctu / aiyabot

A neat Discord bot for AUTOMATIC1111's Web UI
GNU General Public License v2.0
305 stars 79 forks source link

Added support for SDXL generation sizes. #243

Closed JoshBaldwin101 closed 4 months ago

JoshBaldwin101 commented 4 months ago

Copied and edited from: #239

Fixed as to not conflict with: #236

Seeing as SDXL models have been out for a while now, I was surprised to see this project doesn't support it's most common generation sizes.

My changes bring the minimum generation size to 512 and the maximum to 2048. I know 2048 is overkill but call it future-proofing. My changes also hit all of the recommended SDXL generation sizes.

Stabililty AI has stated that the following generation sizes are ideal for SDXL models:

Without my changes, only 1024 x 1024 is possible. My solution hits all of these and more.

Kilvoctu commented 4 months ago

Heya, this seems good for the most part, but I can't get higher resolutions as described here. Are you able to replicate this issue? image

Seeing as SDXL models have been out for a while now, I was surprised to see this project doesn't support it's most common generation sizes.

In regards to this comment, I have a pinned topic #229 in Discussions with an explanation (I still watch this repo, however). Honestly, I've not followed much developments on the Stable Diffusion news, either. I've read that SDXL exists, but know nothing about how it's different from previous SD

JoshBaldwin101 commented 4 months ago

@Kilvoctu I suspect this is happening because you merged pull request #236 which changed it to multiples of 8 instead of multiples of 64. Multiples of 64 fit nicely into Discord's limit of 25 previewed options. My original suggestion was in multiples of 64 as I thought multiples of 8 was a bad idea for the reason you're now running into.

I can either make changes that turn it back into multiples of 64 so you can see all 25 previews Or you can merge this and keep it at multiples of 8 which should still let you generate at higher sizes (up to 2048 x 2048).

Here is what I see.

JoshBaldwin101 commented 4 months ago

@Kilvoctu Sorry if my PR came off as negative. I do really like this repo as I've used it for quite a while now. I just had a hacky workaround to make it work for SDXL sizes and I figured I'd make a PR to update it in a better way so everyone else could enjoy it.

As for SDXL vs. SD1.5, SDXL is increasingly popular and is getting very good. There are now lightning models that can generate amazing images in 1024 x 1024 with just 6 steps. Super cool stuff and I'm sure people would be anxious to try them with your project.

sebaxakerhtc commented 4 months ago

@JoshBaldwin101 I use the same in my bot :) That's why I don't like this PR too. It useless because there's a bit of standard resolutions and there's no reason to have every 4 or 8 px step

May be we should save 384px as minimum, because there are still people who generates 512x384px images... But I use the minimum 768 in my fork. Will change it to 512 - why not ;)

JustGuyThatGuy commented 4 months ago

Personally I've since ended up getting rid of the selector altogether as I didn't feel it added anything useful - I set my max size at 2048, updated the accepted ranges and removed the autocomplete.

My users knew it needed to be something divisible by 8 already and over half of them did their base gens at sizes not divisible by 64 before using a bot which is why I suggested changing that in the first place (I didn't use the legacy highres fix, so people had the ability to specify base gen and highres gen sizes, or the upscale by value).

Even if you didn't restrict it in any way and someone were to come along and specify a resolution not divisible by 8, automatic1111 automatically rounds the number given to the nearest 8 anyway, but obviously you can also just add some validation logic to ensure it is a number within the valid range too.

Kilvoctu commented 4 months ago

Probably at this point, should just remove the selector and have manual input. The aiyabot should round the input to the nearest 8 within the valid range automatically. I'll go ahead and merge this PR then make this change myself 👍

Kilvoctu commented 4 months ago

Probably at this point, should just remove the selector and have manual input. The aiyabot should round the input to the nearest 8 within the valid range automatically. I'll go ahead and merge this PR then make this change myself 👍

6a96ec2617e8a993046482071fbef83108c8f6b6

This should allow people to use anything they want between 64 and max_size as is set in config.toml, and round to nearest 8.

JustGuyThatGuy commented 4 months ago

Nice one, that definitely makes things a lot more flexible!

JoshBaldwin101 commented 4 months ago

Looks good, works for me 👍