Compare commits
4 Commits
82d108fee6
...
61969a2c7a
| Author | SHA1 | Date |
|---|---|---|
|
|
61969a2c7a | |
|
|
07c6c89edf | |
|
|
7899261755 | |
|
|
91c58b172c |
|
|
@ -23,7 +23,7 @@ RUN chown -R user:user /content
|
|||
WORKDIR /content
|
||||
USER user
|
||||
|
||||
COPY . /content/app
|
||||
COPY --chown=user:user . /content/app
|
||||
RUN mv /content/app/models /content/app/models.org
|
||||
|
||||
CMD [ "sh", "-c", "/content/entrypoint.sh ${CMDARGS}" ]
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
# 💬 [lllyasviel Fooocus](https://github.com/lllyasviel/Fooocus) on AMD ROCm 📷
|
||||
- Make sure that your system was fresh (ubuntu 22.04)
|
||||
- Computer will restart during the AMD driver install.
|
||||
- Prepare AMD ROCm Driver install
|
||||
```
|
||||
sudo usermod -a -G render,video $LOGNAME
|
||||
wget https://raw.githubusercontent.com/lllyasviel/Fooocus/main/AMD/amd_drivers.sh
|
||||
sudo chmod 777 amd_drivers.sh
|
||||
sudo ./amd_drivers.sh
|
||||
```
|
||||
- For RDNA and RDNA 2 cards RX5000 RX6000:
|
||||
```
|
||||
export HSA_OVERRIDE_GFX_VERSION=10.3.0
|
||||
```
|
||||
- For RDNA 3 cards RX7000:
|
||||
```
|
||||
export HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||
```
|
||||
- install Python
|
||||
```
|
||||
wget https://raw.githubusercontent.com/lllyasviel/Fooocus/main/AMD/install_python_conda.sh
|
||||
sudo chmod 777 install_python_conda.sh
|
||||
sudo ./install_python_conda.sh
|
||||
```
|
||||
- Install and Start lllyasviel/Fooocus
|
||||
```
|
||||
git clone --branch 2.3.1 https://github.com/lllyasviel/Fooocus.git
|
||||
cd Fooocus
|
||||
source fooocus_env/bin/activate
|
||||
pip3 install -r requirements_versions.txt
|
||||
pip3 install torch==2.1.2+rocm5.6 torchvision==0.16.2+rocm5.6 --extra-index-url https://download.pytorch.org/whl/rocm5.6
|
||||
python entry_with_update.py --listen --attention-split
|
||||
```
|
||||
- Restart Fooocus
|
||||
```
|
||||
cd Fooocus
|
||||
export HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||
source fooocus_env/bin/activate
|
||||
python entry_with_update.py --listen --attention-split
|
||||
```
|
||||
To see a prompt from your GPU usage.
|
||||
```
|
||||
watch /opt/rocm-6.0.2/bin/rocm-smi
|
||||
```
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
sudo apt update -y && sudo apt full-upgrade -y
|
||||
sudo apt install "linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"
|
||||
sudo usermod -a -G render,video $LOGNAME
|
||||
wget https://repo.radeon.com/amdgpu-install/6.0.2/ubuntu/jammy/amdgpu-install_6.0.60002-1_all.deb
|
||||
# to Ubuntu 20.04: wget https://repo.radeon.com/amdgpu-install/6.0.2/ubuntu/focal/amdgpu-install_6.0.60002-1_all.deb
|
||||
sudo apt install ./amdgpu-install_6.0.60002-1_all.deb
|
||||
sudo apt update
|
||||
sudo apt install amdgpu-dkms -y
|
||||
sudo apt install rocm -y
|
||||
sudo reboot now
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
mkdir -p ~/miniconda3
|
||||
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
|
||||
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
|
||||
rm -rf ~/miniconda3/miniconda.sh
|
||||
~/miniconda3/bin/conda init bash
|
||||
sudo apt install python3 -y
|
||||
sudo apt-get install python-is-python3 -y
|
||||
sudo apt install python3.11-venv -y
|
||||
sudo apt-get install git -y
|
||||
sudo apt-get install wget -y
|
||||
|
|
@ -107,8 +107,7 @@ class SDTurboScheduler:
|
|||
def get_sigmas(self, model, steps, denoise):
|
||||
start_step = 10 - int(10 * denoise)
|
||||
timesteps = torch.flip(torch.arange(1, 11) * 100 - 1, (0,))[start_step:start_step + steps]
|
||||
ldm_patched.modules.model_management.load_models_gpu([model])
|
||||
sigmas = model.model.model_sampling.sigma(timesteps)
|
||||
sigmas = model.model_sampling.sigma(timesteps)
|
||||
sigmas = torch.cat([sigmas, sigmas.new_zeros([1])])
|
||||
return (sigmas, )
|
||||
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ def calculate_sigmas_scheduler_hacked(model, scheduler_name, steps):
|
|||
elif scheduler_name == "sgm_uniform":
|
||||
sigmas = normal_scheduler(model, steps, sgm=True)
|
||||
elif scheduler_name == "turbo":
|
||||
sigmas = SDTurboScheduler().get_sigmas(namedtuple('Patcher', ['model'])(model=model), steps=steps, denoise=1.0)[0]
|
||||
sigmas = SDTurboScheduler().get_sigmas(model=model, steps=steps, denoise=1.0)[0]
|
||||
elif scheduler_name == "align_your_steps":
|
||||
model_type = 'SDXL' if isinstance(model.latent_format, ldm_patched.modules.latent_formats.SDXL) else 'SD1'
|
||||
sigmas = AlignYourStepsScheduler().get_sigmas(model_type=model_type, steps=steps, denoise=1.0)[0]
|
||||
|
|
|
|||
52
readme.md
52
readme.md
|
|
@ -201,14 +201,50 @@ Use `python entry_with_update.py --preset anime` or `python entry_with_update.py
|
|||
|
||||
Note that the [minimal requirement](#minimal-requirement) for different platforms is different.
|
||||
|
||||
Same with the above instructions. You need to change torch to the AMD version
|
||||
|
||||
pip uninstall torch torchvision torchaudio torchtext functorch xformers
|
||||
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/rocm5.6
|
||||
|
||||
AMD is not intensively tested, however. The AMD support is in beta.
|
||||
|
||||
Use `python entry_with_update.py --preset anime` or `python entry_with_update.py --preset realistic` for Fooocus Anime/Realistic Edition.
|
||||
[AMD GPU's Tutorial](https://github.com/lllyasviel/Fooocus/tree/main/amd) Debian and Ubuntu
|
||||
- Make sure that your system was fresh (ubuntu 22.04)
|
||||
- Computer will restart during the AMD driver install.
|
||||
- Prepare AMD ROCm Driver install
|
||||
```
|
||||
sudo usermod -a -G render,video $LOGNAME
|
||||
wget https://raw.githubusercontent.com/lllyasviel/Fooocus/main/AMD/amd_drivers.sh
|
||||
sudo chmod 777 amd_drivers.sh
|
||||
sudo ./amd_drivers.sh
|
||||
```
|
||||
- For RDNA and RDNA 2 cards RX5000 RX6000:
|
||||
```
|
||||
export HSA_OVERRIDE_GFX_VERSION=10.3.0
|
||||
```
|
||||
- For RDNA 3 cards RX7000:
|
||||
```
|
||||
export HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||
```
|
||||
- install Python
|
||||
```
|
||||
wget https://raw.githubusercontent.com/lllyasviel/Fooocus/main/AMD/install_python_conda.sh
|
||||
sudo chmod 777 install_python_conda.sh
|
||||
sudo ./install_python_conda.sh
|
||||
```
|
||||
- Install and Start lllyasviel/Fooocus
|
||||
```
|
||||
git clone --branch 2.3.1 https://github.com/lllyasviel/Fooocus.git
|
||||
cd Fooocus
|
||||
source fooocus_env/bin/activate
|
||||
pip3 install -r requirements_versions.txt
|
||||
pip3 install torch==2.1.2+rocm5.6 torchvision==0.16.2+rocm5.6 --extra-index-url https://download.pytorch.org/whl/rocm5.6
|
||||
python entry_with_update.py --listen --attention-split
|
||||
```
|
||||
- Restart Fooocus
|
||||
```
|
||||
cd Fooocus
|
||||
export HSA_OVERRIDE_GFX_VERSION=11.0.0
|
||||
source fooocus_env/bin/activate
|
||||
python entry_with_update.py --listen --attention-split
|
||||
```
|
||||
To see a prompt from your GPU usage.
|
||||
```
|
||||
watch /opt/rocm-6.0.2/bin/rocm-smi
|
||||
```
|
||||
|
||||
### Windows (AMD GPUs)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue