6 releases
new 0.1.5 | Jan 16, 2025 |
---|---|
0.1.4 | Dec 28, 2024 |
0.1.3 | Nov 14, 2024 |
#193 in Machine learning
98 downloads per month
5MB
94K
SLoC
diffusion-rs
Rust bindings to https://github.com/leejet/stable-diffusion.cpp
Features Matrix
Windows | Mac | Linux | |
---|---|---|---|
vulkan | ✅️ | ⛓️💥 | ✅️ |
metal | - | ✅️ | - |
cuda | ✅️ | - | ✅️ |
rocm | ❔️ | - | ⛓️💥 |
sycl | ❔️ | - | ⛓️💥 |
✅️: Working
⛓️💥 : Issues when linking libraries
Usage
use diffusion_rs::{api::txt2img, preset::{Preset,PresetBuilder}};
let config = PresetBuilder::default()
.preset(Preset::SDXLTurbo1_0Fp16)
.prompt("a lovely duck drinking water from a bottle")
.build()
.unwrap();
txt2img(config).unwrap();
Troubleshooting
- Something other than Windows/Linux isn't working!
- I don't have a way to test these platforms, so I can't really help you.
- I get a panic during binding generation build!
- You can attempt to fix it yourself, or you can set the
DIFFUSION_SKIP_BINDINGS
environment variable. This skips attempting to build the bindings whatsoever and copies the existing ones. They may be out of date, but it's better than nothing.DIFFUSION_SKIP_BINDINGS=1 cargo build
- If you can fix the issue, please open a PR!
- You can attempt to fix it yourself, or you can set the
Roadmap
Ensure that the underline cpp library compiles on supported platformsBuild an easy to use library with model presetsAutomatic library publishing on crates.io by gh actions- Maybe prebuilt CLI app binaries
Dependencies
~6–18MB
~235K SLoC