Crates.io | wasmedge_stable_diffusion |
lib.rs | wasmedge_stable_diffusion |
version | 0.3.2 |
source | src |
created_at | 2024-08-21 06:23:25.171704 |
updated_at | 2024-10-28 12:33:03.770007 |
description | A Rust library for using stable diffusion functions when the Wasi is being executed on WasmEdge. |
homepage | |
repository | https://github.com/WasmEdge/wasmedge-stable-diffusion |
max_upload_size | |
id | 1346175 |
size | 37,059 |
A Rust library for using stable diffusion functions when the Wasi is being executed on WasmEdge.
git clone https://github.com/WasmEdge/WasmEdge.git
cd WasmEdge
cmake -GNinja -Bbuild -DCMAKE_BUILD_TYPE=Release -DWASMEDGE_BUILD_TESTS=OFF -DWASMEDGE_PLUGIN_STABLEDIFFUSION=On
cmake --build build
cmake --install build
Download the weights or quantized model from the following command.
You also can use our example to quantize the weights by yourself.
stable-diffusion v1.4: second-state/stable-diffusion-v-1-4-GGUF
stable-diffusion v1.5: second-state/stable-diffusion-v1-5-GGUF
stable-diffusion v2.1: second-state/stable-diffusion-2-1-GGUF
curl -L -O https://huggingface.co/second-state/stable-diffusion-v-1-4-GGUF/resolve/main/sd-v1-4.ckpt
curl -L -O https://huggingface.co/second-state/stable-diffusion-v-1-4-GGUF/resolve/main/stable-diffusion-v1-4-Q8_0.gguf
cargo build --target wasm32-wasi --release
wasmedge --dir .:. ./target/wasm32-wasi/release/wasmedge_stable_diffusion_example.wasm
Then you can see the three new files.