Outils pour utilisateurs

Outils du site


issue207:stable_diffusion

Ceci est une ancienne révision du document !


This month, as noted last time, we will take a look at Fooocus, specifically looking at issues installing the program. Once I explain the issues I experienced, and workarounds, I will give you a quick taste of what can be done with this easy-to-use program.

Installation of Fooocus can be more demanding on Linux. It installed correctly on 23.10 Kubuntu, but updating to 24.04 stopped it from working. It wouldn't work on a clean install either (Ubuntu as well), and others have had a similar issue. Perhaps it will be fixed in the future but, unless you go back to MS Windows which has a single installation file to download, you may want to temporarily find a different Linux distribution. I eventually installed Mint Linux which can create its own issues, but it does work with Fooocus, and, no doubt, other distributions will also work.

To install Fooocus, Github (https://github.com/lllyasviel/Fooocus) provides a variety of options. I used the Python Venv version – simply because it had worked previously. (Python3 is required.) After opening your terminal, you will sequentially type and run each of the following commands (it was the install requirements which caused my previous problems):

git clone https://github.com/lllyasviel/Fooocus.git

cd Fooocus

python3 -m venv fooocus_env

source fooocus_env/bin/activate

pip install -r requirements_versions.txt

During installation. you may find that various packages are not available on your OS, but code to install what is needed will be suggested. It can be a lengthy process as it will also download a variety of Nvidia files, a minimum of 4GB of video ram is required, but more is desirable. (For AMD video cards, additional instructions are provided.) When that has completed, you will want to create a launch file in the Fooocus folder. You can do this by creating a file named focus.sh using nano within the terminal, or Kate, or any suitable editor, with the following two lines:

source fooocus_env/bin/activate

python entry_with_update.py

Once created, you need to make the file executable by typing in the terminal:

sudo chmod +x focus.sh

Alternatively, you can modify it by right-clicking on the focus.sh file, going into properties, selecting the permissions tab, and selecting the execute checkbox.

Finally, you can start Fooocus in the terminal by running:

./focus.sh

This should open the program in the default browser.

When you first start loading Fooocus, you will likely see an error message suggesting you are running an older version of Gradio. (At the bottom of the Fooocus interface window you will see a reference to ‘Built with Gradio’.) Do not upgrade Gradio, it needs to use the previously installed version. It may also need some additional files, and some specifically for your graphics card – which it will start downloading. (That may require a reboot.) Also part of the process will be a download of the JuggernaultXL.safesensor model, which is over 7 GB. Another issue you may experience is that, when initially starting to generate images, the software is waiting to start. Sometimes it will be downloading additional files and that must finish before file generation starts. Or restarting Fooocus may solve that problem, and, as a general rule, restarting the Operating System solves most issues with the various versions of Stable Diffusion I have used.

The above answers some problems, but I thought I should also leave the reader with an example of what you can do after installation. First, I created an image of Hilary Clinton by simply using her name. The result is shown as the output seen in the History Log (with the Advanced checkbox checked, select the History Log on the lower right.)

You will notice the two word prompt was expanded significantly by Fooocus. In Fooocus, with the Image Input checkbox selected, you can drag the original output into the Image Prompt area by first selecting that Tab. Note that some browsers don’t seem to allow that function, but you can save the output first and then Click to Upload that same image. Once the file has been selected, you can select the FaceSwap option.

You can then modify the prompt as: Middle age woman as warrior in battle dress

Then generate the image, and you might get something similar to what is shown.

Next time we will continue with Fooocus. We will also install and use DeFooocus, a modified version. Because it is modified and essentially the same, the examples will mostly be relevant to both. You can then decide which version works best for you.

issue207/stable_diffusion.1722068542.txt.gz · Dernière modification : 2024/07/27 10:22 de auntiee