Skip to content

Commit d061e99

Browse files
techpro-aimlapigitbook-bot
authored andcommitted
GITBOOK-569: docs: add 2 z-image-turbo models
1 parent 581efb8 commit d061e99

10 files changed

Lines changed: 262 additions & 4 deletions

File tree

1.16 MB
Loading
1.1 MB
Loading
120 KB
Loading

docs/SUMMARY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@
145145
* [Alibaba Cloud](api-references/image-models/alibaba-cloud/README.md)
146146
* [qwen-image](api-references/image-models/alibaba-cloud/qwen-image.md)
147147
* [qwen-image-edit](api-references/image-models/alibaba-cloud/qwen-image-edit.md)
148+
* [z-image-turbo](api-references/image-models/alibaba-cloud/z-image-turbo.md)
149+
* [z-image-turbo-lora](api-references/image-models/alibaba-cloud/z-image-turbo-lora.md)
148150
* [ByteDance](api-references/image-models/bytedance/README.md)
149151
* [Seedream 3.0](api-references/image-models/bytedance/seedream-3.0.md)
150152
* [Seededit 3.0 (Image-to-Image)](api-references/image-models/bytedance/seededit-3.0-image-to-image.md)

docs/api-references/image-models/README.md

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# z-image-turbo-lora
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/z-image-turbo-lora`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/alibaba/z-image-turbo-lora" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
An ultra-fast 6B-parameter text-to-image model with LoRA[^1] support.
20+
21+
## Setup your API Key
22+
23+
If you don’t have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
24+
25+
## API Schema
26+
27+
{% openapi-operation spec="z-image-turbo-lora" path="/v1/images/generations" method="post" %}
28+
[OpenAPI z-image-turbo-lora](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Alibaba-Cloud/z-image-turbo-lora.json)
29+
{% endopenapi-operation %}
30+
31+
## Quick Example
32+
33+
Let's generate an image of the specified size using a simple prompt.
34+
35+
{% tabs %}
36+
{% tab title="Python" %}
37+
{% code overflow="wrap" %}
38+
```python
39+
import requests
40+
import json # for getting a structured output with indentation
41+
42+
def main():
43+
response = requests.post(
44+
"https://api.aimlapi.com/v1/images/generations",
45+
headers={
46+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
47+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
48+
"Content-Type": "application/json",
49+
},
50+
json={
51+
"model": "alibaba/z-image-turbo-lora",
52+
"prompt": "A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.",
53+
"image_size": {
54+
"width": 1440,
55+
"height": 512
56+
},
57+
}
58+
)
59+
60+
data = response.json()
61+
print(json.dumps(data, indent=2, ensure_ascii=False))
62+
63+
if __name__ == "__main__":
64+
main()
65+
```
66+
{% endcode %}
67+
{% endtab %}
68+
69+
{% tab title="JS" %}
70+
{% code overflow="wrap" %}
71+
```javascript
72+
async function main() {
73+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
74+
method: 'POST',
75+
headers: {
76+
// Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
77+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
78+
'Content-Type': 'application/json',
79+
},
80+
body: JSON.stringify({
81+
model: 'alibaba/z-image-turbo-lora',
82+
prompt: 'A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.',
83+
image_size: {
84+
width: 1440,
85+
height: 512
86+
},
87+
}),
88+
});
89+
90+
const data = await response.json();
91+
console.log('Generation:', data);
92+
}
93+
94+
main();
95+
```
96+
{% endcode %}
97+
{% endtab %}
98+
{% endtabs %}
99+
100+
<details>
101+
102+
<summary>Response</summary>
103+
104+
{% code overflow="wrap" %}
105+
```json5
106+
{
107+
"data": [
108+
{
109+
"url": "https://cdn.aimlapi.com/flamingo/files/b/0a84de54/-IaUBYEQiYqRaeT7oZvus.png"
110+
}
111+
],
112+
"meta": {
113+
"usage": {
114+
"tokens_used": 17850
115+
}
116+
}
117+
}
118+
```
119+
{% endcode %}
120+
121+
</details>
122+
123+
We obtained the following 1440x512 image by running this code example:
124+
125+
<figure><img src="../../../.gitbook/assets/-IaUBYEQiYqRaeT7oZvus.png" alt=""><figcaption></figcaption></figure>
126+
127+
[^1]: The **LoRA algorithm** (Low-Rank Adaptation) is a parameter-efficient fine-tuning technique used to adapt large language models (LLMs) and stable diffusion models to new tasks or domains without retraining the entire model. This process is faster and requires significantly less memory and computational resources than full fine-tuning.
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# z-image-turbo
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/z-image-turbo`
9+
{% endhint %}
10+
{% endcolumn %}
11+
12+
{% column width="33.33333333333334%" %}
13+
<a href="https://aimlapi.com/app/alibaba/z-image-turbo" class="button primary">Try in Playground</a>
14+
{% endcolumn %}
15+
{% endcolumns %}
16+
17+
## Model Overview
18+
19+
An ultra-fast 6B-parameter text-to-image model.
20+
21+
## Setup your API Key
22+
23+
If you don’t have an API key for the AI/ML API yet, feel free to use our [Quickstart guide](https://docs.aimlapi.com/quickstart/setting-up).
24+
25+
## API Schema
26+
27+
{% openapi-operation spec="z-image-turbo" path="/v1/images/generations" method="post" %}
28+
[OpenAPI z-image-turbo](https://raw.githubusercontent.com/aimlapi/api-docs/refs/heads/main/docs/api-references/image-models/Alibaba-Cloud/z-image-turbo.json)
29+
{% endopenapi-operation %}
30+
31+
## Quick Example
32+
33+
Let's generate an image of the specified size using a simple prompt.
34+
35+
{% tabs %}
36+
{% tab title="Python" %}
37+
{% code overflow="wrap" %}
38+
```python
39+
import requests
40+
import json # for getting a structured output with indentation
41+
42+
def main():
43+
response = requests.post(
44+
"https://api.aimlapi.com/v1/images/generations",
45+
headers={
46+
# Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
47+
"Authorization": "Bearer <YOUR_AIMLAPI_KEY>",
48+
"Content-Type": "application/json",
49+
},
50+
json={
51+
"model": "alibaba/z-image-turbo",
52+
"prompt": "A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.",
53+
"image_size": {
54+
"width": 1440,
55+
"height": 512
56+
},
57+
}
58+
)
59+
60+
data = response.json()
61+
print(json.dumps(data, indent=2, ensure_ascii=False))
62+
63+
if __name__ == "__main__":
64+
main()
65+
```
66+
{% endcode %}
67+
{% endtab %}
68+
69+
{% tab title="JS" %}
70+
{% code overflow="wrap" %}
71+
```javascript
72+
async function main() {
73+
const response = await fetch('https://api.aimlapi.com/v1/images/generations', {
74+
method: 'POST',
75+
headers: {
76+
// Insert your AIML API Key instead of <YOUR_AIMLAPI_KEY>:
77+
'Authorization': 'Bearer <YOUR_AIMLAPI_KEY>',
78+
'Content-Type': 'application/json',
79+
},
80+
body: JSON.stringify({
81+
model: 'alibaba/z-image-turbo',
82+
prompt: 'A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses.',
83+
image_size: {
84+
width: 1440,
85+
height: 512
86+
},
87+
}),
88+
});
89+
90+
const data = await response.json();
91+
console.log('Generation:', data);
92+
}
93+
94+
main();
95+
```
96+
{% endcode %}
97+
{% endtab %}
98+
{% endtabs %}
99+
100+
<details>
101+
102+
<summary>Response</summary>
103+
104+
{% code overflow="wrap" %}
105+
```json5
106+
{
107+
"data": [
108+
{
109+
"url": "https://cdn.aimlapi.com/flamingo/files/b/0a84de46/GTZfn0tOOQzXlC2Wvpzz9.png"
110+
}
111+
],
112+
"meta": {
113+
"usage": {
114+
"tokens_used": 10500
115+
}
116+
}
117+
}
118+
```
119+
{% endcode %}
120+
121+
</details>
122+
123+
We obtained the following 1440x512 image by running this code example:
124+
125+
<figure><img src="../../../.gitbook/assets/GTZfn0tOOQzXlC2Wvpzz9.png" alt=""><figcaption></figcaption></figure>

docs/api-references/image-models/flux/flux-2-lora-edit.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This documentation is valid for the following list of our models:
1616

1717
## Model Overview
1818

19-
This image-to-image model enables you to apply your trained adapters, producing domain-specific outputs aligned with your brand aesthetic, expert content areas, or specialized visual constraints.
19+
This image-to-image model enables you to apply your trained LoRA[^1] adapters, producing domain-specific outputs aligned with your brand aesthetic, expert content areas, or specialized visual constraints.
2020

2121
## Setup your API Key
2222

@@ -123,3 +123,5 @@ main();
123123
</details>
124124

125125
<table data-full-width="true"><thead><tr><th width="442.0667724609375" valign="top">Reference Images</th><th valign="top">Generated Image</th></tr></thead><tbody><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/t-rex (1) (1).png" alt=""><figcaption><p>Image #1</p></figcaption></figure></div></td><td valign="top"><div><figure><img src="../../../.gitbook/assets/2-TzrE2bwvfldwD4O3aVi.png" alt=""><figcaption><p><kbd><code>"Combine the images so the T-Rex is wearing a business suit, sitting in a cozy small café, drinking from the mug. Blur the background slightly to create a bokeh effect."</code></kbd></p></figcaption></figure></div></td></tr><tr><td valign="top"><div><figure><img src="../../../.gitbook/assets/blue-mug (1).jpg" alt=""><figcaption><p>Image #2</p></figcaption></figure></div></td><td valign="top"></td></tr></tbody></table>
126+
127+
[^1]: The **LoRA algorithm** (Low-Rank Adaptation) is a parameter-efficient fine-tuning technique used to adapt large language models (LLMs) and stable diffusion models to new tasks or domains without retraining the entire model. This process is faster and requires significantly less memory and computational resources than full fine-tuning.

docs/api-references/image-models/flux/flux-2-lora.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This documentation is valid for the following list of our models:
1616

1717
## Model Overview
1818

19-
This text-to-image model enables you to apply your trained adapters, producing domain-specific outputs aligned with your brand aesthetic, expert content areas, or specialized visual constraints.
19+
This text-to-image model enables you to apply your trained LoRA[^1] adapters, producing domain-specific outputs aligned with your brand aesthetic, expert content areas, or specialized visual constraints.
2020

2121
## Setup your API Key
2222

@@ -123,3 +123,5 @@ main();
123123
We obtained the following nice 1472x512 image by running this code example:
124124

125125
<div align="left"><figure><img src="../../../.gitbook/assets/UNSH9jzS_1AHujNGtda30.png" alt=""><figcaption><p><code>"A T-Rex relaxing on a beach, lying on a sun lounger and wearing sunglasses."</code></p></figcaption></figure></div>
126+
127+
[^1]: The **LoRA algorithm** (Low-Rank Adaptation) is a parameter-efficient fine-tuning technique used to adapt large language models (LLMs) and stable diffusion models to new tasks or domains without retraining the entire model. This process is faster and requires significantly less memory and computational resources than full fine-tuning.

0 commit comments

Comments
 (0)