Fooocus icon indicating copy to clipboard operation
Fooocus copied to clipboard

Added new aspect ratios '1080*1920', '1920*1080' and '1024x768'

Open zelva3 opened this issue 1 year ago • 4 comments

I have added a few commonly used aspect ratios: '1080x1920', '1920x1080', and '1024x768'. I believe most people would love to have this.

ref: https://github.com/lllyasviel/Fooocus/discussions/984

image

zelva3 avatar Dec 27 '23 16:12 zelva3

That's why it's recommended to use the recommended ratio of SDXL, which is good for results , and it is difficult to guarantee that the results are good for other ratios

As already mentioned in https://github.com/lllyasviel/Fooocus/discussions/984#discussioncomment-7610859, adding aspect ratios / resolutions, which SDXL has not been trained on, might produce (highly) distorted images and is likely to repeat objects (in short: will not produce good results). Also see https://github.com/lllyasviel/Fooocus/discussions/117#discussioncomment-7364981.

EDIT IMHO your changes might seem convenient, but users should use a resolution SDXL has been trained on to generate an image and then upscale using features included in Fooocus to get a result in high quality and resolution.

You can find the official resolutions here:

Height and Width: These parameters set the resolution of the image. SDXL 1.0 natively generates images best in 1024 x 1024. However, different aspect ratios may be used effectively.

The below settings for width and height are optimal for use on SDXL 1.0. Resolutions different from these may cause unintended cropping.

  • width: 1024 height: 1024
  • width: 1152 height: 896
  • width: 896 height: 1152
  • width: 1216 height: 832
  • width: 832 height: 1216
  • width: 1344 height: 768
  • width: 768 height: 1344
  • width: 1536 height: 640
  • width: 640 height: 1536 It is recommended that developers pre-select the ideal resolutions for users based on the intended use case. The below lookup can be used for guidance:

Fullscreen: 4:3 - 1152x896 Widescreen: 16:9 - 1344x768 Ultrawide: 21:9 - 1536x640 Mobile landscape: 3:2 - 1216x832 Square: 1:1 - 1024x1024 Mobile Portrait: 2:3 - 832x1216 Tall: 9:16 - 768x1344

Source: https://stability.ai/sdxl-aws-documentation

mashb1t avatar Dec 27 '23 16:12 mashb1t

I really really wish native 1080p generation would be possible in high quality out of the box though, don't get me wrong. We're just not (quite) there yet. Here are some examples with a car interior (not cherry-picked).

1344x768: Screenshot 2023-12-27 180738

1920x1080 Screenshot 2023-12-27 181138

What is your experience with these resolutions?

mashb1t avatar Dec 27 '23 17:12 mashb1t

Okay, I got it. Thanks for the insights, Manuel.

I got some good results with those resolutions, so I thought it was working fine, and I felt it would be extra work for the people who want to use it directly on social media.

Actually, I checked again with the results of the human body. As you mentioned, I'm getting distorted images even if I provide negative prompts. But it wasn't the case for nature, scenery, or non human things.

It would be great if we could use those resolutions for good results.

zelva3 avatar Dec 27 '23 18:12 zelva3

Yeah, let's wait for the next iteration on Stability AI models, which then hopefully allows high quality 1080p image generation for universal use cases. Please feel free to close this PR (for now).

mashb1t avatar Dec 28 '23 00:12 mashb1t

The width and height must be a multiple of 64, and the product of width and height could be around 1 million. So you can use 1024x768, but I think that 1152x896 is better.

siriume avatar Dec 28 '23 01:12 siriume

Yeah let's see. Thanks.

zelva3 avatar Dec 28 '23 04:12 zelva3

Hi

I just created a fork fooocus project version just synced with the original project in main branch https://github.com/MindOfMatter/Fooocus-MindOfMatter-Edition

I created a pr in my fork project to show what we need to change to enable the feature

https://github.com/MindOfMatter/Fooocus-MindOfMatter-Edition/pull/5

If you want to test it, you need to replace your fooocus local folder with mine (according to selected feature branch)

Also my dev branch contains all merged tested pr features in my fork project https://github.com/MindOfMatter/Fooocus-MindOfMatter-Edition/tree/dev

I hope that it could help you :)

Have a nice day

MindOfMatter avatar Jan 25 '24 22:01 MindOfMatter

Yeah, let's wait for the next iteration on Stability AI models, which then hopefully allows high quality 1080p image generation for universal use cases. Please feel free to close this PR (for now).

Hi. Ive been having this doubt in my head. I have trained dozens of human dreambooth lora models of people, with some fullbodies (usually datasets of mostly closeups and midshots, some fullbodies. I used 1024px width by 1280px height, which is 0.8 ratio compared to the 896x1152 sdxl ratio of 0.777. I cannot see any distortions in the gen's. Would you say there may be improvements of some sort, alghtough i dont see any issues?

rafstahelin avatar Feb 08 '24 15:02 rafstahelin

This all depends on if the model / lora you're using has been trained on this aspect ratio or not. SDXL doesn't include this aspect ratio in its training data. Feel free to manually add a custom resolution if the aspect ratio works for you.

mashb1t avatar Feb 08 '24 18:02 mashb1t

This all depends on if the model / lora you're using has been trained on this aspect ratio or not. SDXL doesn't include this aspect ratio in its training data. Feel free to manually add a custom resolution if the aspect ratio works for you.

Thanks

rafstahelin avatar Feb 08 '24 18:02 rafstahelin