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
Ce mois-ci, comme je l'ai indiqué la dernière fois, nous allons nous pencher sur Fooocus et plus particulièrement sur les problèmes d'installation du programme. Une fois que j'aurai expliqué les problèmes que j'ai rencontrés, et les solutions de contournement, je vous donnerai un aperçu de ce qu'il est possible de faire avec ce programme facile à utiliser.
L'installation de Fooocus peut être plus difficile sous Linux. Il s'est installé correctement sur Kubuntu 23.10, mais la mise à jour vers la 24.04 l'a empêché de fonctionner. Il n'a pas fonctionné non plus sur une installation propre (Ubuntu également), et d'autres ont eu un problème similaire. Peut-être cela sera-t-il corrigé à l'avenir mais, à moins que vous ne retourniez à MS Windows qui a un seul fichier d'installation à télécharger, vous voudrez peut-être trouver temporairement une autre distribution Linux. J'ai finalement installé Mint Linux qui peut créer ses propres problèmes, mais qui fonctionne avec Fooocus, et, sans aucun doute, d'autres distributions fonctionneront également.
Pour installer Fooocus, Github (https://github.com/lllyasviel/Fooocus) fournit une variété d'options. J'ai utilisé la version Python Venv - simplement parce qu'elle avait déjà fonctionné. (Python3 est requis.) Après avoir ouvert votre terminal, vous devez taper et exécuter séquentiellement chacune des commandes suivantes (ce sont les conditions d'installation qui ont causé mes problèmes précédents) :
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.
Au cours de l'installation, vous constaterez peut-être que certains paquets ne sont pas disponibles sur votre système d'exploitation, mais un code permettant d'installer ce qui est nécessaire sera suggéré. Le processus peut être long car il télécharge également une variété de fichiers Nvidia. Un minimum de 4 Go de mémoire vidéo est nécessaire, mais il est souhaitable d'en avoir plus. (Pour les cartes vidéo AMD, des instructions supplémentaires sont fournies.) Une fois le téléchargement terminé, vous devrez créer un fichier de lancement dans le dossier Fooocus. Vous pouvez le faire en créant un fichier nommé focus.sh en utilisant nano dans le terminal, ou Kate, ou tout autre éditeur approprié, avec les deux lignes suivantes :
source fooocus_env/bin/activate
python entry_with_update.py
Une fois créé, vous devez rendre le fichier exécutable en tapant dans le terminal :
sudo chmod +x focus.sh
Vous pouvez également le modifier en faisant un clic droit sur le fichier focus.sh, en allant dans les propriétés, en sélectionnant l'onglet permissions et en cochant la case exécuter.
Enfin, vous pouvez lancer Fooocus dans le terminal en exécutant :
./focus.sh
Cela devrait ouvrir le programme dans le navigateur par défaut.
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.)
Lorsque vous commencez à charger Fooocus, vous verrez probablement un message d'erreur suggérant que vous utilisez une ancienne version de Gradio. (Au bas de la fenêtre de l'interface de Fooocus, vous verrez une référence à « Built with Gradio »). Ne mettez pas à jour Gradio, il a besoin d'utiliser la version précédemment installée. Il peut également avoir besoin de quelques fichiers supplémentaires et certains spécifiquement pour votre carte graphique - qu'il commencera à télécharger. (Cela peut nécessiter un redémarrage.) Le téléchargement du modèle JuggernaultXL.safesensor, qui pèse plus de 7 Go, fait également partie du processus. Un autre problème que vous pouvez rencontrer est que, lorsque vous commencez à générer des images, le logiciel attend de démarrer. Parfois, il télécharge des fichiers supplémentaires et ce téléchargement doit être terminé avant que la génération de fichiers ne commence. Le redémarrage de Fooocus peut résoudre ce problème et, en règle générale, le redémarrage du système d'exploitation résout la plupart des problèmes avec les différentes versions de Stable Diffusion que j'ai utilisées.
Ce qui précède répond à certains problèmes, mais j'ai pensé qu'il fallait aussi laisser au lecteur un exemple de ce qu'il est possible de faire après l'installation. Tout d'abord, j'ai créé une image d'Hilary Clinton en utilisant simplement son nom. Le résultat est affiché dans le journal historique (si la case Advanced est cochée, sélectionnez le journal de l'historique en bas à droite).
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.
Vous remarquerez que l'invite de deux mots a été considérablement élargie par Fooocus. Dans Fooocus, lorsque la case Input Image (image d'entrée) est cochée, vous pouvez faire glisser la sortie originale dans la zone d'invite d'image en sélectionnant d'abord cet onglet. Notez que certains navigateurs ne semblent pas autoriser cette fonction, mais vous pouvez d'abord enregistrer la sortie, puis cliquer pour télécharger cette même image. Une fois le fichier sélectionné, vous pouvez choisir l'option FaceSwap.
Vous pouvez alors modifier l'invite comme suit : Middle age woman as warrior in battle dress (Femme d'âge moyen en tenue de guerre)
Générez ensuite l'image, et vous obtiendrez peut-être quelque chose de similaire à ce qui est illustré.
La prochaine fois, nous continuerons avec Fooocus. Nous installerons et utiliserons également DeFooocus, une version modifiée. Comme il s'agit d'une version modifiée et essentiellement la même, les exemples seront essentiellement pertinents pour les deux. Vous pourrez alors décider quelle version vous convient le mieux.