
Security News
ECMAScript 2025 Finalized with Iterator Helpers, Set Methods, RegExp.escape, and More
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
diffusion-rs-accelerate
Advanced tools
| Rust Documentation | Python Documentation | Discord |
bitsandbytes
format (fp4, nf4, and int8)GGUF
(2-8 bit quantization)Please do not hesitate to contact us with feature requests via Github issues!
Check out the installation guide for details about installation.
After installing, you can try out these examples!
Download the DDUF file here:
wget https://huggingface.co/DDUF/FLUX.1-dev-DDUF/resolve/main/FLUX.1-dev-Q4-bnb.dduf
CLI:
diffusion_rs_cli --scale 3.5 --num-steps 50 dduf -f FLUX.1-dev-Q4-bnb.dduf
More CLI examples here.
Python:
More Python examples here.
from diffusion_rs import DiffusionGenerationParams, ModelSource, Pipeline
from PIL import Image
import io
pipeline = Pipeline(source=ModelSource.DdufFile("FLUX.1-dev-Q4-bnb.dduf"))
image_bytes = pipeline.forward(
prompts=["Draw a picture of a sunrise."],
params=DiffusionGenerationParams(
height=720, width=1280, num_steps=50, guidance_scale=3.5
),
)
image = Image.open(io.BytesIO(image_bytes[0]))
image.show()
Rust crate:
Examples with the Rust crate: here.
use std::time::Instant;
use diffusion_rs_core::{DiffusionGenerationParams, ModelSource, Offloading, Pipeline, TokenSource};
use tracing::level_filters::LevelFilter;
use tracing_subscriber::EnvFilter;
let filter = EnvFilter::builder()
.with_default_directive(LevelFilter::INFO.into())
.from_env_lossy();
tracing_subscriber::fmt().with_env_filter(filter).init();
let pipeline = Pipeline::load(
ModelSource::dduf("FLUX.1-dev-Q4-bnb.dduf")?,
false,
TokenSource::CacheToken,
None,
None,
)?;
let start = Instant::now();
let images = pipeline.forward(
vec!["Draw a picture of a sunrise.".to_string()],
DiffusionGenerationParams {
height: 720,
width: 1280,
num_steps: 50,
guidance_scale: 3.5,
},
)?;
let end = Instant::now();
println!("Took: {:.2}s", end.duration_since(start).as_secs_f32());
images[0].save("image.png")?;
Model | Supports DDUF | Supports quantized DDUF |
---|---|---|
FLUX.1 Dev/Schnell | ✅ | ✅ |
FAQs
Blazingly fast inference of diffusion models.
We found that diffusion-rs-accelerate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ECMAScript 2025 introduces Iterator Helpers, Set methods, JSON modules, and more in its latest spec update approved by Ecma in June 2025.
Security News
A new Node.js homepage button linking to paid support for EOL versions has sparked a heated discussion among contributors and the wider community.
Research
North Korean threat actors linked to the Contagious Interview campaign return with 35 new malicious npm packages using a stealthy multi-stage malware loader.