ALICE + SAM Integration
SAM uses ALICE as its local image and audio generation backend through ALICE's OpenAI-compatible API.
Overview
When you ask SAM to "generate an image" or "create a song," SAM calls ALICE's REST API endpoints. This integration is seamless, private, and requires no cloud services.
How It Works
- User asks SAM to generate media in a conversation
- SAM parses the request for generation parameters (model, dimensions, steps, etc.)
- SAM calls ALICE's API (
POST /v1/images/generationsor/v1/audio/generations) - ALICE processes the generation on local GPU
- ALICE returns the generated media URL or base64 data
- SAM displays the result inline in the conversation
Setup
- Ensure ALICE is running:
http://localhost:8080/healthreturns{"status": "ok"} - In SAM: Settings -> Image Generation -> Server URL:
http://localhost:8080 - Test connection in SAM settings
- Download at least one SD model in ALICE's web interface
Supported Generations
| Type | ALICE Endpoint | Models |
|---|---|---|
| Text-to-Image | POST /v1/images/generations |
SDXL, SD 1.5, FLUX, GGUF |
| Image-to-Image | POST /v1/images/edits |
All SD models with img2img support |
| Text-to-Audio | POST /v1/audio/generations |
Stable Audio Open 1.0, MiniMax Music 3 |
Parameters SAM Passes to ALICE
SAM automatically extracts these parameters from natural language:
- Model: "using SDXL", "with FLUX"
- Dimensions: "1024x1024", "portrait orientation"
- Steps: "30 steps", "high quality"
- Guidance Scale: "guidance 7.5"
- Sampler: "Euler a", "DPM++ 2M"
- LoRA: "anime style LoRA", "with character LoRA"
- Seed: "seed 42", "reproducible"
Privacy & Security
- No cloud: All generation happens on your hardware
- No logging: ALICE doesn't log prompts or generations by default
- Local API: Communication over localhost only
- Your models: Use any model you've downloaded
Troubleshooting
| Issue | Solution |
|---|---|
| SAM says "ALICE not connected" | Verify http://localhost:8080/health returns OK |
| Generation fails silently | Check ALICE logs: tail -f ~/Library/Logs/alice/alice.log (macOS) |
| Out of memory | Use smaller model (SD 1.5), reduce dimensions, enable CPU offload |
| Wrong model used | Set default model in ALICE settings; specify model in SAM request |
| Slow generation | Check GPU utilization; try different sampler; reduce steps |
See Also
- SAM + ALICE Integration - SAM perspective
- ALICE Web Interface - Studio, gallery, marketplace
- Model Management - Downloading and organizing models
- ALICE API Reference - Complete API documentation