Skip to content

darkyboys/rocm-stable-diffusion.cpp

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

409 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stable-diffusion.cpp

leejet%2Fstable-diffusion.cpp | Trendshift

Diffusion model(SD,Flux,Wan,...) inference in pure C/C++

Note that this project is under active development.
API and command-line option may change frequently.

Installation

Before you install this project please make sure that you have the rocm installed. If not then please install it and check weather your gpu is supported or not. Run this command to check the rocm support information:

rocminfo

If supported then you will be able to see it's gfx code something like gfx1100 (For RX 7900 Series), This will vary depending on the GPU Model. If the rocm is supported then you can proceed to install ninja build system. If everything is all right then you can proceed to run these commands:

git clone https://github.com/BillyOutlast/rocm-stable-diffusion.cpp.git
cd rocm-stable-diffusion.cpp

# Create build directory
mkdir build && cd build

# Adding ggml
git submodule update --init --recursive

# Configure CMake for ROCm (HIPBLAS)
cmake .. \
    -G Ninja \
    -DCMAKE_C_COMPILER=clang \
    -DCMAKE_CXX_COMPILER=clang++ \
    -DSD_HIPBLAS=ON \
    -DCMAKE_BUILD_TYPE=Release \
    -DAMDGPU_TARGETS=gfx1100

# Build
ninja

# Move the binary and clean the project
mv bin ../../
cd ../../
rm -rf rocm-stable-diffusion.cpp

After wards you will have the bin/sd binary file. You can use that binary according to the documentation.

Features

Quick Start

Get the sd executable

Download model weights

Generate an image with just one command

./bin/sd -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat"

For detailed command-line arguments, check out cli doc.

Performance

If you want to improve performance or reduce VRAM/RAM usage, please refer to performance guide.

More Guides

Bindings

These projects wrap stable-diffusion.cpp for easier use in other languages/frameworks.

UIs

These projects use stable-diffusion.cpp as a backend for their image generation.

Contributors

Thank you to all the people who have already contributed to stable-diffusion.cpp!

Contributors

Star History

Star History Chart

References

About

Fixed Diffusion model(SD,Flux,Wan,Qwen Image,...) inference in pure C/C++

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 100.0%