Skip to content

Commit 61634bc

Browse files
docs: add alibaba/qwen-image-3-edit (#441)
1 parent 3daeff9 commit 61634bc

4 files changed

Lines changed: 347 additions & 1 deletion

File tree

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,7 @@
362362
* [Qwen Image 2.0](api-references/image-models/alibaba-cloud/qwen-image-2.0.md)
363363
* [Qwen Image 2.0 Pro](api-references/image-models/alibaba-cloud/qwen-image-2.0-pro.md)
364364
* [Qwen Image 3](api-references/image-models/Alibaba-Cloud/qwen-image-3.md)
365+
* [Qwen Image 3 Edit](api-references/image-models/Alibaba-Cloud/qwen-image-3-edit.md)
365366
* [Beeble](api-references/image-models/Beeble/README.md)
366367
* [Switchx Image To Image](api-references/image-models/Beeble/switchx-image-to-image.md)
367368
* [ByteDance](api-references/image-models/bytedance/README.md)
Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
{
2+
"openapi": "3.0.0",
3+
"info": {
4+
"title": "AIML API",
5+
"version": "1.0.0"
6+
},
7+
"servers": [
8+
{
9+
"url": "https://api.aimlapi.com"
10+
}
11+
],
12+
"paths": {
13+
"/v1/images/generations": {
14+
"post": {
15+
"operationId": "_v1_images_generations",
16+
"requestBody": {
17+
"required": true,
18+
"content": {
19+
"application/json": {
20+
"schema": {
21+
"type": "object",
22+
"properties": {
23+
"model": {
24+
"type": "string",
25+
"enum": [
26+
"alibaba/qwen-image-3-edit"
27+
]
28+
},
29+
"prompt": {
30+
"type": "string",
31+
"maxLength": 800,
32+
"description": "The text prompt describing the content, style, or composition of the image to be generated."
33+
},
34+
"image_urls": {
35+
"type": "array",
36+
"items": {
37+
"type": "string",
38+
"format": "uri"
39+
},
40+
"minItems": 1,
41+
"maxItems": 3,
42+
"description": "List of URLs or local Base64 encoded images to edit."
43+
},
44+
"image_size": {
45+
"anyOf": [
46+
{
47+
"type": "object",
48+
"properties": {
49+
"width": {
50+
"type": "integer",
51+
"minimum": 384,
52+
"maximum": 2048,
53+
"default": 1024
54+
},
55+
"height": {
56+
"type": "integer",
57+
"minimum": 384,
58+
"maximum": 2048,
59+
"default": 1024
60+
}
61+
},
62+
"description": "For both height and width, the value must be a multiple of 32."
63+
},
64+
{
65+
"type": "string",
66+
"enum": [
67+
"square_hd",
68+
"square",
69+
"portrait_4_3",
70+
"portrait_16_9",
71+
"landscape_4_3",
72+
"landscape_16_9"
73+
],
74+
"description": "The size of the generated image."
75+
}
76+
],
77+
"description": "Size of the generated image. Defaults to the size of the first input image."
78+
},
79+
"negative_prompt": {
80+
"type": "string",
81+
"maxLength": 500,
82+
"description": "The description of elements to avoid in the generated image."
83+
},
84+
"num_images": {
85+
"type": "integer",
86+
"minimum": 1,
87+
"maximum": 4,
88+
"default": 1,
89+
"description": "The number of images to generate."
90+
},
91+
"output_format": {
92+
"type": "string",
93+
"enum": [
94+
"jpeg",
95+
"png",
96+
"webp"
97+
],
98+
"default": "png",
99+
"description": "The format of the generated image."
100+
},
101+
"seed": {
102+
"type": "integer",
103+
"minimum": 0,
104+
"maximum": 2147483647,
105+
"description": "The same seed and the same prompt given to the same version of the model will output the same image every time."
106+
},
107+
"enable_prompt_expansion": {
108+
"type": "boolean",
109+
"default": true,
110+
"description": "If set to True, prompt will be upsampled with more details."
111+
},
112+
"enable_safety_checker": {
113+
"type": "boolean",
114+
"default": true,
115+
"description": "If set to True, the safety checker will be enabled."
116+
}
117+
},
118+
"required": [
119+
"model",
120+
"prompt",
121+
"image_urls"
122+
],
123+
"title": "alibaba/qwen-image-3-edit"
124+
}
125+
}
126+
}
127+
},
128+
"responses": {
129+
"200": {
130+
"content": {
131+
"application/json": {
132+
"schema": {
133+
"type": "object",
134+
"properties": {
135+
"data": {
136+
"type": "array",
137+
"nullable": true,
138+
"items": {
139+
"type": "object",
140+
"properties": {
141+
"url": {
142+
"type": "string",
143+
"nullable": true,
144+
"description": "The URL where the file can be downloaded from.",
145+
"example": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png"
146+
},
147+
"b64_json": {
148+
"type": "string",
149+
"nullable": true,
150+
"description": "The base64-encoded JSON of the generated image.",
151+
"example": null
152+
}
153+
}
154+
},
155+
"description": "The list of generated images."
156+
},
157+
"meta": {
158+
"type": "object",
159+
"nullable": true,
160+
"properties": {
161+
"usage": {
162+
"type": "object",
163+
"nullable": true,
164+
"properties": {
165+
"credits_used": {
166+
"type": "number",
167+
"description": "The number of tokens consumed during generation.",
168+
"example": 120000
169+
},
170+
"usd_spent": {
171+
"type": "number",
172+
"description": "The total amount of money spent by the user in USD.",
173+
"example": 0.06
174+
}
175+
},
176+
"required": [
177+
"credits_used",
178+
"usd_spent"
179+
]
180+
}
181+
},
182+
"description": "Additional details about the generation."
183+
}
184+
}
185+
}
186+
}
187+
},
188+
"description": "Successful response."
189+
}
190+
},
191+
"x-hideTryItPanel": true,
192+
"x-codeSamples": [
193+
{
194+
"lang": "cURL",
195+
"source": "curl --request POST \\\n --url 'https://api.aimlapi.com/v1/images/generations' \\\n --header 'Authorization: Bearer <YOUR_AIMLAPI_KEY>' \\\n --header 'Content-Type: application/json' \\\n --data '{\"model\": \"alibaba/qwen-image-3-edit\", \"prompt\": \"Describe what you want the model to generate.\", \"image_urls\": [\"https://example.com/input.jpg\"]}'"
196+
},
197+
{
198+
"lang": "JavaScript",
199+
"source": "const response = await fetch('https://api.aimlapi.com/v1/images/generations', {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n \"model\": \"alibaba/qwen-image-3-edit\",\n \"prompt\": \"Describe what you want the model to generate.\",\n \"image_urls\": [\n \"https://example.com/input.jpg\"\n ]\n}),\n});\n\nconsole.log(await response.json());"
200+
},
201+
{
202+
"lang": "Python",
203+
"source": "import requests\n\nresponse = requests.post(\n \"https://api.aimlapi.com/v1/images/generations\",\n headers={\n \"Authorization\": \"Bearer <YOUR_AIMLAPI_KEY>\",\n \"Content-Type\": \"application/json\",\n },\n json={'model': 'alibaba/qwen-image-3-edit', 'prompt': 'Describe what you want the model to generate.', 'image_urls': ['https://example.com/input.jpg']},\n)\n\nprint(response.json())"
204+
}
205+
]
206+
}
207+
}
208+
},
209+
"components": {
210+
"securitySchemes": {
211+
"access-token": {
212+
"scheme": "bearer",
213+
"bearerFormat": "<YOUR_AIMLAPI_KEY>",
214+
"type": "http",
215+
"description": "Bearer key"
216+
}
217+
}
218+
}
219+
}
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Qwen Image 3 Edit
2+
3+
{% columns %}
4+
{% column width="66.66666666666666%" %}
5+
{% hint style="info" %}
6+
This documentation is valid for the following list of our models:
7+
8+
* `alibaba/qwen-image-3-edit-edit`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/alibaba/qwen-image-3-edit-edit" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
Qwen Image 3 editing model that modifies up to three reference images from a text prompt.
20+
21+
{% hint style="success" %}
22+
[Create AI/ML API Key](https://aimlapi.com/app/keys)
23+
{% endhint %}
24+
25+
<details>
26+
27+
<summary>How to make the first API call</summary>
28+
29+
**1️⃣ Required setup (don’t skip this)**\
30+
**Create an account:** Sign up on the AI/ML API website (if you don’t have one yet).\
31+
**Generate an API key:** In your account dashboard, create an API key and make sure it’s **enabled** in the UI.
32+
33+
**2️ Copy the code example**\
34+
At the bottom of this page, pick the snippet for your preferred programming language (Python / Node.js) and copy it into your project.
35+
36+
**3️ Update the snippet for your use case**\
37+
**Insert your API key:** replace `<YOUR_AIMLAPI_KEY>` with your real AI/ML API key.\
38+
**Select a model:** set the `model` field to the model you want to call.\
39+
**Provide input:** fill in the request input field(s) shown in the example.
40+
41+
**4️ (Optional) Tune the request**\
42+
See the API schema below for optional generation settings.
43+
44+
**5️ Run your code**\
45+
Run the updated code in your development environment.
46+
47+
{% hint style="success" %}
48+
For a detailed walkthrough, use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
49+
{% endhint %}
50+
51+
</details>
52+
53+
## API Schema
54+
55+
{% openapi-operation spec="qwen-image-3-edit" path="/v1/images/generations" method="post" %}
56+
[OpenAPI qwen-image-3-edit](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Alibaba-Cloud/qwen-image-3-edit.json)
57+
{% endopenapi-operation %}
58+
59+
## Code Example
60+
61+
{% tabs %}
62+
{% tab title="Python" %}
63+
{% code overflow="wrap" %}
64+
```python
65+
import requests
66+
67+
response = requests.post(
68+
"https://api.aimlapi.com/v1/images/generations",
69+
headers={
70+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
71+
"Content-Type": "application/json",
72+
},
73+
json={'model': 'alibaba/qwen-image-3-edit-edit', 'prompt': 'Describe what you want the model to generate.'},
74+
)
75+
76+
print(response.json())
77+
```
78+
{% endcode %}
79+
{% endtab %}
80+
81+
{% tab title="JavaScript" %}
82+
{% code overflow="wrap" %}
83+
```javascript
84+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
85+
method: 'POST',
86+
headers: {
87+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
88+
'Content-Type': 'application/json',
89+
},
90+
body: JSON.stringify({
91+
"model": "alibaba/qwen-image-3-edit",
92+
"prompt": "Describe what you want the model to generate."
93+
}),
94+
});
95+
96+
console.log(await response.json());
97+
```
98+
{% endcode %}
99+
{% endtab %}
100+
{% endtabs %}
101+
102+
<details>
103+
104+
<summary>Response</summary>
105+
106+
{% code overflow="wrap" %}
107+
```json
108+
{
109+
"data": [
110+
{
111+
"url": "https://cdn.aimlapi.com/generations/hedgehog/1749730923700-29fe35d2-4aef-4bc5-a911-6c39884d16a8.png",
112+
"b64_json": null
113+
}
114+
],
115+
"meta": {
116+
"usage": {
117+
"credits_used": 120000,
118+
"usd_spent": 0.06
119+
}
120+
},
121+
"model": "alibaba/qwen-image-3-edit"
122+
}
123+
```
124+
{% endcode %}
125+
126+
</details>

0 commit comments

Comments
 (0)