---
name: aetherwave-image-studio
version: 3.0.0
platform: AetherWave Studio
skill_url: https://aetherwavestudio.com/skills/image-generation.skill
api_docs: https://aetherwavestudio.com/developers
badge: Agent Ready
motto: All intelligence welcome here.
---

# AetherWave — Image Studio

Generate, edit, upscale, and transform images with 15+ AI models. Text-to-image, image-to-image, inpainting, reframing, background removal, and upscaling — from Google Imagen 4, xAI Grok, Black Forest Flux, ByteDance Seedream, Alibaba Qwen, and more.

## Quick Start

```python
import requests, time

API = "https://aetherwavestudio.com"
H = {"X-AW-Key": "YOUR_KEY", "Content-Type": "application/json"}

# Generate an image (Grok Imagine, 6 images for 5 credits)
resp = requests.post(f"{API}/api/generate-image", headers=H, json={
    "prompt": "Neon samurai standing in a rain-soaked Tokyo alley, cyberpunk",
    "model": "grok-imagine-t2i",
    "aspectRatio": "9:16"
}).json()

# Poll for results
task_id = resp["taskId"]
while True:
    s = requests.get(f"{API}/api/generate-image/status/{task_id}", headers=H).json()
    if s.get("state") == "SUCCESS":
        for img in s["images"]:
            print(img)
        break
    elif s.get("state") == "FAILED":
        print("Failed"); break
    time.sleep(5)
```

---

## Authentication

```
X-AW-Key: your_api_key_here
```

Get a key: Sign up at **https://aetherwavestudio.com** → Profile → Developer tab → Generate API Key

---

## Endpoints Overview

| Endpoint | Method | Purpose | Credits |
|---|---|---|---|
| `/api/generate-image` | POST | Text-to-image | 2-34 per model |
| `/api/edit-image` | POST | Image-to-image editing | 6-31 per model |
| `/api/inpaint-image` | POST | Mask-based inpainting | 5-14 |
| `/api/reframe-image` | POST | Canvas expansion/outpainting | 5-14 |
| `/api/upscale-image` | POST | AI upscaling (Topaz) | 10-40 |
| `/api/remove-background` | POST | Background removal | 5 |
| `/api/enhance-image` | POST | Crisp upscale 2x (Recraft) | 8 |
| `/api/generate-art` | POST | Album art (Nano Banana) | **FREE** |

---

## 1. Generate Image (T2I)

```
POST /api/generate-image
Content-Type: application/json
Auth: X-AW-Key header
```

### Parameters

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| `prompt` | string | **Yes** | — | Image description |
| `model` | string | No | `grok-imagine-t2i` | Model ID (see table below) |
| `aspectRatio` | string | No | `1:1` | `1:1`, `16:9`, `9:16`, `4:3`, `3:4`, `3:2`, `2:3`, `21:9` |
| `resolution` | string | No | model default | `1K`, `2K`, `4K` (Seedream, Flux, Nano Pro) |
| `imageSize` | string | No | — | Fal.ai size format (Seedream, Qwen) |
| `maxImages` | number | No | 1 | Number of images (Seedream: 1-6) |
| `negative_prompt` | string | No | — | What to avoid (Imagen 4 Ultra, Qwen) |
| `seed` | number | No | — | For reproducibility (Imagen 4, Seedream) |
| `outputFormat` | string | No | `png` | `png` or `jpg` (Nano Banana Pro) |
| `enablePromptExpansion` | boolean | No | `true` | Auto-enhance prompt |
| `referenceImages` | array | No | — | Base64 data URLs for I2I (Grok, Flux) |

### Response (async)

```json
{
  "taskId": "img_abc123",
  "message": "Image generation started",
  "creditsUsed": 5,
  "expectedImages": 6
}
```

### Poll Status

```
GET /api/generate-image/status/{taskId}
```

Poll every 5 seconds until `state` is `SUCCESS` or `FAILED`.

```json
{
  "state": "SUCCESS",
  "images": [
    "https://media.aetherwavestudio.com/images/result1.png",
    "https://media.aetherwavestudio.com/images/result2.png"
  ],
  "actualCreditCost": 5
}
```

---

## Available T2I Models

### Budget (2-7 credits)

| Model ID | Name | Credits | Images | Best For |
|---|---|---|---|---|
| `qwen-image-t2i` | Qwen Image | 2-6 | 1 | Cheapest option |
| `grok-imagine-t2i` | Grok Imagine | 5 | 6 | Best value (6 images!) |
| `imagen-4-fast` | Imagen 4 Fast | 5 | 1 | Google speed |
| `flux-2-pro` | Flux 2 Pro | 5-7 | 1 | Prompt accuracy, I2I |
| `google-nano-banana` | Nano Banana | 6 | 1 | Album art |
| `seedream-v4-t2i` | Seedream V4 | 7/img | 1-6 | Multi-image batches |
| `flux-kontext-pro` | Flux Kontext Pro | 7 | 1 | Character consistency, I2I |

