diff --git a/docs/api/openai.md b/docs/api/openai.md
index 0ab7b97fa..84a69c569 100644
--- a/docs/api/openai.md
+++ b/docs/api/openai.md
@@ -677,7 +677,7 @@ Image Editing API. You provide a source image and a text prompt describing the d
| Parameter | Required | Description | Status |
|-----------|----------|-------------|--------|
| `model` | Yes | The Stable Diffusion model to use (e.g., `Flux-2-Klein-4B`, `SD-Turbo`). |  |
-| `image` | Yes | The source image file to edit (PNG). Sent as a file in multipart/form-data. |  |
+| `image` / `image[]` | Yes | The source image file to edit (PNG). Sent as a file in multipart/form-data. |  |
| `prompt` | Yes | A text description of the desired edit. |  |
| `mask` | No | An optional mask image (PNG). White areas indicate regions to edit; black areas are preserved. |  |
| `size` | No | The size of the output image. Format: `WIDTHxHEIGHT` (e.g., `512x512`). Default: `512x512`. |  |
diff --git a/src/cpp/server/server.cpp b/src/cpp/server/server.cpp
index b95176957..8206ebf74 100644
--- a/src/cpp/server/server.cpp
+++ b/src/cpp/server/server.cpp
@@ -2805,7 +2805,7 @@ bool Server::parse_n_from_form(const httplib::Request& req, httplib::Response& r
bool Server::extract_image_from_form(const httplib::Request& req, httplib::Response& res, nlohmann::json& out) {
for (const auto& file_pair : req.form.files) {
- if (file_pair.first == "image") {
+ if (file_pair.first == "image" || file_pair.first == "image[]") {
const auto& file = file_pair.second;
out["image_data"] = utils::JsonUtils::base64_encode(file.content);
out["image_filename"] = file.filename;
diff --git a/test/server_sd.py b/test/server_sd.py
index e09483a9b..0a327c276 100644
--- a/test/server_sd.py
+++ b/test/server_sd.py
@@ -664,6 +664,40 @@ def test_020_upscale_basic(self):
)
print(f"[OK] Upscale successful ({len(decoded)} bytes)")
+ def test_021_image_edit_array_field(self):
+ """Test basic image edit using array parameter syntax."""
+ png_bytes = create_minimal_png(256, 256)
+ print(f"[INFO] Sending image edit request with model {SD_MODEL}")
+
+ response = requests.post(
+ f"{self.base_url}/images/edits",
+ files={"image[]": ("test.png", io.BytesIO(png_bytes), "image/png")},
+ data={
+ "model": SD_MODEL,
+ "prompt": "A red circle",
+ "size": "256x256",
+ "n": "1",
+ "response_format": "b64_json",
+ },
+ timeout=TIMEOUT_MODEL_OPERATION,
+ )
+
+ self.assertEqual(
+ response.status_code,
+ 200,
+ f"Image edit failed with status {response.status_code}: {response.text}",
+ )
+
+ result = response.json()
+ self.assertIn("data", result, "Response should contain 'data' field")
+ self.assertGreater(
+ len(result["data"]), 0, "Data should have at least one image"
+ )
+ b64_data = result["data"][0]["b64_json"]
+ decoded = base64.b64decode(b64_data)
+ self.assertTrue(decoded[:4] == b"\x89PNG", "Result should be a valid PNG")
+ print(f"[OK] Image edit successful ({len(decoded)} bytes)")
+
if __name__ == "__main__":
run_server_tests(