تخطَّ إلى المحتوى

Image-Generation

هذا المحتوى غير متوفر بلغتك بعد.

ɳClaw supports multi-provider image generation. You can generate images from text prompts through the chat interface or the API, and browse results in the image gallery.

Route: /gallery in claw-web API: POST /claw/image/generate


ProviderEnv VarNotes
DALL-E (default)OPENAI_API_KEYOpenAI’s image model
Stable DiffusionSD_API_URLSelf-hosted or API
MidjourneyMJ_API_KEYVia proxy API

Set CLAW_IMAGE_PROVIDER in your .env to choose the default provider. Users can override per-request.

  1. Send a prompt via chat or POST /claw/image/generate
  2. The request enters the job queue (np_claw.image_jobs table)
  3. The selected provider processes the request
  4. Results appear in the gallery and in the chat thread
POST /claw/image/generate
Content-Type: application/json
Authorization: Bearer {token}
{
"prompt": "A sunset over mountains in watercolor style",
"provider": "dall-e",
"size": "1024x1024"
}
GET /claw/image/jobs

Returns all generation jobs with status (queued, processing, complete, failed).

GET /claw/image/jobs/{id}

Returns job details including the generated image URL when complete.

The /gallery route in claw-web shows all generated images as cards. Each card displays the prompt, provider, timestamp, and a zoomable preview.

Env VarDefaultDescription
CLAW_IMAGE_PROVIDERdall-eDefault provider
OPENAI_API_KEYRequired for DALL-E
SD_API_URLStable Diffusion endpoint
MJ_API_KEYMidjourney proxy key