Remix.run Logo
Show HN: Gosd: High-performance Stable Diffusion inference in pure Go(no CGO)(github.com)
1 points by krakato 4 hours ago

Hello everyone,

I'm building a multimodal AI inference platform in Go and needed Stable Diffusion support for image/video generation.

Existing Go bindings for stable-diffusion.cpp were either outdated or no longer maintained, so I decided to build my own.

gosd is a set of Pure Go(no CGO - ffi-based) bindings for stable-diffusion.cpp. It is cross-platform(regularly tested on Win, Linux, Mac) and integrates seamlessly to existing Go-based codebases and applications(no C++ compiler needed for your builds).

You can generate images, videos, edit images, preprocess images with Canny, watch images/videos being generated after every step in the inference loop and much more.

Around a dozen of models can be used for generation(Wan2.2, Flux...) - please have a look at https://github.com/leejet/stable-diffusion.cpp for the full list of compatible models.

On my local setup with Radeon 7900XTX, a full HD image can be generated in about 10-30sec. You don't need a GPU for generation, CPU alone will be fine(although 10-100x slower).

The library is MIT licensed so you can use it pretty much however you want it.

I'd appreciate any feedback - hopefully you'll have as much fun with gosd as I have.