Fooocus Tutorial: Simplified Stable Diffusion

is a product based onA free and open source artificial intelligence image generator. It attempts to combine Stable Diffusion andAdvantages: open source, offline, free, and easy to use. Fooocus optimizes the Stable Diffusion pipeline to deliver outstanding images. You can spend less time adjusting settings and more time creating the image you want.

In this article we will introduce

  • Fooocus pros and cons
  • How to install Fooocus
  • Basic usage
  • Set style
  • upgrade
  • repair and restoration
  • Use image prompts

Fooocus pros and cons

Fooocus advantages:

  • Focused on image optimization: Fooocus focuses on providing the best image optimization, which uses various techniques to reduce image file size while maintaining high quality.
  • Multiple optimization options: Fooocus offers a wide range of optimization options, including lossy and lossless compression, resizing, cropping, and watermarking.
  • Batch Optimization: Fooocus allows users to optimize multiple images in batches, saving time and increasing efficiency.
  • Easy to use: Fooocus has a user-friendly interface that even a beginner can use easily.
  • Optimized for web and mobile: Fooocus is optimized for web and mobile, ensuring images load quickly on all devices.
  • Supports various image formats: Fooocus supports various image formats, including JPEG, PNG, GIF, and WebP.
  • Cloud Hosting: Fooocus is a cloud-hosted service, so users don’t need to install or maintain any software.

Fooocus Disadvantages:

  • Requires payment: Fooocus is a paid service, although it offers a free trial.
  • Limited image editing features: Fooocus mainly focuses on image optimization and does not offer advanced image editing features.
  • Depends on Internet connection: Since Fooocus is a cloud-hosted service, it requires a stable Internet connection to use.
  • Slight loss of image quality: In some cases, lossy compression may result in a slight loss of image quality.
  • Technical issues sometimes occur: Like any cloud service, Fooocus may occasionally encounter technical issues.

How to install Fooocus

Minimum system requirements

You need an Nvidia card with 8GB VRAM. Other settings may also be valid.See minimum requirementscomplete list.

Windows

Please follow the steps below to install Fooocus on Windows.

  1. on this pageDownload the zip file.
  2. Place the zip file into the folder where you want to install Fooocus
  3. Right click on the zip file and selectExtract all…to extract the file.
Fooocus教程:简化版 Stable Diffusion-1

double clickrun.batStart Fooocus.

It will download the model the first time you run it.

AMD GPU, Mac, Linux and Colab

You can also use AMD GPU,Mac,LinuxandColabInstall Fooocus on .

Using Fooocus

Fooocus is super easy to use. In default mode, you enter the prompt and press"generate". (Ctrl+Enter on Windows. Cmd+Enter on Mac)

a dragon, snow, moon

Fooocus教程:简化版 Stable Diffusion-2

It uses the default model, which isjuggernautXL, a fine-tunedStable Diffusion XLModel. It is a universal model capable of producing a variety of styles.

quick reminder words

You don't need to write long and complicated prompts like on popular image sharing sites. Fooocus will use a GPT-2 based prompt engineExpand your tips.

For example prompt:

dragon, snow, moon

a dragon, snow, moon

Under the hood expands into the following tips.

dragon, snow, moon, light, intricate, elegant, sharp focus, beautiful dynamic, highly detailed, very stylish, professional fine detail, cinematic, dramatic environment bright colors, perfect, warm colors, epic composition , striking, brave, attractive, elite, best, vivid, clear, coherent, advanced, creative, cute, artistic, stylish, cool, gorgeous, awesome

a dragon, snow, moon, light, intricate, elegant, sharp focus, beautiful dynamic, highly detailed, very sleek, professional fine detail, cinematic, dramatic ambient bright colors, perfect, warm color, epic composition, striking, brave, attractive, elite, best, vivid, clear, coherent, advanced, creative, cute, artistic, trendy, cool, gorgeous, awesome

advanced settings

chooseadvancedCheckbox will display the advanced settings menu.

Fooocus教程:简化版 Stable Diffusion-3

Performance settings

True to its design philosophy, even the advanced settings are easy to understand.

Performancepart.

  • speed: Well balanced, performs 30 sampling steps.
  • quality: Perform twice as many sampling steps.
  • Extreme speed:useLCMLoRAReduce sampling steps.

As expected from the setup,speedandqualitynot much differences. For the SDXL model, there are diminishing returns for performing more than 30 steps.

