惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
J
Java Code Geeks
月光博客
月光博客
博客园_首页
The GitHub Blog
The GitHub Blog
Vercel News
Vercel News
B
Blog RSS Feed
博客园 - 聂微东
宝玉的分享
宝玉的分享
T
Tailwind CSS Blog
Jina AI
Jina AI
S
SegmentFault 最新的问题
B
Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
Google DeepMind News
Google DeepMind News
阮一峰的网络日志
阮一峰的网络日志
The Cloudflare Blog
量子位
Martin Fowler
Martin Fowler
博客园 - Franky
大猫的无限游戏
大猫的无限游戏
博客园 - 叶小钗

Hacker News: Show HN

PurrrrrFocus: Pomodoro Timer App - App Store Workflow Engine — Multi-Step Orchestration for Bun RapidPhoto: Pro Photo Editor App - App Store GitHub - DheerG/swarms: Achieve extraordinary results with claude code across a variety of tasks SPICE simulation → oscilloscope → verification with Claude Code — Lucas Gerads Show HN: VCoding – A 5 MB native Windows IDE with no dynamic dependencies Show HN: LLMs don't hallucinate because they're bad at math, it's the format GitHub - Agent-FM/agentfm-core: AgentFM is a peer-to-peer network that turns everyday computers into a decentralized AI supercomputer. AgentFM lets you run massive AI workloads directly across a global mesh of idle CPUs and GPUs. Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years GitHub - Potarix/agent-hub: One place to talk to all your agents Show HN: Runtime security for AI agents(injection,tool abuse, data exfiltration) GitHub - dubeyKartikay/lazyspotify: Terminal Spotify client for macOS and Linux GitHub - the-banana-tool/king-louie: Easy to use GUI Personal AI Assistant. Win/Linux/Mac. Show HN I made my vacation rental bookable by AI agents–no Airbnb, 0% commission GitHub - basteez/jsf-autoreload: maven plugin to enable hot reload on jsf projects uvm32/hosts/host-gdbstub at main · ringtailsoftware/uvm32 GitHub - labsai/EDDI: Config-driven engine that turns JSON into production-grade AI agents. Multi-agent orchestration, 12+ LLM providers, MCP/A2A protocols, RAG, persistent memory, and enterprise compliance (EU AI Act, GDPR, HIPAA). Built on Quarkus. GitHub - glitchnsec/fortyone-oss: AI Executive Assistant Platform Quickstart | Alien GitHub - muxshed/shed: One stream in, or many. Every destination, simultaneously. No cloud middleman, no per-channel fees, no limits. GitHub - ocrbase-hq/ocrbase: 📄 PDF/IMG ->.MD/JSON Document OCR API for PaddleOCR and GLMOCR. Self-hostable. GitHub - impactjo/home-memory: MCP server that lets your AI assistant remember everything about your home. GitHub - Sets88/dbcls: DbCls is a powerful terminal database client that supports various databases GitHub - neptun2000/heor-agent-mcp GitHub - SeanFDZ/macmind: Single-layer transformer in HyperTalk for the classic Macintosh RollQuation: Math Puzzles - Apps on Google Play GitHub - dropbox/witchcraft Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis GitHub - opentalon/opentalon: OpenTalon is an open-source platform built from the ground up in Go as a robust alternative to OpenClaw LinkedIn™ 职位抓取工具 - Chrome 应用商店
GitHub - l8bloom/gosd: Pure Go bindings for stable-diffus...
krakato · 2026-05-07 · via Hacker News: Show HN

gosd

High-performance diffusion model inference in pure Go.

License: MIT Go Reference Linux Windows macOS stable-diffusion.cpp Coverage

Features

  • Image and video generation
  • Image editing
  • High-resolution upscaling (Neural ESRGAN models + Latent-space methods)
  • Callback support for progressive previews during inference
  • Model conversion (to SafeTensors / GGUF, optional VAE merging, tensor type rules)
  • Hardware-accelerated inference (CUDA, Metal, Vulkan, ROCm and CPU)
  • Minimal performance overhead compared to C/C++

Quick start

gosd library is a set of pure Go bindings(no CGO) for stable-diffusion.cpp.
Equip your Go programs with image and video generation — hassle-free.

Installation

go get github.com/l8bloom/gosd

to add gosd to your Go module.

After that, the only thing left is to get the stable-diffusion shared libraries. There are multiple ways to do it, and is directed with the underlying OS and hardware.

