Install Automatic1111 or Forge in Fedora using Anaconda
Written on the 3rd of May, 2024.
Preamble
I wrote these instructions primarily for myself so that I can set things back up in case a hard-drive breaks... which totally didn't happen to me. So it's not exactly noob-friendly, but I figured there's no reason not to share it. I performed all of this in Fedora 40 but I don't see any reason you wouldn't be able to do this in any Linux-based distro, as it uses Anaconda to set up the environment which is platform independent. Most distro-specific stuff is related to your GPU drivers anyway which this guide assumes you've already got set up and running.
The reason I use conda
is that it's completely separate from the system and is the only way I got this up and running inside of Fedora (there are no Fedora-specific instructions for any AUTOMATIC1111 workflows as of writing). Fedora does offer a python3.10
package along with its libraries but I haven't figured out why it doesn't include Python3.10 versions of any static packages required for AUTOMATIC1111 to run.
Prerequisites
Nvidia GPU. This guide does not cover AMD or Intel GPUs. Ensure that the Nvidia drivers and the Nvidia CUDA drivers are installed. This will vary greatly depending on your distribution.
Install the prerequisites:
For other distros: https://github.com/AUTOMATIC1111/stable-diffusion-webui?tab=readme-ov-file#automatic-installation-on-linux (follow "Installing dependencies" step) and https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
If trying this on a distro other than Fedora, this is where you would install Python3.10 and then create the venv or run export PYTHON=/bin/python3.10
and skip ahead to "Run the Installer". If you are on Fedora continue reading.
Setting up conda
We will use conda
to make a static, portable python environment. I'll be using a folder in ~/Applications/AUTOMATIC1111-Forge
but feel free to use whatever path you want. Create a file named environment.yaml
containing the following:
In case you messed up and need to recreate the environment, run conda env remove -n forge
and try again.
Open a terminal, cd
to the directory of environment.yaml
and then run:
Wait a while for this to complete. Then:
You'll notice that makes (forge)
appear to the left of the input line in your terminal.
Run the installer
If you haven't already, clone the repository to your drive. git clone https://github.com/lllyasviel/stable-diffusion-webui-forge
. Replace this URL with the regular https://github.com/AUTOMATIC1111/stable-diffusion-webui
if you're installing that instead.
If you already have your models, move them to stable-diffusion-webui/models/Stable-diffusion/
now to avoid redownloading the default one.
cd
to the stable-diffusion-webui
directory and run ./webui.sh --xformers
Everything should be automatically installed. This may take several hours to download and install everything. Once done, navigate to http://127.0.0.1:7860 in your web browser. Ctrl+C in your terminal to close the program, and conda deactivate
to leave the conda
environment. Or just close the terminal window.
Set up the menu shortcut
To launch Forge from the start menu, create a file at /home/you/Applications/AUTOMATIC1111-Forge/AUTOMATIC1111-Forge.sh
that contains the following (adjusting paths as necessary):
Ensure that AUTOMATIC1111-Forge.sh
is set as executable.
Create the desktop file to launch the program. I use KDE's Menu editor to create a shortcut with the following fields, though the only required field is the work path being set to where webui.sh
is /home/you/Applications/AUTOMATIC1111-Forge/stable-diffusion-webui-forge/
. Everything else left to its default/blank.
Name: AUTOMATIC1111 Forge
Description: SD Model WebUI
Comment: An extensible webUI for image generation and altering with Stable Diffusion. Forge is a fork with improved memory management and speed.
Program: /home/you/Applications/AUTOMATIC1111-Forge/AUTOMATIC1111-Forge.sh
Work path: /home/you/Applications/AUTOMATIC1111-Forge/stable-diffusion-webui-forge/
Run in terminal: Checked