Promptzone - AI community

Damon Who
Damon Who

Posted on

How to Add and Use LoRAs in Fooocus for Stable Diffusion

Since their introduction a few months ago, LoRAs (mini models for fine-tuning Stable Diffusion) have rapidly gained popularity. These models are now one of the key strengths of Stable Diffusion compared to other image generation AIs.

The extensive variety of LoRAs created and shared by the community allows users to easily generate images of specific characters, styles, or other concepts not included in the original training data.

What is Fooocus?

Fooocus screenshot github repo

Fooocus is a new interface for Stable Diffusion that offers a simplified, user-friendly experience for creating stunning images. It requires minimal technical knowledge and avoids complex settings. We detail the installation and usage of Fooocus in our introductory article.

Finding and Adding LoRAs

Where to Find LoRAs

The best resource for finding LoRAs is Civitai, a community sharing site where creators post their models, LoRAs, and prompts. Visit Civitai, click on "Models" at the top left, then use the filter to select "LoRA" to limit your search. Since Fooocus works exclusively with SDXL and its derived models, you can also check the "SDXL" box to find compatible LoRAs. Once you find a LoRA of interest, download it using the "Download" button on the right side of the LoRA page.

Placing the LoRA File

To add a LoRA to Fooocus, place the downloaded file in the /models/loras directory of your Fooocus installation. On Windows, Mac, or Linux, this directory is located on your hard drive where Fooocus is installed. Move the LoRA file (usually a .safetensor file) into this folder.

Adding LoRAs on Google Colab

If you are using the hosted version on Google Colab, follow the specific procedure for adding LoRAs in that environment.

Using a LoRA in Fooocus

Activating the LoRA

To activate one or more LoRAs in Fooocus, open the "Advanced" interface by checking the box of the same name at the bottom of the screen, below the prompt field. In the menu that appears on the right, select the "Model" tab. Under the "LoRAs" section, you can choose up to five LoRAs to use for image generation. If you don't see the newly added LoRA, click the "🔁 Refresh All Files" button at the bottom of the column to reload the list of available files.

All selected LoRAs will be used in the image generation process. Unlike using LoRAs in Automatic1111, there's no need to use special syntax in your prompt to utilize a LoRA. However, if the LoRA has specific activation keywords, you must include them in the prompt to properly activate the LoRA.

Adjusting LoRA Strength

For each of the five selectable LoRAs, you can set a weight to determine its influence on the image. The recommended weight generally varies between 0.5 and 1, but each LoRA is different and may have a different recommended strength. A weight too low will make the LoRA's influence imperceptible, while a weight too high will reduce the model's flexibility and degrade image quality. Check the LoRA's details or example prompts to get an idea of the appropriate weight, but you may need to experiment to find the best strength for your needs.

Examples of Using LoRAs in Fooocus

Tim Burton (Art Style)

A pixie fairy in a Tim Burton-inspired wonderland.

  • Prompt: "A pixie fairy in a Tim Burton-inspired wonderland. Around her, the landscape transforms into a surreal dreamscape, trees with twisted branches, each bearing glowing fruits. The pixies's eyes reflect the glow, holding a mixture of determination and curiosity, Tim Burton Style"
  • Without LoRA: Image 1
  • With LoRA (Various Weights): Images 2-6

Rorschach - Watchmen

Cinematic photo, Rorschach from the Watchmen, man with a hat, vintage ice cream store, holding an ice cream, 35mm photograph, film, bokeh, professional, 4k, highly detailed, Rorschach1024

  • Prompt: "Cinematic photo, Rorschach from the Watchmen, man with a hat, vintage ice cream store, holding an ice cream, 35mm photograph, film, bokeh, professional, 4k, highly detailed, Rorschach1024"
  • Without LoRA: Image 1
  • With LoRA (Various Weights): Images 2-6

SDXL Enhancer

Full-bodied portrait, cute and adorable cartoon white rabbit baby wearing a gold jaguar print hoodie and silver sunglasses, fantasy, dreamlike, surrealism, super cute

  • Prompt: "Full-bodied portrait, cute and adorable cartoon white rabbit baby wearing a gold jaguar print hoodie and silver sunglasses, fantasy, dreamlike, surrealism, super cute"
  • Without LoRA: Image 1
  • With LoRA (Various Weights): Images 2-6

As you can see, using LoRAs with Fooocus is both simple and powerful. These mini-models allow you to easily alter generated images to incorporate specific styles, characters, or interesting visual effects. Each LoRA is unique, and you will need to experiment to understand its potential fully. The weight used significantly impacts the result and can either enhance or ruin the image quality.

I hope this article has inspired you to try LoRAs with Fooocus to create new images. If so, feel free to join us on X and share your creations!

Top comments (0)