# stable-diffusion

A pure Go, cgo-free wrapper around stable-diffusion.cpp that runs Stable Diffusion text-to-image and image-to-image generation cross-platform.

This is a pure Go wrapper around stable-diffusion.cpp, itself an adaptation of ggml.cpp, letting a Go program run Stable Diffusion inference without cgo. It exposes a high-level AutoModel API with Predict and ImagePredict functions, so most users do not need to load the dynamic library manually, plus a low-level API matching stable-diffusion.cpp directly.

Prebuilt dynamic libraries are provided per platform: Windows supports AVX, AVX2 and AVX512 on x64 plus ROCm 5.5 and CUDA 12 acceleration, Linux supports x64 only with no GPU acceleration, and macOS supports x64 and arm64, also without GPU acceleration. Shipping a program built on this library requires bundling the platform's dynamic library, the model file, the tokenizer file and, if CUDA is used, the CUDA runtime library.

Website: https://github.com/seasonjs/stable-diffusion
