Image Generation Experimental
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.gitcd kronkmake example-malina✓ installed stable-diffusion.cpp libraries✓ downloaded sd-1.5 model bundle- dimensions : 512x512- output : malina.png- stable-diffusion.cpp
- Stable Diffusion 1.5
- SDXL
- ControlNet
- ADetailer
- AnimateDiff
- Wan2.2 S2V
- Real-ESRGAN
- Metal
- CUDA
- Vulkan
- ROCm
- PNG
- JPEG
- Motion-JPEG AVI
- OpenAI images API
- Kronk model server
- Go SDK
Why 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.
Talk to an EngineerGenerate on your stack
Run image generation where your application runs — not behind another vendor API.
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.
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.
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.
Step 01
Text-to-image
Generate images from prompts with curated Stable Diffusion, SDXL, and multi-file diffusion bundles.
Step 02
Image-to-image
Transform an existing PNG or JPEG with a prompt and strength — through the SDK or /v1/images/edits.
Step 03
ControlNet & ADetailer
Canny edge conditioning for composition control, plus face detection and refinement for portraits.
Step 04
Video & upscaling
AnimateDiff frame sequences, Wan2.2 S2V speech-to-video, Real-ESRGAN upscaling, and Motion-JPEG AVI output.
API surface
OpenAI-compatible, running locally
Malina powers Kronk’s image endpoints, so clients that already speak the OpenAI images API can generate and edit images on your own hardware.
ControlNet, ADetailer, video generation, and upscaling are available through the Malina Go SDK.
Explore the Malina Manual-
Generations
/v1/images/generationsCreate images from a prompt with an installed model bundle and get base64 image data back. -
Edits
/v1/images/editsTransform a source PNG or JPEG with a prompt and strength using multipart form fields. -
Progress events
GET /v1/images/eventsFollow model loading and generation progress as server-sent events.
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.
Models
Pull a complete workflow
Curated bundles from the catalog — pull what you need with the Kronk CLI.
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
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.
brew install ardanlabs/kronk/kronk# or: go install github.com/ardanlabs/kronk/cmd/kronk@latestkronk malina libs --localkronk malina model pull --local sd-1.5git clone https://github.com/ardanlabs/kronk.gitcd kronkmake example-malinaPlatforms
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 ROCm
Windows
- CPU
- amd64
- GPU
- CUDA Vulkan ROCm
Build AI systems you can own
Talk with Ardan Labs about local inference, private AI infrastructure, and production systems beyond API prototypes.