Extreme speedSettings produce lower quality images. This is expected from the LCM-LoRA model.

Below is a comparison of build times on a Windows system using an RTX4090 GPU card.

speed17.3 seconds (1x)
quality25.2 seconds (1.5x)
Extreme speed10.4 seconds (0.6x)
Time to generate two 1024×1024 images.

I like the ease of use of LCM-LoRA (extremely fast). exist Using LCM-LoRA requires changing the CFG scale and sampling steps. And it's easy to forget. Fooocus solves all these problems with one choice.

aspect ratio

Fooocus provides an extensive list of image sizes for you to choose from. Interestingly, there is no way to enter the image size in the GUI.

Fooocus教程:简化版 Stable Diffusion-7

There are many reasons why you might want to use a specific image size, such as compatibility with stable diffusion models and publishing requirements.

To add an image resolution to the list, go toFind the Fooocus folder namedconfig_modification_tutorial.txtdocument.

Fooocus教程:简化版 Stable Diffusion-8

This is the configuration file config.txttemplate.

config.txtRename toconfig.txt.original.

Copy filesconfig_modification_tutorial.txtand rename it toconfig.txt.

Edit in a text editorconfig.txt (I use Notepad++).

Remove the explanatory note at the top.

Add new resolutions to the "available_aspect_ratios" list. For example:

"available_aspect_ratios": [ "704*1408", "704*1344", "768*1344", "768*1280", "832*1216", "832*1152", "896*1152", "896* 1088", "960*1088", "960*1024", "1024*1024", "1024*960", "1088*960", "1088*896", "1152*896", "1152*832" , "1200*800", "1216*832", "1280*768", "1344*768", "1344*704", "1408*704", "1472*704", "1536*640", " 1600*640", "1664*576", "1728*576" ],

Restart Fooocus and you should see the new resolution added.

Fooocus教程:简化版 Stable Diffusion-9

style

In Fooocus you don't needdesign tipsto achieve a certain style. You can get there using the Style menu.

There are so many preset styles!You can find the SDXL style guideMany of these can be seen visually in .

Fooocus教程:简化版 Stable Diffusion-10

You can combine multiple styles. But many of them only work when the default style is unchecked.

You can also addnegative reminderto dial in the image. For example, add "Black and White" to Negative Prompts (in Settings > Negative Prompts) to produce a color image.

Model

You can"Model"specified in the tabCheckpoint modelandLoRa.

The path to the model can be found in the Fooocus folderfound or changed in config.txt.

Upgrade images

To upgrade images in Fooocus:

  1. chooseinput imagecheckbox.
  2. exist"Premium" or "Variation", select the desiredPremium options.
  3. according togenerate.
Fooocus教程:简化版 Stable Diffusion-16

Image changes

Like Midjourney's V1/V2/V3/V4 functionality, you can generate variations of an image.

  1. chooseinput imagecheckbox.
  2. exist"upgrade" or "change", select the desired"Change" option.
  3. according togenerate.
Fooocus教程:简化版 Stable Diffusion-17

Here are the "subtle changes"and"Changes are strong"changes in options. They don't have that many.

NOTE: You can use additional seeds from AUTOMATIC1111Option to create image variations.

Picture tips

You can use images as additional prompts,For example AUTOMATIC1111. But unlike AUTOMATIC1111, you don't need to install extensions. It is part of the basic functionality of Fooocus.

To use image prompts, checkinput imagecheckbox and selectImage promptTab.

Upload the image to one of the image slots.

You may want to check theAdvanced checkbox to enable editing more settings.

Image prompt

The default image prompt options areImagePrompt.

Fooocus教程:简化版 Stable Diffusion-21

If you have used in AUTOMATIC1111ControlNet , these settings should look familiar.

  • stop at: Stop the image prompt control at certain sampling steps. 0.5 means 30 sampling steps, stopping after 15 steps.
  • Weights: The strength of the image prompt control.

Adding any of these can enhance the effect of the image cue.

Use suggestions:

a chair that resembles a cat

Change weights in image hints

Pilar Canni

PyraCannyIt is a Canny edge control method based on pyramid. The high resolution of SDXL images may cause the standard Canny algorithm to miss some details. This method detects edges hierarchically at multiple resolutions.

Like Canny ControlNetAlso use PyraCanny to replicate compositions or human poses.

