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

# Qwen Image Edit LoRA

> Prompt-guided image editing API for one source image

## Overview

Qwen Image Edit LoRA is an asynchronous image-to-image editing model. Send one source image URL with a text prompt, then poll the task until the edited image is ready.

| Capability      | Value                      |
| --------------- | -------------------------- |
| Model ID        | `qwen-image-edit-LoRA`     |
| Mode            | `image-to-image`           |
| Input images    | Exactly 1 public image URL |
| Prompt          | Required                   |
| Optional seed   | Non-negative integer       |
| Result delivery | Async polling              |

## Endpoint and authentication

Base URL:

```text theme={null}
https://api.apixo.ai/api/v1
```

| Method | Endpoint                                           | Purpose                               |
| ------ | -------------------------------------------------- | ------------------------------------- |
| `POST` | `/generateTask/qwen-image-edit-LoRA`               | Submit an image editing task          |
| `GET`  | `/statusTask/qwen-image-edit-LoRA?taskId={taskId}` | Poll task status and retrieve results |

All requests require your APIXO API key:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

Submit requests also require:

```http theme={null}
Content-Type: application/json
```

## Copy-paste async quickstart

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/qwen-image-edit-LoRA" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "image-to-image",
      "prompt": "change the jacket color to deep red while keeping the background unchanged",
      "image_urls": [
        "https://example.com/source-image.png"
      ],
      "seed": 12345
    }
  }'
```

Successful response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

## Poll for result

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/qwen-image-edit-LoRA?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Processing response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
```

Success response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/edited-image.png\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
```

Parse `resultJson` after `state` becomes `success`:

```javascript theme={null}
const payload = JSON.parse(data.resultJson);
const imageUrls = payload.resultUrls;
```

## Request body

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-image",
    "prompt": "replace the sky with a soft sunset",
    "image_urls": [
      "https://example.com/source-image.jpg"
    ],
    "seed": 42
  }
}
```

## Parameters

<ParamField body="request_type" type="string" required default="async">
  Result delivery mode. Use `async` and poll with `statusTask`.
</ParamField>

<ParamField body="input" type="object" required>
  Qwen Image Edit LoRA input parameters.

  <Expandable title="properties">
    <ParamField body="mode" type="string" required>
      Generation mode. This model supports `image-to-image` only.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Editing instruction. Must be a non-empty string.
    </ParamField>

    <ParamField body="image_urls" type="string[]" required>
      Source image URLs. Must contain exactly 1 non-empty public image URL.
    </ParamField>

    <ParamField body="seed" type="integer">
      Optional random seed. Use a fixed non-negative integer seed for more reproducible experiments.
    </ParamField>
  </Expandable>
</ParamField>

## Response format

`POST /generateTask/qwen-image-edit-LoRA` returns a task ID when the task is accepted.

<ResponseField name="code" type="integer">
  API status code. `200` means the task was accepted.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseField name="data.taskId" type="string">
  Unique task identifier used with the status endpoint.
</ResponseField>

### Status response fields

<ResponseField name="taskId" type="string">
  Unique task identifier.
</ResponseField>

<ResponseField name="state" type="string">
  Current task state: `pending`, `processing`, `success`, or `failed`.
</ResponseField>

<ResponseField name="resultJson" type="string">
  JSON string containing edited image URLs in `resultUrls`. Present when `state` is `success`.
</ResponseField>

<ResponseField name="failCode" type="string">
  Machine-readable failure code. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="failMsg" type="string">
  Human-readable failure message. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="createTime" type="integer">
  Task creation timestamp in Unix milliseconds.
</ResponseField>

<ResponseField name="completeTime" type="integer">
  Task completion timestamp in Unix milliseconds. Present after completion when available.
</ResponseField>

<ResponseField name="costTime" type="integer">
  Processing duration in milliseconds when available.
</ResponseField>

## Billing

Qwen Image Edit LoRA is billed per generated image.

| Unit             | APIXO price      |
| ---------------- | ---------------- |
| One edited image | `$0.048 / image` |

For the current public price, see [Pricing](https://apixo.ai/pricing).

## Latency and polling

This endpoint is asynchronous. Actual latency varies by image complexity and current queue load.

| Use case            | Recommended first poll  | Poll interval |
| ------------------- | ----------------------- | ------------- |
| Standard image edit | 10s after task creation | 5s-10s        |

## Errors and troubleshooting

| Condition                 | What to do                                                     |
| ------------------------- | -------------------------------------------------------------- |
| Invalid or missing `mode` | Set `input.mode` to `image-to-image`                           |
| Missing or empty `prompt` | Send a non-empty edit instruction                              |
| Invalid `image_urls`      | Send exactly 1 public image URL                                |
| Invalid `seed`            | Use a non-negative integer                                     |
| Task stays `processing`   | Continue polling with backoff                                  |
| Task returns `failed`     | Check `failCode` and `failMsg`, then adjust the input or retry |

See [Error Codes](/docs/api-reference/errors) for the full error reference.

## Related links

* [Generation API Overview](/docs/models)
* [Generate Task](/docs/api-reference/generate-task)
* [Status Task](/docs/api-reference/status-task)
* [Error Codes](/docs/api-reference/errors)
* [Parameter Specification](/docs/api-reference/parameters)
* [Pricing](https://apixo.ai/pricing)
