Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
cc36803
Modified Api
wandbrandon Jan 30, 2025
7f3d6c4
separate files
wandbrandon Jan 30, 2025
ac0212f
add support for image crate conversions
wandbrandon Feb 3, 2025
81e7365
fix control net issues, (control net does not work because of sdcpp)
wandbrandon Feb 4, 2025
c0988c3
fix dead code warnings
wandbrandon Feb 4, 2025
5765afa
public model ctx
wandbrandon Feb 4, 2025
8f7c252
control net cleanup
wandbrandon Feb 4, 2025
62d6b1b
add images for testing in gitignore
wandbrandon Feb 4, 2025
f3babbe
test expansion and remove hf hub dependency
wandbrandon Feb 4, 2025
0aa6301
simplify controlnet image logic, add original logging
wandbrandon Feb 6, 2025
d10906a
update mut
wandbrandon Feb 7, 2025
749c197
delete old api
wandbrandon Feb 7, 2025
02336e9
remove warnings
wandbrandon Feb 7, 2025
a976c0d
remove lifetimes and allow for multithreading (unsafe)
wandbrandon Feb 10, 2025
e1b8123
arc? i suppose so
wandbrandon Feb 11, 2025
eac613c
add logging callbacks
wandbrandon Feb 14, 2025
3bcb12c
expose log level
wandbrandon Feb 14, 2025
2bbbd76
publicize it
wandbrandon Feb 14, 2025
684fd60
strip option
wandbrandon Feb 14, 2025
da6180b
use sd's get physical cores
wandbrandon Feb 17, 2025
99d24b2
remove clibstring and clibpath, to create more abstraction
wandbrandon Feb 18, 2025
535c345
finally fix control image failures and support multithreading
wandbrandon Feb 22, 2025
afe6575
cloning for new
wandbrandon Feb 22, 2025
5cad9a1
update to newest sd
wandbrandon Mar 4, 2025
8186fbf
add binding and clean readme
wandbrandon Mar 19, 2025
ae4150c
update sdcpp
wandbrandon Mar 21, 2025
873e6f1
add logging data parameter for callbacks
wandbrandon Mar 27, 2025
fd645c8
test probably not good code
wandbrandon Mar 27, 2025
289734c
clean up
wandbrandon Mar 27, 2025
b2c3610
fix and support closures for log callbacks
wandbrandon Mar 28, 2025
1101bcb
multithreading, kinda working?
wandbrandon Mar 28, 2025
f60ad5d
some other changes to fix callbacks
wandbrandon Mar 31, 2025
984476b
fixing the bad closure code due to non specific model context logging...
wandbrandon Apr 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ bin/act

*.png
.idea/
models/
images/

.DS_Store
15 changes: 6 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[workspace]
members = ["sys"]
resolver = "2"

[workspace.package]
version = "0.1.6"
edition = "2021"
version = "0.1.8"
edition = "2024"
license = "MIT"
repository = "https://github.com/newfla/diffusion-rs"
keywords = ["ai", "stable-diffusion", "flux"]
Expand All @@ -19,19 +18,17 @@ keywords.workspace = true
description = "High level API for stable-diffusion.cpp"
documentation = "https://docs.rs/diffusion-rs"


[dependencies]
derive_builder = "0.20.2"
diffusion-rs-sys = { path = "sys", version = "0.1.6" }
hf-hub = {version = "0.4.0", default-features = false, features = ["ureq"]}
libc = "0.2.161"
diffusion-rs-sys = { path = "sys", version = "0.1.8" }
image = "0.25.6"
libc = "0.2.171"
num_cpus = "1.16.0"
thiserror = "2.0.3"
thiserror = "2.0.12"

[features]
cuda = ["diffusion-rs-sys/cuda"]
hipblas = ["diffusion-rs-sys/hipblas"]
metal = ["diffusion-rs-sys/metal"]
vulkan = ["diffusion-rs-sys/vulkan"]
sycl = ["diffusion-rs-sys/sycl"]
flashattn = ["diffusion-rs-sys/flashattn"]
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# diffusion-rs

[![Latest version](https://img.shields.io/crates/v/diffusion-rs.svg)](https://crates.io/crates/diffusion-rs)
[![Documentation](https://docs.rs/diffusion-rs/badge.svg)](https://docs.rs/diffusion-rs)

Rust bindings to <https://github.com/leejet/stable-diffusion.cpp>

## Features Matrix

| | Windows | Mac | Linux |
| --- | :---: | :---: | :---: |
|vulkan| ✅️ | ⛓️‍💥 | ✅️ |
Expand All @@ -17,7 +19,8 @@ Rust bindings to <https://github.com/leejet/stable-diffusion.cpp>

⛓️‍💥 : Issues when linking libraries

## Usage
## Usage

``` rust no_run
use diffusion_rs::{api::txt2img, preset::{Preset,PresetBuilder}};
let config = PresetBuilder::default()
Expand All @@ -31,16 +34,17 @@ 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 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.
* 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!
* `DIFFUSION_SKIP_BINDINGS=1 cargo build`
* If you can fix the issue, please open a PR!

## Roadmap

1. ~~Ensure that the underline cpp library compiles on supported platforms~~
2. ~~Build an easy to use library with model presets~~
3. ~~Automatic library publishing on crates.io by gh actions~~
4. _Maybe_ prebuilt CLI app binaries
4. _Maybe_ prebuilt CLI app binaries
Loading