Edit Your Images

Upload an image or generate one with AI, then drag points to transform it

💡 Tip: Click anywhere on the image to place control points, then drag them to transform the image

Complete API Setup Guide

Follow these step-by-step instructions to configure different image generation APIs. Your API keys are stored locally in your browser and never sent to our servers.

🤖

OpenAI DALL-E 3 & DALL-E 2

Step 1: Get Your API Key

  1. Visit OpenAI Platform
  2. Sign up or log in to your account
  3. Navigate to API Keys section in your account settings
  4. Click "Create new secret key"
  5. Copy the API key (you won't be able to see it again!)

Step 2: Configure in DragGAN

  1. Click "Generate with AI" button
  2. Click "Show Advanced Options"
  3. Select "OpenAI DALL-E 3" or "OpenAI DALL-E 2" from the dropdown
  4. Paste your API key in the "API Key" field
  5. Choose your preferred model (DALL-E 3 for HD quality, DALL-E 2 for faster generation)
  6. Select image size:
    • 1024x1024 - Square (recommended for DALL-E 3)
    • 1792x1024 - Wide format (DALL-E 3 only)
    • 1024x1792 - Tall format (DALL-E 3 only)
  7. Click "Save Configuration"
  8. (Optional) Click "Test API Connection" to verify your key works

Pricing Information

  • DALL-E 3: $0.040 per image (HD quality), $0.080 per image (standard quality)
  • DALL-E 2: $0.020 per image (1024x1024)
  • Check current pricing at OpenAI Pricing

Tips & Best Practices

  • DALL-E 3 produces higher quality images with better prompt understanding
  • DALL-E 2 is faster and more cost-effective for simple generations
  • Be descriptive in your prompts for best results
  • Set usage limits in OpenAI dashboard to control costs
🎨

Stability AI

Step 1: Get Your API Key

  1. Visit Stability AI Platform
  2. Sign up for a free account or log in
  3. Navigate to your Account Settings or API Keys section
  4. Generate a new API key
  5. Copy the API key securely

Step 2: Configure in DragGAN

  1. Click "Generate with AI" button
  2. Click "Show Advanced Options"
  3. Select "Stability AI" from the provider dropdown
  4. Paste your Stability AI API key
  5. Choose your model:
    • Stable Diffusion XL - Best quality, latest model
    • Stable Diffusion v1.6 - Faster, older version
  6. Click "Save Configuration"
  7. Test your connection with "Test API Connection"

Pricing Information

  • Free tier available with limited credits
  • Paid plans start at various tiers
  • Check current pricing at Stability AI Pricing

Tips & Best Practices

  • Stable Diffusion XL offers better quality and more control
  • Use detailed prompts with style keywords for best results
  • Monitor your credit usage in the Stability AI dashboard
⚙️

Custom API

Step 1: Prepare Your API

Your custom API endpoint should accept POST requests and return image data in one of these formats:

  • JSON response with {"data": [{"url": "image_url"}]} format (OpenAI-style)
  • JSON response with {"url": "image_url"} or {"image": "image_url"}
  • Direct image URL in the response

Step 2: Configure in DragGAN

  1. Click "Generate with AI" button
  2. Click "Show Advanced Options"
  3. Select "Custom API" from the provider dropdown
  4. Enter your API endpoint URL in "Custom API URL" field
    • Example: https://api.example.com/v1/generate
  5. Configure custom headers (JSON format):
    {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json",
      "X-Custom-Header": "value"
    }
  6. The request body sent to your API will be:
    {
      "prompt": "user's prompt text",
      "size": "1024x1024",
      "model": "selected model"
    }
  7. Click "Save Configuration"

API Requirements

  • Method: POST
  • Content-Type: application/json
  • Request Body: JSON with prompt, size, model fields
  • Response: JSON with image URL in data array or direct url/image field
  • CORS: Your API must allow requests from the DragGAN domain

Example Implementation

Your API should handle requests like this:

// Request
POST https://your-api.com/generate
Headers: {
  "Authorization": "Bearer YOUR_KEY",
  "Content-Type": "application/json"
}
Body: {
  "prompt": "a beautiful landscape",
  "size": "1024x1024",
  "model": "your-model"
}

// Response (format 1 - OpenAI style)
{
  "data": [{
    "url": "https://example.com/generated-image.png"
  }]
}

// Response (format 2 - Simple)
{
  "url": "https://example.com/generated-image.png"
}

Tips & Troubleshooting

  • Ensure your API endpoint is publicly accessible
  • Configure CORS headers to allow browser requests
  • Test your API with curl or Postman first
  • Check browser console for detailed error messages
  • Make sure authentication headers are properly formatted
💡

General Tips & Security

API Key Security

  • ✅ API keys are stored locally in your browser's localStorage
  • ✅ Keys are never sent to our servers - all requests go directly to the API provider
  • ✅ Use environment variables for production deployments
  • ✅ Never share or commit API keys to version control
  • ✅ Regularly rotate your API keys for security

Best Practices

  • Start with the free tier to test functionality
  • Set usage limits in your API provider dashboard
  • Monitor your API usage regularly
  • Use descriptive prompts for better image generation
  • Test API connection before generating images
  • Clear your configuration if you switch devices

Troubleshooting

  • 401 Unauthorized: Check your API key is correct and active
  • 403 Forbidden: Verify your API key has the necessary permissions
  • 429 Rate Limit: You've exceeded your API quota, wait or upgrade plan
  • CORS Error: Custom API must allow cross-origin requests
  • Timeout: Increase timeout or check your network connection
  • Invalid Response: Check API response format matches expected structure

Support Resources