Local image generation for Go
Native stable-diffusion.cpp bindings for local image and video generation. Text-to-image, image-to-image, ControlNet, ADetailer, AnimateDiff, and Real-ESRGAN upscaling — with pure-Go PNG and JPEG I/O, no CGo, and no cloud dependency. OpenAI-compatible /v1/images/generations and /v1/images/edits on the Kronk model server.

$ git clone https://github.com/ardanlabs/kronk.git
$ cd kronk
$ make example-malina
✓ installed stable-diffusion.cpp libraries
✓ downloaded sd-1.5 model bundle
- dimensions : 512x512
- output : malina.pngWhy Malina
Built for production-minded Go teams
Malina brings local image generation into the Kronk ecosystem so Go apps can create and transform images on infrastructure they control — with pure-Go I/O and no cloud dependency. The public API is experimental and still evolving.
- 01
Generate on your stack
Run image generation where your application runs — not behind another vendor API.
- 02
No CGo required
Pure-Go PNG and JPEG I/O plus Motion-JPEG AVI muxing keeps the integration path simpler for Go services and tools.
- 03
Familiar API direction
OpenAI-compatible /v1/images/generations and /v1/images/edits on the Kronk model server, with advanced workflows available in the Go SDK.
- 04
Fits the Kronk model
Same local-first philosophy as Kronk and Bucky: own the runtime, control cost, keep data private.
What you can do
Image workflows Malina is built for
Use the Go SDK inside your process for the full surface area, or create and edit images through Kronk’s OpenAI-compatible image APIs.
Text-to-image
Generate images from prompts with curated Stable Diffusion, SDXL, and multi-file diffusion bundles.
Image-to-image
Transform an existing PNG or JPEG with a prompt and strength — through the SDK or /v1/images/edits.
ControlNet & ADetailer
Canny edge conditioning for composition control, plus face detection and refinement for portraits.
Video & upscaling
AnimateDiff frame sequences, Wan2.2 S2V speech-to-video, Real-ESRGAN upscaling, and Motion-JPEG AVI output.
Capabilities
What you get
stable-diffusion.cpp
Native bindings for local diffusion models without standing up a separate generation service first.
Curated model bundles
Pull complete workflows — SD 1.5, ControlNet, AnimateDiff, Real-ESRGAN, ADetailer, SDXL, and more — with validated manifests.
Pure-Go media I/O
PNG and JPEG handling in Go, plus Motion-JPEG AVI muxing so image and video pipelines stay inside your application.
SDK + model server
Use Malina in-process, or create and edit images through Kronk’s OpenAI-compatible image endpoints.
Hardware accelerated
Metal, CUDA, Vulkan, and ROCm backends depending on host — with automatic library detection and install.
Local by default
No cloud round-trips for generation — useful for air-gapped, regulated, or cost-sensitive environments.

Get started
Run Malina with Kronk
Install Kronk, pull stable-diffusion.cpp libraries and an SD 1.5 bundle, then run the Malina example — or generate images through the model server once it is up.
Install Kronk
brew install ardanlabs/kronk/kronk
# or: go install github.com/ardanlabs/kronk/cmd/kronk@latestInstall SD libraries + a model bundle
kronk malina libs --local
kronk malina model pull --local sd-1.5Run the example
git clone https://github.com/ardanlabs/kronk.git
cd kronk
make example-malinaOr generate through the API
kronk server start
# OpenAI-compatible image generation on the model server
# POST /v1/images/generations · POST /v1/images/editsDeeper docs: Malina manual chapter · Kronk on GitHub · Malina SDK repo
Platforms
Where Malina runs
Compatible stable-diffusion.cpp library bundles are downloaded per host. Use the CLI as the source of truth for supported combinations on your install.
macOS
CPU arm64 · GPU Metal
Linux
CPU amd64 · GPU Vulkan and ROCm
Windows
CPU amd64 · GPU CUDA, Vulkan, and ROCm
Model bundles
Pull a complete workflow
Curated bundles from the catalog — pull what you need with kronk malina model pull --local.
sd-1.5
~4.3 GBStable Diffusion 1.5 checkpoint — the default path for first image generation
controlnet-canny-sd1.5
~2.3 GBQuantized SD 1.5 plus Canny ControlNet for composition-constrained generation
realesrgan-x4-anime
~18 MBCompact Real-ESRGAN 4× anime upscaler for enlarging generated frames
adetailer-face-yolov8n
~1.6 GBFace detection and inpainting refinement for portrait workflows
animatediff-sd1.5
~2.4 GBAnimateDiff motion module for temporally conditioned video sequences
sdxl-base-1.0
~6.9 GBSDXL Base 1.0 checkpoint for higher-resolution generation
Related tooling
More in the ecosystem
Build AI systems you can own
Talk with Ardan Labs about local inference, private AI infrastructure, and production systems beyond API prototypes.