Giter VIP home page Giter VIP logo

stable-diffusion-rocm's Introduction

Stable Diffusion Dockerfile for ROCm

Run Stable Diffusion on an AMD card, using this method. Tested on my RX 6900 XT.

  1. Obtain sd-v1-4.ckpt and put it in models/.
  2. Run ./build-rocm to build the Docker image.
  3. Run ./run-rocm to run a shell in the Docker container.
  4. Inside the container, you can do e.g. python scripts/txt2img.py --outdir /output --plms --seed $RANDOM$RANDOM --prompt "a unicorn riding a purple tricycle".

stable-diffusion-rocm's People

Contributors

ashleyyakeley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

stable-diffusion-rocm's Issues

COPY failed: file not found in build context or excluded by .dockerignore: stat sd-v1-4.ckpt: file does not exist - Garuda Linux

I downloaded and put the ckpt file still get this error:

Ran sudo ./build-rocm

Sending build context to Docker daemon  4.265GB
Step 1/14 : FROM rocm/pytorch:rocm5.2_ubuntu20.04_py3.7_pytorch_1.11.0_navi21
---> 1fd8c7aa58bf
Step 2/14 : RUN echo 2022-08-24 > /container.date
---> Using cache
---> 7d343e1c71b9
Step 3/14 : WORKDIR /dockerx
---> Using cache
---> 95ca0617db6b
Step 4/14 : RUN pip3 install --upgrade pip
---> Using cache
---> 3e19294f74aa
Step 5/14 : RUN conda update -y -n base -c defaults conda
---> Using cache
---> e69203d6a460
Step 6/14 : RUN git clone --depth 1 -b uncensored https://github.com/AshleyYakeley/stable-diffusion.git .
---> Using cache
---> 53e4b28035fd
Step 7/14 : RUN conda env create -f environment.yaml
---> Using cache
---> fceb84555dc8
Step 8/14 : RUN mkdir -p models/ldm/stable-diffusion-v1/
---> Using cache
---> f0c627da06d9
Step 9/14 : COPY sd-v1-4.ckpt models/ldm/stable-diffusion-v1/model.ckpt
COPY failed: file not found in build context or excluded by .dockerignore: stat sd-v1-4.ckpt: file does not exist

"hipErrorNoBinaryForGpu" error for rx 6700 xt (Navi 22)

I get this error when running the image locally after a successful build:

Global seed set to 42
Loading model from models/ldm/stable-diffusion-v1/model.ckpt
Global Step: 470000
LatentDiffusion: Running in eps-prediction mode
DiffusionWrapper has 859.52 M params.
making attention of type 'vanilla' with 512 in_channels
Working with z of shape (1, 4, 32, 32) = 4096 dimensions.
making attention of type 'vanilla' with 512 in_channels
"hipErrorNoBinaryForGpu: Unable to find code object for all current devices!"
Aborted (core dumped)

See: this issue for further details as to why.

Navi 22 isn't supported as of yet so don't trying running this on a 6700/6700 xt/6750 etc. I'm not asking or expecting this to be fixed, I just thought other people may want to be aware of this in case they hit the same issue and to avoid disappointment/anybody else raising this.

entrypoint.sh: patch does not apply

warning: entrypoint.sh has type 100644, expected 100755
error: patch failed: entrypoint.sh:58
error: entrypoint.sh: patch does not apply

Followed the instructions, but it doesn't seem to work.

More dowloaded stuff should be in the Docker image

txt2img downloads a lot of stuff on first run. Right now the line RUN conda run -n ldm python scripts/txt2img.py --help gets some of it. It would be nice to get all of it so that we don't need to download it every time the container is run.

For people with 5700xt's

for people running with 5700xt:

edit the Dockerfile in rocm dir and replace the git clone with this optimized repo:
https://github.com/basujindal/stable-diffusion.git
After you run the ./run-rocm script and get a shell edit:
vi optimizedSD/v1-inference.yaml

remove all the optimizedSD from the targets ie:

-  target: optimizedSD.ddpm.UNet
+  target: ddpm.UNet

after this you can install gradio:
pip install gradio
export HSA_OVERRIDE_GFX_VERSION=10.3.0
python optimizedSD/txt2img_gradio.py

fails with RX 6600M : hipErrorNoBinaryForGpu

Maybe it's just this card being not supported, I don't know.

I'm using a gaming laptop running Fedora 36 with a Ryzen 7 5800H CPU and a Radeon™ RX 6600M GPU.

I get a hipErrorNoBinaryForGpu error when trying the example command inside the container:

/dockerx# python scripts/txt2img.py --outdir /output --plms --seed $RANDOM$RANDOM --prompt "a unicorn riding a purple tricycle"
"hipErrorNoBinaryForGpu: Unable to find code object for all current devices!"
Aborted (core dumped)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.