mit einem Klick
ollamadiffuser
Generate images using locally-running AI models (Stable Diffusion, FLUX, SDXL, and 30+ models) via OllamaDiffuser
Menü
Generate images using locally-running AI models (Stable Diffusion, FLUX, SDXL, and 30+ models) via OllamaDiffuser
| name | ollamadiffuser |
| display_name | OllamaDiffuser - Local AI Image Generation |
| description | Generate images using locally-running AI models (Stable Diffusion, FLUX, SDXL, and 30+ models) via OllamaDiffuser |
| version | 1.0.0 |
| author | LocalKinAI Team |
| homepage | https://github.com/LocalKinAI/ollamadiffuser |
| tags | ["image-generation","stable-diffusion","flux","local-ai","creative"] |
| metadata | {"openclaw":{"requires":{"binaries":["ollamadiffuser"]}}} |
You can generate images using locally-installed AI diffusion models through the OllamaDiffuser API. All processing happens on the user's machine -- no cloud API keys required.
Before generating images, verify OllamaDiffuser is installed and the API server is running.
Check installation:
ollamadiffuser version
If not installed, the user needs to run: pip install ollamadiffuser
Start the API server (if not already running):
nohup ollamadiffuser --mode api > /dev/null 2>&1 &
The server runs at http://localhost:8000 by default.
Verify the server is healthy:
curl -s http://localhost:8000/api/health
Expected response: {"status": "healthy", "model_loaded": true/false, "current_model": "..."}
Use the recommend command to find the best model for the user's hardware:
ollamadiffuser recommend
Quick reference by hardware:
stable-diffusion-1.5, dreamshaper, pixart-sigmarealvisxl-v4, sana-1.5, flux.1-dev-gguf-q4ksflux.1-schnell, stable-diffusion-3.5-largepixart-sigma, dreamshaper, sdxl-turbo, sana-1.5curl -s http://localhost:8000/api/models | python3 -m json.tool
curl -s -X POST "http://localhost:8000/api/models/pull?model_name=dreamshaper"
This downloads model weights from HuggingFace. It may take several minutes depending on model size.
curl -s -X POST http://localhost:8000/api/models/load \
-H "Content-Type: application/json" \
-d '{"model_name": "dreamshaper"}'
curl -s http://localhost:8000/api/models/running
Use POST /api/generate with response_format set to b64_json to receive the image as base64 JSON:
curl -s -X POST http://localhost:8000/api/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "a serene mountain landscape at sunset, photorealistic",
"negative_prompt": "low quality, blurry, distorted",
"width": 1024,
"height": 1024,
"response_format": "b64_json"
}'
Response:
{
"image": "<base64-encoded PNG data>",
"format": "png",
"width": 1024,
"height": 1024
}
To save the image to a file, extract the image field and decode it:
curl -s -X POST http://localhost:8000/api/generate \
-H "Content-Type: application/json" \
-d '{"prompt": "a cute cat", "response_format": "b64_json"}' \
| python3 -c "import sys,json,base64; d=json.load(sys.stdin); open('output.png','wb').write(base64.b64decode(d['image']))"
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | required | Text description of the desired image |
negative_prompt | string | "low quality..." | What to avoid in the image |
width | int | 1024 | Image width in pixels |
height | int | 1024 | Image height in pixels |
steps | int | model default | Number of denoising steps (more = higher quality, slower) |
guidance_scale | float | model default | How closely to follow the prompt (higher = more literal) |
seed | int | random | Random seed for reproducible results |
response_format | string | null | Set to "b64_json" for base64 JSON response |
To generate an image from scratch on a new system:
# 1. Find the best model for this hardware
ollamadiffuser recommend
# 2. Start the API server
nohup ollamadiffuser --mode api > /dev/null 2>&1 &
sleep 3
# 3. Pull a model (dreamshaper is a good lightweight default)
curl -s -X POST "http://localhost:8000/api/models/pull?model_name=dreamshaper"
# 4. Load it into memory
curl -s -X POST http://localhost:8000/api/models/load \
-H "Content-Type: application/json" \
-d '{"model_name": "dreamshaper"}'
# 5. Generate an image
curl -s -X POST http://localhost:8000/api/generate \
-H "Content-Type: application/json" \
-d '{
"prompt": "a magical forest with glowing mushrooms, fantasy art",
"response_format": "b64_json"
}'
response_format: "b64_json" so you can process the image data programmatically/api/health before generating -- model_loaded must be trueseed for reproducible results when iterating on promptscurl -s http://localhost:8000/api/health