Who it is forA developer or artist who wants local image generation without installing a Python environment or a web UI.
The problemMost local image generators need a big Python install and a GPU setup that breaks easily.
The outcomeA PNG generated on your own machine, with the generation settings embedded in the file.
What you need first
- The sd executable from the releases page, or a build from source following the build guide
- Model weights in .ckpt, .safetensors or .gguf format
- Linux, macOS or Windows; Android works through Termux
- Enough RAM or VRAM for the model; the performance guide covers reducing it
Steps
- Download a pre-built sd binary from the releases page, or build it from source with the build guide
- Download weights, for example
curl -L -O https://huggingface.co/stable-diffusion-v1-5/stable-diffusion-v1-5/resolve/main/v1-5-pruned-emaonly.safetensors - Generate an image:
./bin/sd-cli -m ../models/v1-5-pruned-emaonly.safetensors -p "a lovely cat" - Check the cli doc for options such as negative prompt, sampling method and seed
- Open the output PNG; the generation parameters are embedded as webui-compatible text
Prompt for your agent
Download the latest leejet/stable-diffusion.cpp release for my OS, fetch Stable Diffusion v1.5 weights and generate 4 images of <prompt> with sd-cli, each with a different seed. Save them to <folder> and list the exact commands you ran.
Caveat. The README warns that the API and command-line options change frequently, so check the cli doc for your release.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for leejet/stable-diffusion.cpp and "Generate images locally with a single command"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer