r/StableDiffusion • • Oct 12 '22

Question Image2Image with AMD hardware?

Hello

Has anyone found a way to use other SD features such as IMG2IMG with a SD version that relies on AMD hardware?

4 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/[deleted] Oct 13 '22

[removed] — view removed comment

2

u/Crafty-Process-5727 Oct 14 '22 edited Oct 14 '22

See here for directml requirements: https://github.com/microsoft/tensorflow-directml-plugin

In powershell, with python3.9.7 and git installed:

# clone
git clone https://github.com/divamgupta/stable-diffusion-tensorflow.git
cd stable-diffusion-tensorflow

# create venv
python -m venv --prompt sdtf-windows-directml venv
venv\Scripts\activate

# verify venv is installed and activated
pip --version

# install deps
pip install -r requirements.txt
pip install tensorflow-directml-plugin

# you should see DML debug output and at least one GPU
python -c 'import tensorflow as tf; print(tf.config.list_physical_devices())'

# run (show help)
python text2image.py --help
python text2image.py --prompt "a fluffy kitten"

Beware, it has no NSFW filter.


Update: It works just fine in WSL2/python3.8, too; even a little faster. Make sure WSL2 has enough RAM to load the large files, and clone+install into the guest filesystem or IO performance will be horrible.

# activate venv in bash
source venv/bin/activate