With the debut of Stable Diffusion back in 2022, it became possible to generate images using AI for free. This tool lets you create high-quality photorealistic images using image and text prompts. Compared to other image-generating AI tools like Midjourney, Stable Diffusion can produce more realistic images.

However, using Stable Diffusion can be a bit tricky, especially if you have never used an AI tool before. Setting it up is complicated, and as with other online image generators, it keeps a record of how you use the tool and usually limits the type of images you can create.

That's where Fooocus comes into the picture. This AI image-generating tool based on Stable Diffusion is a free and open-source alternative that you can use offline and is much easier to use. What's more, you can install and run it on both Windows and Linux systems and start generating images right from the get-go. Let's see how you can achieve this.

Minimum Requirements

To run Fooocus on your system, it should meet the minimum requirements for the AI image-generating tool.

  1. Your PC should have at least 24 GB of free space if you want to install the realistic and general-purpose model, which is recommended. The minimum amount of RAM you need is 8 GB.
  2. It should also have a dedicated 4GB graphics card, preferably an Nvidia one, though it should also work with AMD GPUs. Currently, Fooocus has not been officially tested on Intel GPUs.
  3. For Windows machines, Microsoft's Virtual Swap technique is another requirement, but it is installed by default when you install Windows.

If your system meets these requirements, you can start downloading Fooocus.

Download and Extract Fooocus

The first thing you need to do before you can start using Fooocus on your PC is to download it from its GitHub page.

  1. If you are using a Windows machine, visit developer Illyasviel’s GitHub page, and scroll down to the 'Download' section.
  1. Click on the 'Click here to download' option to start downloading the application.
  1. The file is 1.8 GB in size, so wait until it finishes downloading. If you want to install Fooocus where it is downloaded, you can do so or else move the downloaded folder to another location.
  2. Now you need to extract the contents of the folder. Right-click on the folder and click on the 'Extract Here' option. Windows can extract it directly, but we recommend using 7-zip to extract it since the process is much faster.
  1. Once the extraction is complete, you will get three .bat files. These include the 'run.bat' file for the generic model, the 'run_anime.bat' file for the anime-tuned model, and the 'run_realistic.bat' file for the realistic model.

Install Fooocus

Now, it is time to install the different Fooocus models in your system so you can use them.

  1. Double-click on any of the .bat files to download and install that model on your PC. It is a good idea to start with the generic 'run.bat' file.
  1. A Command Prompt window will open and start downloading and installing the Fooocus model. The process will depend on your internet speed and can take some time.
  1. You will have to follow the same process for the other two models also since they require different models.
  1. The above steps should work fine if you have an Nvidia GPU, but for AMD you will need to edit the .bat files. Right-click on the .bat file and click on the 'Edit in Notepad' option.
  1. This will open the file in Notepad. Now paste the following text into the file and save it.
.\python_embeded\python.exe -m pip uninstall torch torchvision torchaudio torchtext functorch xformers -y
.\python_embeded\python.exe -m pip install torch-directml
.\python_embeded\python.exe -s Fooocus\entry_with_update.py --directml
  1. Double-click and run the .bat file and it should download the additional components needed to run Fooocus on AMD computers.
  1. For the .bat_anime file, add .\python_embeded\python.exe entry_with_update.py --directml --preset anime using Notepad and for the .bat_realistic file, add .\python_embeded\python.exe entry_with_update.py --directml --preset realistic.
  2. Once all the libraries and components are downloaded, a new browser window will open containing the Fooocus interface.

Generate Images Using Fooocus

Fooocus is now installed on your machine, and now you can easily generate images using the AI tool by giving it prompts.

  1. The Fooocus interface will open on its own in a new browser window, but you can access it using the http://localhost:7865 address.
  1. The Fooocus interface includes an image preview section, below which lies the prompt box. You can also use images as prompts using the 'Input Image' button or use advanced features using the 'Advanced' button. The 'Generate' button lies on the right, which you can click on after giving Fooocus a prompt.
  1. To use Fooocus enter a prompt in the prompt box, such as a cute dog and click on the 'Generate' button.
  1. When you use Fooocus to generate an image for the first time, it will take some time. The generated image will appear in the 'Image Preview' section.
AI-Generated Image Of A Cute Dog. Source: Fooocus.cc
  1. For anime and realistic variations, use the respective .bat files. Or try out different styles, settings, and models by checking the 'Advanced' option, which will give you several options.
    These include adjusting the lighting, aspect ratio, generation speed, and even the use of negative prompts.
Note: Fooocus creates a pair of images by default and stores them in folders, which it organizes by day. Images have a photorealistic quality to them and do not require adding effects, like depth effects and others.

If you are looking for an AI-image generation software that you can use offline, is completely free, and offers greater freedom regarding what you want to create, Fooocus is the answer. It meets all these criteria, and you can even use it with certain plugins.

The images Fooocus generates are also quite impressive, often turning out to be better than what Midjourney or Dall-E come up with. The only caveat is that you need a pretty powerful PC to use it, which means you may need to upgrade if you plan to use it.