Z Image Turbo LoRA Image Generation
curl --request POST \
--url https://api.highwayapi.ai/v3/async/z-image-turbo-lora \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mask": "<string>",
"seed": 123,
"size": "<string>",
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"prompt": "<string>",
"strength": 123,
"image_url": "<string>",
"output_format": "<string>",
"enable_base64_output": true
}
'import requests
url = "https://api.highwayapi.ai/v3/async/z-image-turbo-lora"
payload = {
"mask": "<string>",
"seed": 123,
"size": "<string>",
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"prompt": "<string>",
"strength": 123,
"image_url": "<string>",
"output_format": "<string>",
"enable_base64_output": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
mask: '<string>',
seed: 123,
size: '<string>',
loras: [{path: '<string>', scale: 123}],
prompt: '<string>',
strength: 123,
image_url: '<string>',
output_format: '<string>',
enable_base64_output: true
})
};
fetch('https://api.highwayapi.ai/v3/async/z-image-turbo-lora', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/z-image-turbo-lora",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mask' => '<string>',
'seed' => 123,
'size' => '<string>',
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'prompt' => '<string>',
'strength' => 123,
'image_url' => '<string>',
'output_format' => '<string>',
'enable_base64_output' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/z-image-turbo-lora"
payload := strings.NewReader("{\n \"mask\": \"<string>\",\n \"seed\": 123,\n \"size\": \"<string>\",\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"prompt\": \"<string>\",\n \"strength\": 123,\n \"image_url\": \"<string>\",\n \"output_format\": \"<string>\",\n \"enable_base64_output\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/z-image-turbo-lora")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"mask\": \"<string>\",\n \"seed\": 123,\n \"size\": \"<string>\",\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"prompt\": \"<string>\",\n \"strength\": 123,\n \"image_url\": \"<string>\",\n \"output_format\": \"<string>\",\n \"enable_base64_output\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/z-image-turbo-lora")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"mask\": \"<string>\",\n \"seed\": 123,\n \"size\": \"<string>\",\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"prompt\": \"<string>\",\n \"strength\": 123,\n \"image_url\": \"<string>\",\n \"output_format\": \"<string>\",\n \"enable_base64_output\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}Images
Z Image Turbo LoRA Image Generation
POST
/
v3
/
async
/
z-image-turbo-lora
Z Image Turbo LoRA Image Generation
curl --request POST \
--url https://api.highwayapi.ai/v3/async/z-image-turbo-lora \
--header 'Authorization: <authorization>' \
--header 'Content-Type: <content-type>' \
--data '
{
"mask": "<string>",
"seed": 123,
"size": "<string>",
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"prompt": "<string>",
"strength": 123,
"image_url": "<string>",
"output_format": "<string>",
"enable_base64_output": true
}
'import requests
url = "https://api.highwayapi.ai/v3/async/z-image-turbo-lora"
payload = {
"mask": "<string>",
"seed": 123,
"size": "<string>",
"loras": [
{
"path": "<string>",
"scale": 123
}
],
"prompt": "<string>",
"strength": 123,
"image_url": "<string>",
"output_format": "<string>",
"enable_base64_output": True
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "<authorization>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: '<authorization>'},
body: JSON.stringify({
mask: '<string>',
seed: 123,
size: '<string>',
loras: [{path: '<string>', scale: 123}],
prompt: '<string>',
strength: 123,
image_url: '<string>',
output_format: '<string>',
enable_base64_output: true
})
};
fetch('https://api.highwayapi.ai/v3/async/z-image-turbo-lora', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.highwayapi.ai/v3/async/z-image-turbo-lora",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'mask' => '<string>',
'seed' => 123,
'size' => '<string>',
'loras' => [
[
'path' => '<string>',
'scale' => 123
]
],
'prompt' => '<string>',
'strength' => 123,
'image_url' => '<string>',
'output_format' => '<string>',
'enable_base64_output' => true
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.highwayapi.ai/v3/async/z-image-turbo-lora"
payload := strings.NewReader("{\n \"mask\": \"<string>\",\n \"seed\": 123,\n \"size\": \"<string>\",\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"prompt\": \"<string>\",\n \"strength\": 123,\n \"image_url\": \"<string>\",\n \"output_format\": \"<string>\",\n \"enable_base64_output\": true\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "<authorization>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.highwayapi.ai/v3/async/z-image-turbo-lora")
.header("Content-Type", "<content-type>")
.header("Authorization", "<authorization>")
.body("{\n \"mask\": \"<string>\",\n \"seed\": 123,\n \"size\": \"<string>\",\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"prompt\": \"<string>\",\n \"strength\": 123,\n \"image_url\": \"<string>\",\n \"output_format\": \"<string>\",\n \"enable_base64_output\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.highwayapi.ai/v3/async/z-image-turbo-lora")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = '<authorization>'
request.body = "{\n \"mask\": \"<string>\",\n \"seed\": 123,\n \"size\": \"<string>\",\n \"loras\": [\n {\n \"path\": \"<string>\",\n \"scale\": 123\n }\n ],\n \"prompt\": \"<string>\",\n \"strength\": 123,\n \"image_url\": \"<string>\",\n \"output_format\": \"<string>\",\n \"enable_base64_output\": true\n}"
response = http.request(request)
puts response.read_body{
"task_id": "<string>"
}This is an asynchronous API and only returns an async task_id. You need to use the task_id to call the task result query API to get the generated result.
This is an asynchronous API and will only return the async task’s task_id. You should use this task_id to request the Query Task Result API to retrieve the generated result.
Request Headers
string
required
Enum value:
application/jsonstring
required
Bearer authentication format: Bearer {{API Key}}.
Request Body
string
Mask image URL for inpainting. White areas are repainted, while black areas remain unchanged. Must be used with image_url.
integer
Random seed for generation. -1 means using a random seed.Value range: [-1, 2147483647]
string
default:"1024*1024"
Pixel dimensions of the generated image (width*height).
object[]
default:"[]"
string
required
Positive prompt for generation.
number
Transformation strength for image-to-image (img2img). 0.0-0.3 enhancement mode, 0.3-0.6 balanced transformation, 0.6-0.8 style transfer, 0.8-1.0 creative repainting. Must be used with image_url.Value range: [0, 1]
string
Reference image URL for image-to-image (img2img).
string
default:"webp"
Output image format. Supports jpeg, png, webp.Allowed values:
jpeg, png, webpboolean
default:false
If enabled, the output will be encoded as a BASE64 string instead of a URL.
Response Information
string
required
Use the task_id to request the Query Task Result API to retrieve the generated output.
⌘I