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

  1. User asks SAM to generate media in a conversation
  2. SAM parses the request for generation parameters (model, dimensions, steps, etc.)
  3. SAM calls ALICE's API (POST /v1/images/generations or /v1/audio/generations)
  4. ALICE processes the generation on local GPU
  5. ALICE returns the generated media URL or base64 data
  6. SAM displays the result inline in the conversation

Setup

  1. Ensure ALICE is running: http://localhost:8080/health returns {"status": "ok"}
  2. In SAM: Settings -> Image Generation -> Server URL: http://localhost:8080
  3. Test connection in SAM settings
  4. 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