Zum Hauptinhalt springen
POST
/
v3
/
async
/
z-image-turbo-lora
Z Image Turbo LoRA Bildgenerierung
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>"
}
Dies ist eine asynchrone API, die nur eine asynchrone task_id zurückgibt. Du musst die task_id verwenden, um die API zur Abfrage des Aufgabenergebnisses aufzurufen und das generierte Ergebnis abzurufen.
Dies ist eine asynchrone API, die nur die task_id der asynchronen Aufgabe zurückgibt. Sie sollten diese task_id verwenden, um die API zum Abfragen des Aufgabenergebnisses aufzurufen und das generierte Ergebnis abzurufen.

Request-Header

Content-Type
string
erforderlich
Enum-Wert: application/json
Authorization
string
erforderlich
Bearer-Authentifizierungsformat: Bearer {{API Key}}.

Request-Body

mask
string
URL des Maskenbilds für lokales Neuzeichnen (inpaint). Weiße Bereiche werden neu gezeichnet, schwarze Bereiche bleiben unverändert. Muss zusammen mit image_url verwendet werden
seed
integer
Zufalls-Seed für die Generierung. -1 bedeutet, dass ein zufälliger Seed verwendet wirdWertebereich: [-1, 2147483647]
size
string
Standard:"1024*1024"
Pixelgröße des generierten Bildes (Breite*Höhe)
loras
object[]
Standard:"[]"
Liste der anzuwendenden LoRAs (maximal 3)Array-Länge: 0 - 3
prompt
string
erforderlich
Positiver Prompt für die Generierung
strength
number
Transformationsstärke für Bild-zu-Bild (img2img). 0.0-0.3 Verbesserungsmodus, 0.3-0.6 ausgewogene Transformation, 0.6-0.8 Stilübertragung, 0.8-1.0 kreatives Neuzeichnen. Muss zusammen mit image_url verwendet werdenWertebereich: [0, 1]
image_url
string
URL des Referenzbildes für Bild-zu-Bild (img2img)
output_format
string
Standard:"webp"
Format des Ausgabebildes. Unterstützt jpeg, png, webpOptionale Werte: jpeg, png, webp
enable_base64_output
boolean
Standard:false
Wenn aktiviert, wird die Ausgabe als BASE64-String statt als URL kodiert

Antwortinformationen

task_id
string
erforderlich
Verwenden Sie die task_id, um die API zum Abfragen des Aufgabenergebnisses aufzurufen und die generierte Ausgabe abzurufen.