> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apimart.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# wan2.7 Bildgenerierung und -bearbeitung

>  - Wan2.7-Bildserie: unterstützt Text-zu-Bild, Bildbearbeitung, interaktive Bearbeitung, sequenzielle Generierung und mehrere Referenzbilder
- Asynchroner Verarbeitungsmodus — Aufgabe einreichen und Ergebnisse mit der zurückgegebenen task_id abfragen
- Unterstützt 1K- / 2K- / 4K-Auflösung; wan2.7-image-pro unterstützt bis zu 4K für Text-zu-Bild
- Die Abrechnung basiert auf der Anzahl der erfolgreich generierten Bilder, unabhängig von Auflösung oder Seitenverhältnis 

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/images/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "wan2.7-image-pro",
      "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.apimart.ai/v1/images/generations"

  payload = {
      "model": "wan2.7-image-pro",
      "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.apimart.ai/v1/images/generations";

  const payload = {
    model: "wan2.7-image-pro",
    prompt: "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
  };

  const headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "net/http"
  )

  func main() {
      url := "https://api.apimart.ai/v1/images/generations"

      payload := map[string]interface{}{
          "model":  "wan2.7-image-pro",
          "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display",
      }

      jsonData, _ := json.Marshal(payload)

      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer <token>")
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;

  public class Main {
      public static void main(String[] args) throws Exception {
          String payload = """
          {
            "model": "wan2.7-image-pro",
            "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
          }
          """;

          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create("https://api.apimart.ai/v1/images/generations"))
              .header("Authorization", "Bearer <token>")
              .header("Content-Type", "application/json")
              .POST(HttpRequest.BodyPublishers.ofString(payload))
              .build();

          System.out.println(client.send(request,
              HttpResponse.BodyHandlers.ofString()).body());
      }
  }
  ```

  ```php PHP theme={null}
  <?php

  $url = "https://api.apimart.ai/v1/images/generations";

  $payload = [
      "model" => "wan2.7-image-pro",
      "prompt" => "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer <token>",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  url = URI("https://api.apimart.ai/v1/images/generations")

  payload = {
    model: "wan2.7-image-pro",
    prompt: "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
  }

  http = Net::HTTP.new(url.host, url.port)
  http.use_ssl = true

  request = Net::HTTP::Post.new(url)
  request["Authorization"] = "Bearer <token>"
  request["Content-Type"] = "application/json"
  request.body = payload.to_json

  response = http.request(request)
  puts response.body
  ```

  ```swift Swift theme={null}
  import Foundation

  let url = URL(string: "https://api.apimart.ai/v1/images/generations")!

  let payload: [String: Any] = [
      "model": "wan2.7-image-pro",
      "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
  ]

  var request = URLRequest(url: url)
  request.httpMethod = "POST"
  request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
  request.setValue("application/json", forHTTPHeaderField: "Content-Type")
  request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

  let task = URLSession.shared.dataTask(with: request) { data, response, error in
      if let error = error { print("Error: \(error)"); return }
      if let data = data, let str = String(data: data, encoding: .utf8) { print(str) }
  }
  task.resume()
  ```

  ```csharp C# theme={null}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main(string[] args)
      {
          var payload = @"{
              ""model"": ""wan2.7-image-pro"",
              ""prompt"": ""A flower shop with exquisite windows, beautiful wooden door, flowers on display""
          }";

          using var client = new HttpClient();
          client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");

          var content = new StringContent(payload, Encoding.UTF8, "application/json");
          var response = await client.PostAsync(
              "https://api.apimart.ai/v1/images/generations", content);
          Console.WriteLine(await response.Content.ReadAsStringAsync());
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": "success",
    "data": [
      {
        "task_id": "task_01HX...",
        "status": "processing"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed. Please check your API key.",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient balance. Please top up your account.",
      "type": "payment_required"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "Too many requests. Please try again later.",
      "type": "rate_limit_error"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "Internal server error. Please try again later.",
      "type": "server_error"
    }
  }
  ```
</ResponseExample>

## Autorisierung

<ParamField header="Authorization" type="string" required>
  Alle Anfragen erfordern eine Bearer-Token-Authentifizierung.

  Besuchen Sie die [API-Key-Verwaltungsseite](https://apimart.ai/keys), um Ihren API-Key zu erhalten, und fügen Sie ihn dann dem Request-Header hinzu:

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Verfügbare Modelle

| Modell             | Beschreibung                                          | Max. Auflösung (Text-zu-Bild) | Max. Auflösung (Bearbeitung / Sequenziell) | Preis        |
| ------------------ | ----------------------------------------------------- | :---------------------------: | :----------------------------------------: | ------------ |
| `wan2.7-image-pro` | Professional Edition, bessere Details, unterstützt 4K |               4K              |                     2K                     | ¥0,50 / Bild |
| `wan2.7-image`     | Standard Edition, schnellere Generierung              |               2K              |                     2K                     | ¥0,20 / Bild |

<Note>
  Die Abrechnung erfolgt nach **erfolgreich generierte Bilder × Stückpreis**. Eingaben werden nicht abgerechnet. Auflösung und Seitenverhältnis beeinflussen den Preis nicht. Fehlgeschlagene Anfragen werden nicht berechnet.
</Note>

## Body

<ParamField body="model" type="string" required>
  Name des Bildgenerierungsmodells.

  * `wan2.7-image-pro` — Professional Edition, bis zu 4K für Text-zu-Bild
  * `wan2.7-image` — Standard Edition, schneller, bis zu 2K
</ParamField>

<ParamField body="prompt" type="string">
  Textbeschreibung für die Bildgenerierung, bis zu 5000 Zeichen.

  * **Text-zu-Bild** (ohne `image_urls`): erforderlich
  * **Bildbearbeitung** (mit `image_urls`): optional, aber empfohlen

  Beispiel: `"A flower shop with exquisite windows, beautiful wooden door, flowers on display"`
</ParamField>

<ParamField body="image_urls" type="array<string>">
  Array von Eingabebild-URLs für Bearbeitung und Mehrbild-Referenzszenarien.

  Die Angabe dieses Feldes schaltet die Anfrage in den **Bildbearbeitungsmodus**.

  **Unterstützte Formate:** HTTP/HTTPS-URLs; `data:image/...;base64,...` Base64

  **Einschränkungen:** Bis zu 9 Bilder; JPEG / PNG / WEBP / BMP; 240–8000 px, Seitenverhältnis 1:8 \~ 8:1; ≤ 20 MB pro Bild

  <Note>
    Das Ausgabe-Seitenverhältnis entspricht automatisch dem **letzten** Eingabebild. Der Bearbeitungsmodus unterstützt nur bis zu 2K — 4K ist nicht verfügbar.
  </Note>
</ParamField>

<ParamField body="n" type="integer" default="1">
  Anzahl der zu generierenden Bilder.

  * **Standardmodus**: 1–4 (Standard 1)
  * **Sequenzieller Modus** (`enable_sequential: true`): 1–12 (Standard 1)

  <Note>Abrechnung pro erfolgreich generiertem Bild. Vorausberechnung basierend auf `n`.</Note>
</ParamField>

<ParamField body="size" type="string">
  Ausgabeauflösung oder Seitenverhältnis. Unterstützt drei Formate:

  **① Auflösungsschlüsselwort (empfohlen):** `1K` / `2K` (Standard) / `4K` (nur Text-zu-Bild für `wan2.7-image-pro`)

  **② Seitenverhältnis:** `1:1` / `16:9` / `9:16` / `4:3` / `3:4` / `3:2` / `2:3` (standardmäßig 2K-Stufe)

  **③ Pixelmaße:** `1024x1024` oder `1024*1024`
</ParamField>

<ParamField body="resolution" type="string">
  Schlüsselwort für die Auflösungsstufe: `1K` / `2K` / `4K`. Kann mit `size` (Seitenverhältnis) kombiniert werden.

  | Modell             | Szenario                         | Unterstützte Stufen | Pixelbereich         |
  | ------------------ | -------------------------------- | :-----------------: | -------------------- |
  | `wan2.7-image-pro` | Text-zu-Bild (nicht sequenziell) |   1K / **2K** / 4K  | 768×768 \~ 4096×4096 |
  | `wan2.7-image-pro` | Bearbeitung / Sequenziell        |     1K / **2K**     | 768×768 \~ 2048×2048 |
  | `wan2.7-image`     | Alle Szenarien                   |     1K / **2K**     | 768×768 \~ 2048×2048 |
</ParamField>

<ParamField body="negative_prompt" type="string">
  Negativer Prompt, der zu vermeidende Elemente beschreibt. Beispiel: `"blurry, distorted, low quality"`
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  Ob ein "AI Generated"-Wasserzeichen in der unteren rechten Ecke hinzugefügt werden soll.
</ParamField>

<ParamField body="seed" type="integer">
  Zufallsseed, Bereich 0–2147483647. Derselbe Seed mit identischen Parametern erzeugt visuell konsistente Ergebnisse.
</ParamField>

<ParamField body="thinking_mode" type="boolean" default="true">
  Aktiviert den erweiterten Reasoning-Modus, um die Bildqualität auf Kosten einer längeren Generierungszeit zu verbessern.

  <Note>Nur wirksam, wenn **der sequenzielle Modus deaktiviert** ist und **keine Bildeingabe** bereitgestellt wird.</Note>
</ParamField>

<ParamField body="enable_sequential" type="boolean" default="false">
  Aktiviert den **sequenziellen Bildgenerierungsmodus** — generiert mehrere thematisch zusammenhängende Bilder in einer Anfrage. Ideal für Storyboards und Serien.

  * Maximum `n` ist 12 bei Aktivierung
  * `thinking_mode` und `color_palette` werden im sequenziellen Modus ignoriert
  * `wan2.7-image-pro` unterstützt im sequenziellen Modus bis zu 2K (4K nicht unterstützt)
</ParamField>

<ParamField body="bbox_list" type="array">
  Begrenzungsrahmen für interaktive Bearbeitung — gibt genaue Bereiche zum Bearbeiten oder Einfügen von Inhalten an.

  **Struktur:** `[[[x1, y1, x2, y2], ...], ...]`

  * Die Länge des äußeren Arrays muss der Länge von `image_urls` entsprechen
  * Übergeben Sie `[]` für Bilder ohne Begrenzungsrahmen
  * Maximal 2 Rahmen pro Bild; Koordinaten sind absolute Pixelwerte, Ursprung (0,0) oben links

  Beispiel: `[[], [[989, 515, 1138, 681]]]`
</ParamField>

<ParamField body="color_palette" type="array<object>">
  Benutzerdefiniertes Farbthema. **Nur Standardmodus** (nicht sequenzieller Modus).

  * 3–10 Einträge (8 empfohlen); jeder Eintrag erfordert `hex` und `ratio`
  * Die Summe aller `ratio`-Werte muss genau `100.00%` ergeben

  ```json theme={null}
  [
    { "hex": "#C2D1E6", "ratio": "23.51%" },
    { "hex": "#636574", "ratio": "76.49%" }
  ]
  ```
</ParamField>

## Response

<ResponseField name="code" type="string">
  Antwortstatus. Gibt bei Erfolg `"success"` zurück.
</ResponseField>

<ResponseField name="data" type="array">
  <Expandable title="Array-Elemente">
    <ResponseField name="task_id" type="string">
      Eindeutige Aufgaben-ID, mit der Generierungsergebnisse abgefragt werden.
    </ResponseField>

    <ResponseField name="status" type="string">
      Anfänglicher Aufgabenstatus, beim Einreichen immer `processing`.
    </ResponseField>
  </Expandable>
</ResponseField>

## Beispiele

### Text-zu-Bild (minimal)

```json theme={null}
{
  "model": "wan2.7-image-pro",
  "prompt": "A flower shop with exquisite windows, beautiful wooden door, flowers on display"
}
```

### Text-zu-Bild (mit Auflösung)

```json theme={null}
{
  "model": "wan2.7-image-pro",
  "prompt": "Summer beach, blue sky and white clouds, 4K ultra HD",
  "size": "4K",
  "thinking_mode": true
}
```

### Text-zu-Bild (benutzerdefinierte Farbpalette)

```json theme={null}
{
  "model": "wan2.7-image-pro",
  "prompt": "Minimalist modern living room",
  "size": "2K",
  "color_palette": [
    { "hex": "#C2D1E6", "ratio": "23.51%" },
    { "hex": "#CDD8E9", "ratio": "20.13%" },
    { "hex": "#B5C8DB", "ratio": "15.88%" },
    { "hex": "#C0B5B4", "ratio": "13.27%" },
    { "hex": "#DAE0EC", "ratio": "10.11%" },
    { "hex": "#636574", "ratio": "8.93%" },
    { "hex": "#CACAD2", "ratio": "5.55%" },
    { "hex": "#CBD4E4", "ratio": "2.62%" }
  ]
}
```

### Sequenzielle Bildgenerierung

```json theme={null}
{
  "model": "wan2.7-image-pro",
  "prompt": "Cinematic series: the same stray orange cat, consistent features. First: under cherry blossoms in spring. Second: old street shade in summer. Third: fallen leaves in autumn. Fourth: snow footprints in winter.",
  "enable_sequential": true,
  "n": 4,
  "size": "2K"
}
```

### Einzelbildbearbeitung

```json theme={null}
{
  "model": "wan2.7-image",
  "prompt": "Replace the background with a sunset scene, warm color tones",
  "image_urls": ["https://example.com/portrait.jpg"],
  "size": "2K"
}
```

### Mehrbild-Referenz / Elementfusion

```json theme={null}
{
  "model": "wan2.7-image-pro",
  "prompt": "Apply the graffiti from image 2 onto the car in image 1",
  "image_urls": [
    "https://example.com/car.webp",
    "https://example.com/paint.webp"
  ],
  "size": "2K"
}
```

### Interaktive Bearbeitung (Begrenzungsrahmen)

`bbox_list` entspricht 1:1 dem `image_urls`. Übergeben Sie `[]` für Bilder ohne Auswahl.

```json theme={null}
{
  "model": "wan2.7-image-pro",
  "prompt": "Place the alarm clock from image 1 into the selected area of image 2, blending naturally",
  "image_urls": [
    "https://example.com/clock.webp",
    "https://example.com/desk.webp"
  ],
  "bbox_list": [
    [],
    [[989, 515, 1138, 681]]
  ],
  "size": "2K"
}
```

<Note>
  **Ergebnisse abfragen**

  Die Bildgenerierung erfolgt asynchron. Fragen Sie den [Aufgabenstatus](/de/api-reference/tasks/status)-Endpunkt mit der zurückgegebenen `task_id` ab, bis `status == completed`.
</Note>