quickly:

A woman

Upload image and select PyraCanny.

Fooocus教程:简化版 Stable Diffusion-25

CPDS

CPDSIt is a depth-based structure detection method. It copies the 3D composition of the image, but not the lines. andDepth ControlNetLike, it changes the image more.

See the CPDS example below. It replicates the composition, but not the facial details such as the hairstyle and the direction she is looking.

Face changing

Face Swap is like in ControlNetIP AdapterFace. It copies the face in the reference image.

Here is an example. This tip is:

a woman, praying

Multiple image prompts

ControlNet in AUTOMATIC1111Likewise, you can use multiple image cues in Fooocus.

Let's use one using two image promptsExample to illustrate:

  • FaceSwap – Weight 0.5, stop at 0.9: copy the face.
  • PyraCanny – Weight 0.5, stop at 0.5: copy the pose.
Fooocus教程:简化版 Stable Diffusion-31
Fooocus教程:简化版 Stable Diffusion-32

When using multiple image cues, you usually want to set the weight lower. Otherwise, you may see artifacts such as strange colors.

PyraCannyDoes a great job of replicating poses. The lower weight and stop make the control looser. It helps generate different contexts.

FaceSwapDoes a great job of replicating faces. You can get stronger results by adding weight and stopping.

repair

repairPart of the input image will be regenerated. In Fooocus it's easy.

examineinput imageand selectRepair or fix.

Upload the image you want to repair.

Use the Brush Tool to mask the areas you want to regenerate.

Fooocus教程:简化版 Stable Diffusion-33

This is a result.

ImprovedetailThe method leaves the input image more or less the same but improves fine details.

RevisecontentMethod allows you to modify the masked area via prompts. It is similar to restoration with high denoising strength.

Additional tips for fixing:

a woman with sunglasses

extra screen

extra screenExpand the image in one or more directions.

examineinput imageand selectRepair or fix.

Upload the image you want to repair.

exist"method"From the drop-down menu, select"Repair" or "Repair" (default).

Select requiredOutpaint Direction.

Fooocus教程:简化版 Stable Diffusion-38

Below is an example of drawing an image horizontally.

Fooocus教程:简化版 Stable Diffusion-34
Fooocus教程:简化版 Stable Diffusion-39

describe

input imagemiddledescribeThe function guesses the hint for the image. It is similar to the ask CLIP button in AUTOMATIC1111.

Upload image to"describe"tab canvas and press"Describe this image in prompt".

Guess hints will appear in the hint input box.

Fooocus教程:简化版 Stable Diffusion-40

Share model with AUTOMATIC1111

If you have installedAUTOMATIC1111or other stable diffusion GUIs, you may want to share models between them to save disk space.

This can be done by editing theconfig.txt file to complete.At the top of the file you can modify "path_checkpoints", "path_loras", etc. to point to the existing location of the model.

Alternatives to Fooocus

You can consider the following alternatives:

  • AUTOMATIC1111: Stable diffusion GUI with the most functions. de facto standard.
  • SD.Next:AUTOMATIC1111ofA more curated version. Many are pre-installedA must-have extension.
  • ComfyUI: Stable node-based diffusion GUI. The learning curve is a bit steep, but understanding it goes a long way.

Fooocus and Midjourney

Midjourneyis a popular and proprietary artificial intelligence image generator. You can use stable diffusion tocopyMany features in Midway.

Fooocus is designed toMidjourney ofalternatives. If you like the simplicity of MidJourney, you might also like Fooocus. Midjourney is a image generator. I would say Fooocus has a better user interface.

See between Fooocus and MidjourneyFunction comparison.

Thoughts on Fooocus

I'm Stable Diffusion, Midjourney andregular users. I've always admired the infinite adjustability of the Stable Diffusion, the quality of the mid-range, and how accurately DALLE followed prompts.

Fooocus fills the gap in simplicity and ease of use.

Sometimes I'm reluctant to use Midjourney because of the hassle of dealing with the Discord interface. Adjusting the prompts and settings is a bit difficult.

Fooocus attempts to provide a middle-of-the-road experience with the added advantage of running locally, being uncensored and free. As a bonus, it has a well-designed GUI!

I'll use Fooocus to quickly get high-quality images, such as the cover image for this post.

5/5 - (1 vote)

Leave a Reply

Your email address will not be published. Required fields are marked *