The simplest approach is to download an official release from the stable-diffusion project that matches your system. The gosd library is designed to be agnostic regarding which specific build you choose though.

Manual installation (Linux + Vulkan example)
Here is a quick overview example of building entire gpu stack, stable-diffusion libs and gosd on Linux with Khronos Vulkan API for Radeon GPU.
# fetch the driver for your distribution, eg. on Ubuntu:
sudo apt update
sudo apt install mesa-vulkan-drivers vulkan-tools

# fetch the Vulkan loader
VULKAN_VER="1.4.341.1"
mkdir -p /tmp/vulkan && cd /tmp/vulkan \
    && wget -O /tmp/vulkan/vulkan.tar.xz "https://sdk.lunarg.com/sdk/download/${VULKAN_VER}/linux/vulkansdk-linux-x86_64-${VULKAN_VER}.tar.xz" \
    && tar -xf vulkan.tar.xz \
    && rm -rf vulkan.tar.xz

# update the env and run commands to confirm successful installation
. /tmp/vulkan/${VULKAN_VER}/setup-env.sh
vulkaninfo
vkcube

# clone the stable diffusion
git clone --recursive https://github.com/leejet/stable-diffusion.cpp
cd stable-diffusion.cpp

# build the sd
cmake -B builds/vulkan -DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON -DSD_BUILD_SHARED_GGML_LIB=ON
cmake --build builds/vulkan --config Release

# gosd is ready now, export the lib root and try out examples
export GOSD_DYN_LIB="$(realpath builds/vulkan/bin/)"
git clone https://github.com/l8bloom/gosd && cd gosd
go run examples/image_gen/image_gen.go

Examples

Image generation

Generate an image in a few lines:

package main

import sd "github.com/l8bloom/gosd/pkg/gosd"

func main() {
	// Load the dynamic libraries
	if err := sd.Load(); err != nil {
		panic(err.Error())
	}

	// Create and configure the inference context
	ctxParams := sd.ContextParamsInit()

	// Declare models
	ctxParams.DiffusionModelPath = "/tmp/stable.diffusion/flux-2-klein-9b-Q8_0.gguf"
	ctxParams.VAEPath = "/tmp/stable.diffusion/diffusion_pytorch_model.safetensors"
	ctxParams.LLMPath = "/tmp/stable.diffusion/Qwen3-8B-Q8_0.gguf"

	ctx := sd.NewContext(ctxParams)
	defer sd.FreeCtx(ctx)

	// Initialize image generation parameters
	imgParams := sd.ImageGenParamsInit()

	// Prompts
	imgParams.Prompt = "An orange cat on palm beach playing with oranges."
	imgParams.NegativePrompt = "mascots, watermark, signature"

	genImage := sd.GenerateImage(ctx, imgParams)
	genImage.SavePNG("output.png")
}

Result:

catImage

Image generation with a preview

examples/callbacks/image_gen/image_gen_with_callbacks.go shows image generation with a preview callback set.

1st image

image1

4th image

image4

10th(last) image

image10

ControlNet Preprocessing

Canny Edge Detection: Extract structural outlines from any image to guide ControlNet inference with pixel-perfect precision.

Generated Image

cannyImage1

Canny Preprocessed

cannyImage2

ControlNet Output

cannyImage3

With A futuristic office with neon lights prompt, see examples/system/canny/preprocess_canny.go for more details.

examples folder has more snippets showcasing classic use-cases.

stable-diffusion.cpp documentation provides more insights into library's features, examples, models etc.

Environment variables

  • GOSD_DYN_LIB indicates root of stable-diffusion shared lib(.so, .dll etc.)

You may need to extend OS search path to load libraries sd depends on.
E.g. for Linux deployments: export LD_LIBRARY_PATH=$GOSD_DYN_LIB:$LD_LIBRARY_PATH

Portability

CI/CD pipelines regularly test CPU-based inference on Linux, Windows, and macOS.
GPU acceleration via Vulkan and AMD ROCm/HIP stack are being tested on privately hosted hardware, with verified compatibility on Linux.

Platform CPU (AMD64) CPU (ARM64) GPU (Vulkan 1.4.3) GPU (ROCm 7.2.1)
Linux
Windows - -
macOS - - -

✅ = regularly tested

Thanks

  • C/C++: stable-diffusion.cpp, llama.cpp
  • Go: ffi, purego
  • Hugging Face