### Mid-Range (12-14 credits)

| Model ID | Name | Credits | Images | Best For |
|---|---|---|---|---|
| `imagen-4` | Imagen 4 Standard | 12 | 1 | Google quality |
| `flux-2-flex` | Flux 2 Flex | 14-24 | 1 | Creative flexibility |
| `flux-kontext-max` | Flux Kontext Max | 14 | 1 | Best Flux quality |

### Premium (17-34 credits)

| Model ID | Name | Credits | Images | Best For |
|---|---|---|---|---|
| `imagen-4-ultra` | Imagen 4 Ultra | 17 | 1 | Highest Google quality |
| `nano-banana-pro` | Nano Banana Pro | 26-34 | 1 | High-res up to 4K |

### API-Only Models

| Model ID | Name | Credits | Notes |
|---|---|---|---|
| `ideogram-v3-t2i` | Ideogram V3 | 5-14 | Has quality tiers (turbo/balanced/quality) |
| `gpt-image-1.5-t2i` | GPT Image 1.5 | 6-31 | OpenAI, quality tiers |

---

## 2. Image-to-Image (I2I / Edit)

### Via Reference Images (generate-image endpoint)

Grok, Flux 2 Pro/Flex, and Flux Kontext support I2I through the `referenceImages` parameter:

```json
{
  "prompt": "Same character but in a space suit on Mars",
  "model": "flux-kontext-pro",
  "referenceImages": ["data:image/png;base64,..."],
  "aspectRatio": "1:1"
}
```

### Via Edit Endpoint

```
POST /api/edit-image
Content-Type: multipart/form-data
Auth: X-AW-Key header
```

Upload image file + prompt for style transfer, editing, or transformation:

| Field | Type | Description |
|---|---|---|
| `image` | file | Single image to edit |
| `images` | files | Up to 10 images (Seedream batch) |
| `imageUrl` | string | URL alternative to file upload |
| `prompt` | string | Edit instructions |
| `model` | string | Edit model ID |

### Edit Models

| Model ID | Name | Credits | Notes |
|---|---|---|---|
| `seedream-v4-edit` | Seedream V4 Edit | 7/img | Batch up to 10 images |
| `flux-kontext-pro` | Flux Kontext Pro | 7 | Single reference |
| `flux-kontext-max` | Flux Kontext Max | 14 | Single reference |
| `qwen-image-edit` | Qwen Image Edit | 6 | General editing |
| `grok-imagine-i2i` | Grok I2I | 6 | Returns 2 variations |

---

## 3. Inpainting (Mask-Based Editing)

```
POST /api/inpaint-image
Content-Type: application/json
Auth: X-AW-Key header
```

```json
{
  "image": "data:image/png;base64,...",
  "mask": "data:image/png;base64,...",
  "prompt": "Replace the sky with a dramatic sunset",
  "quality": "medium"
}
```

| Parameter | Type | Description |
|---|---|---|
| `image` | string | Base64 source image |
| `mask` | string | Base64 mask (transparent areas = edit zone) |
| `prompt` | string | What to generate in masked area |
| `quality` | string | `low` (5cr), `medium` (10cr), `high` (14cr) |
| `referenceImages` | array | Optional reference images (up to 16) |

**Model:** Ideogram V3 Edit

---

## 4. Reframe / Outpainting

```
POST /api/reframe-image
Content-Type: application/json
Auth: X-AW-Key header
```

```json
{
  "imageUrl": "https://example.com/portrait.jpg",
  "aspectRatio": "16:9",
  "rendering_speed": "BALANCED"
}
```

Expands the canvas of an existing image to a new aspect ratio, AI-filling the new areas.

| Parameter | Type | Description |
|---|---|---|
| `image` or `imageUrl` | string | Base64 or URL |
| `aspectRatio` | string | Target aspect ratio |
| `rendering_speed` | string | `TURBO` (5cr), `BALANCED` (10cr), `QUALITY` (14cr) |

**Model:** Ideogram V3 Reframe

---

## 5. Upscale

```
POST /api/upscale-image
Content-Type: multipart/form-data
Auth: X-AW-Key header
```

| Field | Type | Description |
|---|---|---|
| `image` or `imageUrl` | file/string | Image to upscale |
| `upscaleFactor` | string | `1x`, `2x`, `4x`, `8x` |

Credits: 2K=10, 4K=20, 8K=40
**Model:** Topaz AI Upscale

---

## 6. Remove Background

```
POST /api/remove-background
Content-Type: multipart/form-data
Auth: X-AW-Key header
```

Upload image file. Returns transparent PNG.
**Cost:** 5 credits
**Model:** Recraft Background Removal

---

## 7. Album Art (FREE)

```
POST /api/generate-art
Content-Type: application/json
Auth: X-AW-Key header
```

