Add Custom Image Aspect Ratios and Resolutions in Fooocus

Introduction
Hello there and welcome!
In this video, I’m going to walk you through the quick and easy way, to add ANY custom image aspect ratio and resolution, to Fooocus.
The most popular aspect ratio that’s missing, from the default install of Fooocus, is the 1920 by 1080 resolution, for a 16:9 widescreen aspect ratio.
I’ll also run through, how to specify WHICH aspect ratio is auto selected as default, when you launch Fooocus.
I’ll be running through everything, on a standard local install of Fooocus, running on my Windows 11 PC.
So, let’s crack on.
Fooocus Config File
We need to edit the Fooocus “config dot text” file, and specify any changes to resolutions that we want.
We’ll navigate to our Fooocus installation folder.
In my case, it’s in my E drive, and then my Fooocus folder.
Then we’ll open the main Fooocus install folder in there.
We’ll see a whole bunch of folders and files, that Fooocus needs to run.
We’ll scroll down the list, and find the main “config dot text” file.
BEFORE making ANY changes to this file, it’s important that we first create a backup of it, so that if things go wrong, and they easily do, we can always roll back to the original.
We’ll select the “config dot text” file, then copy and paste it.
I’ll rename the backup file “config dash BU”, for backup.
OK, now we double-click the ORIGINAL “config dot bat” file, to open it in Notepad.
Let’s turn off spell checking, so we can clearly see the syntax.
Right-click on a red underlined word, then “Spelling”, then “Turn off spell check”.
The default install config file, comes with just a bunch of custom paths at the top. We’ll leave these as they are.
Below this, we’ll need to add in some additional syntax, to specify our new custom resolution, and then set it as the new default.
If that all sounds a bit techy and complicated, then the good news is, that Fooocus also comes with a config modification tutorial file, that has a bunch of done for you syntax blocks already written, that you just need to copy and paste over, to the main config file.
So let’s keep things simple, and do just that.
Fooocus Config Modification Tutorial File
We’ll go back to our folders and files in the Fooocus folder.
Find the “config modification tutorial” dot text file.
Then we’ll double-click this file, to open it in Notepad.
Again, let’s turn off spell checking.
If we scroll down through the file, we can see all sorts of useful syntax blocks, that we can just easily copy and paste over to the main config file, to adjust settings in Fooocus when it runs.
As you use Fooocus more and more, you’ll probably want to make changes to the default settings, that are probably already contained in here, so it’s worth taking a few minutes, to scroll through and see what setting changes are available, and already done for you.
Add Custom 1920×1080 Resolution / 16:9 Aspect Ratio
Let’s first copy over the syntax to the main config file, that we need to then edit to finish adding our new 1920 by 1080 resolution.
In the “config modification tutorial” file, we’ll scroll down to find the list of resolutions.
Then we’ll select the syntax for the resolutions, and we’ll also grab the syntax for the default resolution, as shown on the screen.
Make sure to INCLUDE the comma from the previous line at the start, but DON’T include the comma at the end.
Then we’ll copy the selected syntax.
We’ll switch back to the main config file.
Place our cursor directly at the end of the last line of syntax, and then paste in the copied syntax.
Make sure the final syntax is the same as shown on the screen.
Let’s save the main config file.
Now let’s add our 1920 by 1080 resolution to the end of the list.
In the main config file, we’ll copy the last “1728 by 576” resolution in the list, making sure to INCLUDE the comma from the line above.
Then place our cursor at the end of the last resolution line, and paste in our copied syntax.
Make sure the final syntax is the same as shown on the screen.
Now we’ll just change the last pasted resolution from “1728 by 576” to “1920 by 1080”.
Then save the file.
OK. Done.
Now the 1920 by 1080, 16:9 aspect ratio, will be available for selection, when we run Fooocus.
As easy as that.
Make New Custom Aspect Ratio the Default
Making our new 1920 by 1080 resolution selected by default, when we launch Fooocus, is even easier.
We’ll scroll down to the bottom of the main config file.
We previously pasted in the last line, “default_aspect_ratio”, which we can see is currently set to a resolution of “1152 by 896”.
Let’s change this to “1920 by 1080”.
OK. Done. Easy. Save the file.
Now when we launch Fooocus, not only will the 1920 by 1080, 16:9 widescreen aspect ratio be available, but it will also be pre-selected as the default resolution.
Test Custom Widescreen Resolution and Aspect Ratio
Let’s have a quick check to make sure that everything works correctly.
Launch Fooocus.
Keep an eye on the Command Prompt window for any error messages.
A common error that’s made when editing the main config file, is either NOT adding a comma at the start of the syntax, or ADDING an unnecessary one at the end.
If no error messages are shown in the Command Prompt window, and Fooocus opens in our browser, then things are looking good so far.
We’ll tick the “Advanced” checkbox, below the prompt box, to display the aspect ratios section.
We can already see that our custom 1920 by 1080, 16:9 aspect ratio, has been selected as the default.
If we expand the Aspect Ratios section, and scroll to the bottom, we can see that our custom aspect ratio is shown in there, for selection as well.
OK. All good. Job done.
If you wanted to have your custom aspect ratio at the top of the list, instead of at the bottom, all you need to do is add it at the top of the list in your main config file, instead of at the bottom, like we just did.
Also, if you wanted to remove some of the resolutions, that you never use, to streamline the list in the UI, then just delete them from the list in the main config file.
Conclusion
Now you know how to quickly and easily, add ANY custom image aspect ratio and resolution you may want to Fooocus.
You also now know how to make ANY aspect ratio and resolution, auto selected as default, when you launch Fooocus.
Anyway, hope you found this video helpful, and I’ll catch you in the next one.
None.