blazen_image_diffusion/lib.rs
1//! Local image generation backend for Blazen using [`diffusion-rs`](https://github.com/huggingface/diffusion-rs).
2//!
3//! This crate wraps the `diffusion-rs` pure-Rust Stable Diffusion inference
4//! engine to provide fully local, offline image generation with no API keys
5//! required.
6//!
7//! When used through `blazen-llm` with the `diffusion` feature flag, this
8//! crate's [`DiffusionProvider`] will implement `blazen_llm::ImageGeneration`.
9//!
10//! # Feature flags
11//!
12//! | Feature | Description |
13//! |----------|--------------------------------------------------|
14//! | `engine` | Links the actual `diffusion-rs` runtime (CPU) |
15//! | `cuda` | NVIDIA CUDA GPU acceleration |
16//! | `metal` | Apple Silicon GPU acceleration (Metal) |
17//!
18//! Without the `engine` feature the crate compiles (options struct + stub
19//! provider) but cannot actually run image generation. This keeps workspace
20//! builds fast when the heavy native dependencies are not needed.
21
22mod options;
23mod provider;
24
25pub use options::{DiffusionOptions, DiffusionScheduler};
26pub use provider::{DiffusionError, DiffusionProvider};