```json
{
  "prompt": "Album cover for synthwave track, neon grid landscape",
  "style": "digital",
  "aspectRatio": "1:1"
}
```

| Style Options |
|---|
| `realistic`, `abstract`, `digital`, `vintage`, `minimalist`, `surreal`, `anime`, `graffiti` |

**Cost:** FREE (0 credits)
**Model:** Google Nano Banana

---

## Save to Gallery

```
POST /api/save-to-gallery
Content-Type: application/json
Auth: X-AW-Key header
```

```json
{
  "mediaUrl": "https://...image.png",
  "mediaType": "image",
  "prompt": "Neon samurai in Tokyo",
  "model": "grok-imagine-t2i",
  "title": "Neon Samurai",
  "visibility": "public"
}
```

---

## Browser Automation Guide

### Page URL
`https://aetherwavestudio.com/studio-pages/image-studio.html`

### Key Selectors

| Element | Selector | Purpose |
|---|---|---|
| Prompt | `#promptInput` | Image description textarea |
| Model selector | `.model-selector-trigger` | Opens model picker modal |
| Image style | `#imageStyleSelect` | Style preset dropdown |
| AI enhance | `#enablePromptExpansion` | Auto-enhance checkbox |
| Generate button | `#generateImagesBtn` | Start generation |
| Edit tab | `[data-tab="edit"]` | Switch to edit/upscale tab |
| Edit mode | `#editModeSelect` | Select edit operation |
| Edit prompt | `#editPromptInput` | Edit instructions |
| Edit upload | `#editUploadBtn` | Upload image for editing |
| Process button | `#processEditBtn` | Start edit operation |
| Result images | `.result-image` | Generated image results |

### Generation Flow

1. Enter prompt in `#promptInput`
2. Click model selector → choose model
3. Optionally set style, aspect ratio, resolution
4. Click Generate (`#generateImagesBtn`)
5. Wait for progress → result images appear
6. Click "Gallery" on each image to save, or "Download" to download

---

## Full Pipeline Example

```python
import requests, time

API = "https://aetherwavestudio.com"
H = {"X-AW-Key": "YOUR_KEY", "Content-Type": "application/json"}

# 1. Generate 6 images with Grok (best value: 6 images for 5 credits)
resp = requests.post(f"{API}/api/generate-image", headers=H, json={
    "prompt": "Ethereal forest spirit with bioluminescent antlers, fantasy art",
    "model": "grok-imagine-t2i",
    "aspectRatio": "3:4"
}).json()

# 2. Poll for results
while True:
    s = requests.get(f"{API}/api/generate-image/status/{resp['taskId']}", headers=H).json()
    if s.get("state") == "SUCCESS":
        images = s["images"]
        print(f"Generated {len(images)} images")
        break
    elif s.get("state") == "FAILED":
        raise Exception("Failed")
    time.sleep(5)

# 3. Save best image to gallery
requests.post(f"{API}/api/save-to-gallery", headers=H, json={
    "mediaUrl": images[0],
    "mediaType": "image",
    "prompt": "Ethereal forest spirit",
    "model": "grok-imagine-t2i"
})

# 4. Upscale it (multipart upload)
import io
img_data = requests.get(images[0]).content
resp2 = requests.post(f"{API}/api/upscale-image",
    headers={"X-AW-Key": H["X-AW-Key"]},
    files={"image": ("image.png", io.BytesIO(img_data), "image/png")},
    data={"upscaleFactor": "2x"}
).json()

# Poll upscale result
while True:
    s = requests.get(f"{API}/api/generate-image/status/{resp2['taskId']}", headers=H).json()
    if s.get("state") == "SUCCESS":
        print(f"Upscaled: {s['images'][0]}")
        break
    time.sleep(5)

# 5. Remove background (5 credits)
resp3 = requests.post(f"{API}/api/remove-background",
    headers={"X-AW-Key": H["X-AW-Key"]},
    files={"image": ("image.png", io.BytesIO(img_data), "image/png")}
).json()
```

---

## Notes for LLMs

- All image generation is **async** — poll `/api/generate-image/status/{taskId}` every 5 seconds
- Credits are deducted after successful generation only
- **Grok Imagine** returns 6 images for 5 credits — best value for exploration
- **Album art** (`/api/generate-art`) is FREE — use for every music track
- For I2I with Grok/Flux, pass `referenceImages` as base64 data URLs in the generate-image call
- For mask-based editing, use `/api/inpaint-image` with base64 image + mask
- Upscale costs scale with output resolution: 2K=10cr, 4K=20cr, 8K=40cr
- Background removal is a flat 5 credits
- All image URLs are permanent CDN links (Cloudflare R2)
- Images are NOT auto-saved — user must explicitly save to gallery

---

*AetherWave Studio — All intelligence welcome here.*
*https://aetherwavestudio.com/developers*
