wan2.7-image-pro
Modell zur Erstellung von Bildern anhand einer Textvorgabe. Der Hersteller sieht die Steuerung der Farbpalette und bis zu 4K Auflösung für die gewöhnliche Text-zu-Bild-Generierung vor.
- Ailoot · Bilder
POST /v1/images/generationswan2.7-image-pro - Ailoot · Bilder
POST /v1/images/generationswan-image - Ailoot · Bilder
POST /v1/images/generationswan-image-latest
Über das Modell
Diese Beschreibung erläutert die Fähigkeiten des Modells. Die über Ailoot verfügbaren Eingaben, Ausgaben und Optionen sind unten für die ausgewählte Methode aufgeführt.
Wan2.7-Image-Pro ist ein Modell von Alibaba zur Erstellung von Bildern aus Text. Die aktuelle Ailoot-Karte veröffentlicht Texteingabe und ein Bild als Ergebnis. Der Hersteller sieht auch Bearbeitung, das Zusammenführen von Referenzen und lokale Änderungen vor. Diese Verfahren erfordern eine eigene Unterstützung für Eingabebilder und sind in der aktuellen Methode der Karte nicht enthalten.
Im Referenzmodus des Herstellers können bis zu neun Ausgangsbilder übermittelt werden. Die Beschreibung legt fest, welche Elemente jedes Bildes verwendet werden sollen. Bei der Bearbeitung erhält das Modell das Hauptobjekt, verändert gewählte Details oder erstellt aus mehreren Materialien eine neue Komposition. Um Änderungen genauer zu steuern, können bis zu zwei rechteckige Bereiche auf einem Eingabebild markiert werden.
Palette und komplexe Vorgaben
Außerhalb fortlaufender Serien kann eine Palette aus 3–10 Farben vorgegeben werden. Der Reasoning-Modus ist für die gewöhnliche Generierung aus Text ohne Referenzen und ohne fortlaufende Serie vorgesehen: Das Modell analysiert die Szenenbeschreibung vorab.
Laut Alibaba-Spezifikation umfasst die gewöhnliche Ausgabe ein bis vier Bilder. Für eine erzählerische Serie kann eine Obergrenze von bis zu 12 festgelegt werden; die tatsächliche Anzahl wählt das Modell anhand der Vorgabe. Die Serie kann Text und Referenzen verwenden, um gemeinsame Merkmale von Figuren und einen zusammenhängenden Verlauf der Geschichte zu erhalten. Palette und Reasoning werden in diesem Modus nicht angewendet.
Die Auflösung hängt vom Modus ab
4K wird bei der gewöhnlichen Generierung aus Text ohne Referenzen und ohne fortlaufende Serie unterstützt. Bearbeitung anhand von Bildern und fortlaufende Serien sind auf 2K begrenzt. Diese Bezeichnungen bestimmen die Pixelfläche, nicht eine einheitliche Länge jeder Seite. Das Bildformat kann zwischen 1:8 und 8:1 gewählt werden; bei der Bearbeitung mit einer voreingestellten Auflösung folgt das Seitenverhältnis der letzten Referenz. Die Ergebnisse werden in PNG gespeichert.
Für Verfahren mit Eingabebildern erlaubt Alibaba JPEG, JPG, PNG ohne Transparenz, BMP und WEBP. Die Grenzen betragen 20 MB pro Datei, 240 bis 8000 Pixel je Seite und ein Seitenverhältnis von 1:8 bis 8:1. Für Textvorgaben werden Chinesisch und Englisch unterstützt; das Maximum beträgt 5000 Zeichen, überzähliger Text wird verworfen. Eine negative Beschreibung und eine Erweiterung der Vorgabe sind für diese Version nicht vorgesehen. Ein Zufalls-Seed hilft, die Ähnlichkeit von Varianten beizubehalten, gewährleistet aber keine exakte Wiederholung.
Ailoot · Bilder POST /v1/images/generations wan2.7-image-pro
wan2.7-image-prowan2.7-image-prowan-imagewan-image-latest
Einstieg
Modell zur Erstellung von Bildern anhand einer Textvorgabe. Der Hersteller sieht die Steuerung der Farbpalette und bis zu 4K Auflösung für die gewöhnliche Text-zu-Bild-Generierung vor.
- Zulässige Eingaben
- Text
- Ergebnisse
- Bilder
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Bilder POST /v1/images/generations
- Eingabe
text- Ausgabe
image- Ausgabeformat
- Bilddatei
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits wan2.7-image-pro | Standard— |
Feldprompt | Typstring | AnforderungErforderlich | Werte und Limits Mindestlänge: 1 | Standard— |
Feldn | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 | Standard1 |
Feldresponse_format | Typstring | AnforderungOptional | Werte und Limits url, b64_json | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldsize | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldpartial_images | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldimages[].image_url | Typstring | AnforderungNicht unterstützt | Werte und Limits Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Maximale Anzahl Bilder je Array: 9 Bedingungen: Eine tatsächliche URL je images[]-Objekt. Die Arrayanzahl ist von diesem Zeichenfolgen-Blattwert getrennt. Gilt, wenn: Nur JSON images/edits; JSON images/generations parst keine images-Referenzen. | Standard— |
Feldimage | Typfile | AnforderungOptional | Werte und Limits Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Gilt, wenn: Generierung mit multipart/form-data | Standard— |
Feldimage[] | Typfile[] | AnforderungOptional | Werte und Limits Maximale Anzahl Elemente: 9 Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Gilt, wenn: Generierung mit multipart/form-data | Standard— |
Kombinationen von Eingabematerialien
Text zu Bild · Erforderlich: prompt
reference_images_generation · Erforderlich: prompt
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext |
Parameterrequired | Vertragmodel, prompt |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Lebenszyklus: synchronous_result_then_owned_library
GET /v1/media/tasks/{task_id} · die tatsächlich zurückgegebene task_id oder ein Eintrag in der Medienbibliothek
GET /v1/media/assets/{asset_id}/content
GET /v1/media/assets
GET /v1/media/assets/{asset_id}
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/images/generations- Ausgabe
- $ 0,075 pro 1K-Bild
- Ausgabe
- $ 0,075 pro 2K-Bild
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
wan2.7-image-pro
Preise nach Konfiguration
| Konfiguration | Abrechnungsbedingungen | Gebühr |
|---|---|---|
| Konfigurationwan2.7-image-pro · Standardkonfiguration | AbrechnungsbedingungenStandardkonfiguration | Gebühr Eingabe · Eingabe $ 0,00 pro Aufruf Ausgabe · Ausgabe $ 0,16 pro Aufruf |
Beispielanfragen
Ailoot · Bilder
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "wan2.7-image-pro", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin
def save_images(items):
if not items: raise SystemExit("No completed images; retain the full response")
for index, item in enumerate(items):
encoded=item.get("b64_json")
uri=item.get("url", "")
if not encoded and uri.startswith("data:image/"):
header, separator, encoded=uri.partition(",")
if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
if encoded:
raw=base64.b64decode(encoded,validate=True)
elif uri:
uri=urljoin("https://api.ailoot.ai",uri)
parsed=urlsplit(uri)
if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
raise SystemExit("Invalid returned image URL")
owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
args=["curl","--fail-with-body","--silent","--show-error",uri]
if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
temporary=Path(f"image-{index}.bin")
subprocess.run(args+["-o",str(temporary)],check=True)
raw=temporary.read_bytes()
temporary.unlink()
else: raise SystemExit("Image has neither bytes nor URL")
if not raw: raise SystemExit("Empty image result")
ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
Path(f"image-{index}.{ext}").write_bytes(raw)
print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin
def save_images(items):
if not items: raise SystemExit("No completed images; retain the full response")
for index, item in enumerate(items):
encoded=item.get("b64_json")
uri=item.get("url", "")
if not encoded and uri.startswith("data:image/"):
header, separator, encoded=uri.partition(",")
if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
if encoded:
raw=base64.b64decode(encoded,validate=True)
elif uri:
uri=urljoin("https://api.ailoot.ai",uri)
parsed=urlsplit(uri)
if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
raise SystemExit("Invalid returned image URL")
owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
args=["curl","--fail-with-body","--silent","--show-error",uri]
if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
temporary=Path(f"image-{index}.bin")
subprocess.run(args+["-o",str(temporary)],check=True)
raw=temporary.read_bytes()
temporary.unlink()
else: raise SystemExit("Image has neither bytes nor URL")
if not raw: raise SystemExit("Empty image result")
ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
Path(f"image-{index}.{ext}").write_bytes(raw)
print("Every returned image saved; complete response metadata retained")
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'wan2.7-image-pro', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "wan2.7-image-pro", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
if(!encoded && uri.startsWith("data:image/")) {
const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
encoded=uri.slice(comma+1);
}
if(encoded) {
if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
raw=Buffer.from(encoded,"base64");
} else if(uri) {
const u=new URL(uri,"https://api.ailoot.ai");
if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
if(!response.ok) throw new Error("Image content download failed: "+response.status);
raw=Buffer.from(await response.arrayBuffer());
} else throw new Error("Image has neither bytes nor URL");
if(!raw.length) throw new Error("Empty image result");
const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
Ergebnisse abrufen und speichern
Ailoot · Bilder
Laden Sie jedes zurückgegebene Bild herunter oder speichern Sie seinen Base64-Inhalt
GET /v1/media/tasks/{task_id}GET /v1/media/assets/{asset_id}/contentGET /v1/media/assetsGET /v1/media/assets/{asset_id}
Alle fertiggestellten Ergebnisse aufbewahren
Speichern Sie jedes fertiggestellte Bild; rufen Sie jede zurückgegebene URL ab oder dekodieren Sie seinen Base64-Inhalt.
Jedes Datenelement speichern. Jedes b64_json dekodieren oder jede zurückgegebene signierte URL abrufen. Die Dateiendung anhand des tatsächlichen MIME-Typs bzw. der Bytes wählen.
Wenn die ursprüngliche Antwort geprüft werden muss
Wenn das Ergebnis einer Bildgenerierung oder -bearbeitung geprüft werden muss, die ursprüngliche operation_id/X-Client-Request-ID und die zurückgegebenen Ergebnisinformationen aufbewahren. Bereits vorhandene eigene Ergebnisse über die Medienbibliothek anhand tatsächlicher task_id- oder asset_id-Werte wiederherstellen. Die Generierungs-/Bearbeitungsanfrage nicht erneut senden und keine Abfrage-URL aus operation_id bilden.
Antwortfelder
| Feld | Typ |
|---|---|
Feldcreated | Typinteger |
Felddata[].url | Typstring |
Felddata[].b64_json | Typbase64 string |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Antwortserver_error | BedingungDie zurückgegebene Antwort gibt an, dass der Vorgang oder das Ergebnis eine Prüfung erfordert | Nächster SchrittDie ursprünglich zurückgegebene Vorgangs-/Aufgaben-ID, die Anfrageheader und die Antwort aufbewahren; mit unterstützten Leseaufrufen für diesen ursprünglichen Vorgang fortfahren. Die Erstellungsanfrage nicht erneut senden. |
Aliasnamen
Modellaliasnamen
Ailoot wan2.7-image-pro, wan-image, wan-image-latest
Aliasnamen für Methodenpfade
Verwenden Sie die oben angezeigten Methodenpfade.
Zugehörige Aufrufer-IDs
Ailoot · Bilder POST /v1/images/generations wan-image
wan-imagewan2.7-image-prowan-imagewan-image-latest
Einstieg
Modell zur Erstellung von Bildern anhand einer Textvorgabe. Der Hersteller sieht die Steuerung der Farbpalette und bis zu 4K Auflösung für die gewöhnliche Text-zu-Bild-Generierung vor.
- Zulässige Eingaben
- Text
- Ergebnisse
- Bilder
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Bilder POST /v1/images/generations
- Eingabe
text- Ausgabe
image- Ausgabeformat
- Bilddatei
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits wan-image | Standard— |
Feldprompt | Typstring | AnforderungErforderlich | Werte und Limits Mindestlänge: 1 | Standard— |
Feldn | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 | Standard1 |
Feldresponse_format | Typstring | AnforderungOptional | Werte und Limits url, b64_json | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldsize | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldpartial_images | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldimages[].image_url | Typstring | AnforderungNicht unterstützt | Werte und Limits Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Maximale Anzahl Bilder je Array: 9 Bedingungen: Eine tatsächliche URL je images[]-Objekt. Die Arrayanzahl ist von diesem Zeichenfolgen-Blattwert getrennt. Gilt, wenn: Nur JSON images/edits; JSON images/generations parst keine images-Referenzen. | Standard— |
Feldimage | Typfile | AnforderungOptional | Werte und Limits Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Gilt, wenn: Generierung mit multipart/form-data | Standard— |
Feldimage[] | Typfile[] | AnforderungOptional | Werte und Limits Maximale Anzahl Elemente: 9 Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Gilt, wenn: Generierung mit multipart/form-data | Standard— |
Kombinationen von Eingabematerialien
Text zu Bild · Erforderlich: prompt
reference_images_generation · Erforderlich: prompt
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext |
Parameterrequired | Vertragmodel, prompt |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Lebenszyklus: synchronous_result_then_owned_library
GET /v1/media/tasks/{task_id} · die tatsächlich zurückgegebene task_id oder ein Eintrag in der Medienbibliothek
GET /v1/media/assets/{asset_id}/content
GET /v1/media/assets
GET /v1/media/assets/{asset_id}
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/images/generations- Ausgabe
- $ 0,075 pro 1K-Bild
- Ausgabe
- $ 0,075 pro 2K-Bild
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
wan2.7-image-pro
Preise nach Konfiguration
| Konfiguration | Abrechnungsbedingungen | Gebühr |
|---|---|---|
| Konfigurationwan2.7-image-pro · Standardkonfiguration | AbrechnungsbedingungenStandardkonfiguration | Gebühr Eingabe · Eingabe $ 0,00 pro Aufruf Ausgabe · Ausgabe $ 0,16 pro Aufruf |
Beispielanfragen
Ailoot · Bilder
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "wan-image", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin
def save_images(items):
if not items: raise SystemExit("No completed images; retain the full response")
for index, item in enumerate(items):
encoded=item.get("b64_json")
uri=item.get("url", "")
if not encoded and uri.startswith("data:image/"):
header, separator, encoded=uri.partition(",")
if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
if encoded:
raw=base64.b64decode(encoded,validate=True)
elif uri:
uri=urljoin("https://api.ailoot.ai",uri)
parsed=urlsplit(uri)
if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
raise SystemExit("Invalid returned image URL")
owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
args=["curl","--fail-with-body","--silent","--show-error",uri]
if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
temporary=Path(f"image-{index}.bin")
subprocess.run(args+["-o",str(temporary)],check=True)
raw=temporary.read_bytes()
temporary.unlink()
else: raise SystemExit("Image has neither bytes nor URL")
if not raw: raise SystemExit("Empty image result")
ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
Path(f"image-{index}.{ext}").write_bytes(raw)
print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin
def save_images(items):
if not items: raise SystemExit("No completed images; retain the full response")
for index, item in enumerate(items):
encoded=item.get("b64_json")
uri=item.get("url", "")
if not encoded and uri.startswith("data:image/"):
header, separator, encoded=uri.partition(",")
if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
if encoded:
raw=base64.b64decode(encoded,validate=True)
elif uri:
uri=urljoin("https://api.ailoot.ai",uri)
parsed=urlsplit(uri)
if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
raise SystemExit("Invalid returned image URL")
owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
args=["curl","--fail-with-body","--silent","--show-error",uri]
if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
temporary=Path(f"image-{index}.bin")
subprocess.run(args+["-o",str(temporary)],check=True)
raw=temporary.read_bytes()
temporary.unlink()
else: raise SystemExit("Image has neither bytes nor URL")
if not raw: raise SystemExit("Empty image result")
ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
Path(f"image-{index}.{ext}").write_bytes(raw)
print("Every returned image saved; complete response metadata retained")
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'wan-image', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "wan-image", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
if(!encoded && uri.startsWith("data:image/")) {
const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
encoded=uri.slice(comma+1);
}
if(encoded) {
if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
raw=Buffer.from(encoded,"base64");
} else if(uri) {
const u=new URL(uri,"https://api.ailoot.ai");
if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
if(!response.ok) throw new Error("Image content download failed: "+response.status);
raw=Buffer.from(await response.arrayBuffer());
} else throw new Error("Image has neither bytes nor URL");
if(!raw.length) throw new Error("Empty image result");
const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
Ergebnisse abrufen und speichern
Ailoot · Bilder
Laden Sie jedes zurückgegebene Bild herunter oder speichern Sie seinen Base64-Inhalt
GET /v1/media/tasks/{task_id}GET /v1/media/assets/{asset_id}/contentGET /v1/media/assetsGET /v1/media/assets/{asset_id}
Alle fertiggestellten Ergebnisse aufbewahren
Speichern Sie jedes fertiggestellte Bild; rufen Sie jede zurückgegebene URL ab oder dekodieren Sie seinen Base64-Inhalt.
Jedes Datenelement speichern. Jedes b64_json dekodieren oder jede zurückgegebene signierte URL abrufen. Die Dateiendung anhand des tatsächlichen MIME-Typs bzw. der Bytes wählen.
Wenn die ursprüngliche Antwort geprüft werden muss
Wenn das Ergebnis einer Bildgenerierung oder -bearbeitung geprüft werden muss, die ursprüngliche operation_id/X-Client-Request-ID und die zurückgegebenen Ergebnisinformationen aufbewahren. Bereits vorhandene eigene Ergebnisse über die Medienbibliothek anhand tatsächlicher task_id- oder asset_id-Werte wiederherstellen. Die Generierungs-/Bearbeitungsanfrage nicht erneut senden und keine Abfrage-URL aus operation_id bilden.
Antwortfelder
| Feld | Typ |
|---|---|
Feldcreated | Typinteger |
Felddata[].url | Typstring |
Felddata[].b64_json | Typbase64 string |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Antwortserver_error | BedingungDie zurückgegebene Antwort gibt an, dass der Vorgang oder das Ergebnis eine Prüfung erfordert | Nächster SchrittDie ursprünglich zurückgegebene Vorgangs-/Aufgaben-ID, die Anfrageheader und die Antwort aufbewahren; mit unterstützten Leseaufrufen für diesen ursprünglichen Vorgang fortfahren. Die Erstellungsanfrage nicht erneut senden. |
Aliasnamen
Modellaliasnamen
Ailoot wan2.7-image-pro, wan-image, wan-image-latest
Aliasnamen für Methodenpfade
Verwenden Sie die oben angezeigten Methodenpfade.
Zugehörige Aufrufer-IDs
Ailoot · Bilder POST /v1/images/generations wan-image-latest
wan-image-latestwan2.7-image-prowan-imagewan-image-latest
Einstieg
Modell zur Erstellung von Bildern anhand einer Textvorgabe. Der Hersteller sieht die Steuerung der Farbpalette und bis zu 4K Auflösung für die gewöhnliche Text-zu-Bild-Generierung vor.
- Zulässige Eingaben
- Text
- Ergebnisse
- Bilder
In Ailoot verfügbar · Eingaben und Methoden
Ailoot · Bilder POST /v1/images/generations
- Eingabe
text- Ausgabe
image- Ausgabeformat
- Bilddatei
| Feld | Typ | Anforderung | Werte und Limits | Standard |
|---|---|---|---|---|
Feldmodel | Typstring | AnforderungErforderlich | Werte und Limits wan-image-latest | Standard— |
Feldprompt | Typstring | AnforderungErforderlich | Werte und Limits Mindestlänge: 1 | Standard— |
Feldn | Typinteger | AnforderungOptional | Werte und Limits Minimum: 1 | Standard1 |
Feldresponse_format | Typstring | AnforderungOptional | Werte und Limits url, b64_json | Standard— |
Feldstream | Typboolean | AnforderungOptional | Werte und Limits | Standardfalse |
Feldsize | Typstring | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldpartial_images | Typinteger | AnforderungOptional | Werte und Limits Modellabhängig | Standard— |
Feldimages[].image_url | Typstring | AnforderungNicht unterstützt | Werte und Limits Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Maximale Anzahl Bilder je Array: 9 Bedingungen: Eine tatsächliche URL je images[]-Objekt. Die Arrayanzahl ist von diesem Zeichenfolgen-Blattwert getrennt. Gilt, wenn: Nur JSON images/edits; JSON images/generations parst keine images-Referenzen. | Standard— |
Feldimage | Typfile | AnforderungOptional | Werte und Limits Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Gilt, wenn: Generierung mit multipart/form-data | Standard— |
Feldimage[] | Typfile[] | AnforderungOptional | Werte und Limits Maximale Anzahl Elemente: 9 Maximale Anzahl dekodierter Bytes: 20 971 520 MIME-Typen: image/png, image/jpeg Gilt, wenn: Generierung mit multipart/form-data | Standard— |
Kombinationen von Eingabematerialien
Text zu Bild · Erforderlich: prompt
reference_images_generation · Erforderlich: prompt
Methodenparameter und Lebenszyklus
| Parameter | Vertrag |
|---|---|
Parametermaterial_types | Vertragtext |
Parameterrequired | Vertragmodel, prompt |
Parameteroptional_controls | Vertragnull |
Parametercontent_type | Vertragapplication/json |
Lebenszyklus: synchronous_result_then_owned_library
GET /v1/media/tasks/{task_id} · die tatsächlich zurückgegebene task_id oder ein Eintrag in der Medienbibliothek
GET /v1/media/assets/{asset_id}/content
GET /v1/media/assets
GET /v1/media/assets/{asset_id}
Methodenstrukturen und IDs sind exakt; die Fähigkeiten des Anbieters sind von der Zulassung einer Anfrage zu unterscheiden.
Tarife
Ailoot-Methodentarife
POST /v1/images/generations- Ausgabe
- $ 0,075 pro 1K-Bild
- Ausgabe
- $ 0,075 pro 2K-Bild
Ailoot reserviert vor einer Anfrage einen geschätzten Betrag. Nach dem Ergebnis rechnet Ailoot die endgültige Gebühr anhand des gemessenen Verbrauchs ab. Bei Streaming erfolgt die Abrechnung anhand des abschließenden Verbrauchsdatensatzes. So funktionieren Reservierung und Abrechnung →
Details zum Referenztarif
Referenztarifstaffeln auf Modellebene ändern weder Methodenauswahl noch Kostenvoranschläge oder Gebühren. Für die aktive Abrechnung gelten die Tarife der ausgewählten Ailoot-Methode.
wan2.7-image-pro
Preise nach Konfiguration
| Konfiguration | Abrechnungsbedingungen | Gebühr |
|---|---|---|
| Konfigurationwan2.7-image-pro · Standardkonfiguration | AbrechnungsbedingungenStandardkonfiguration | Gebühr Eingabe · Eingabe $ 0,00 pro Aufruf Ausgabe · Ausgabe $ 0,16 pro Aufruf |
Beispielanfragen
Ailoot · Bilder
set -eu
: "${AILOOT_API_KEY:?Set your Ailoot API key}"
export AILOOT_API_KEY
export AILOOT_API_KEY
: "${AILOOT_PROMPT_FILE:?Set your actual UTF-8 image brief}"
export AILOOT_PROMPT_FILE
python3 - <<'PY_REQUEST'
import json,os
from pathlib import Path
p=json.loads('{"model": "wan-image-latest", "prompt": ""}')
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Choose your actual UTF-8 brief")
p['prompt']=f.read_text(encoding="utf-8")
if not p['prompt'].strip():raise SystemExit("Brief must contain text")
Path("request.json").write_text(json.dumps(p,ensure_ascii=False))
PY_REQUEST
curl --fail-with-body --silent --show-error https://api.ailoot.ai/v1/images/generations \
-H "Authorization: Bearer $AILOOT_API_KEY" -H 'Content-Type: application/json' \
--data-binary @request.json -D response-headers.txt -o result.json
python3 - <<'PY_RESULT'
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin
def save_images(items):
if not items: raise SystemExit("No completed images; retain the full response")
for index, item in enumerate(items):
encoded=item.get("b64_json")
uri=item.get("url", "")
if not encoded and uri.startswith("data:image/"):
header, separator, encoded=uri.partition(",")
if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
if encoded:
raw=base64.b64decode(encoded,validate=True)
elif uri:
uri=urljoin("https://api.ailoot.ai",uri)
parsed=urlsplit(uri)
if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
raise SystemExit("Invalid returned image URL")
owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
args=["curl","--fail-with-body","--silent","--show-error",uri]
if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
temporary=Path(f"image-{index}.bin")
subprocess.run(args+["-o",str(temporary)],check=True)
raw=temporary.read_bytes()
temporary.unlink()
else: raise SystemExit("Image has neither bytes nor URL")
if not raw: raise SystemExit("Empty image result")
ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
Path(f"image-{index}.{ext}").write_bytes(raw)
print("Every returned image saved; complete response metadata retained")
save_images(json.loads(Path("result.json").read_text())["data"])
PY_RESULT
from openai import OpenAI
import base64, json, os, subprocess
from pathlib import Path
from urllib.parse import urlsplit, urljoin
def save_images(items):
if not items: raise SystemExit("No completed images; retain the full response")
for index, item in enumerate(items):
encoded=item.get("b64_json")
uri=item.get("url", "")
if not encoded and uri.startswith("data:image/"):
header, separator, encoded=uri.partition(",")
if not separator or ";base64" not in header: raise SystemExit("Unsupported image data URI")
if encoded:
raw=base64.b64decode(encoded,validate=True)
elif uri:
uri=urljoin("https://api.ailoot.ai",uri)
parsed=urlsplit(uri)
if parsed.scheme!="https" or not parsed.netloc or parsed.username or parsed.password:
raise SystemExit("Invalid returned image URL")
owned=parsed.netloc=="api.ailoot.ai" and parsed.path.startswith("/v1/media/assets/") and parsed.path.endswith("/content")
args=["curl","--fail-with-body","--silent","--show-error",uri]
if owned: args += ["-H","Authorization: Bearer "+os.environ["AILOOT_API_KEY"]]
temporary=Path(f"image-{index}.bin")
subprocess.run(args+["-o",str(temporary)],check=True)
raw=temporary.read_bytes()
temporary.unlink()
else: raise SystemExit("Image has neither bytes nor URL")
if not raw: raise SystemExit("Empty image result")
ext="png" if raw.startswith(b"\x89PNG") else "jpg" if raw.startswith(b"\xff\xd8") else "webp" if raw[:4]==b"RIFF" and raw[8:12]==b"WEBP" else "svg" if raw.lstrip().startswith((b"<svg",b"<?xml")) else "bin"
Path(f"image-{index}.{ext}").write_bytes(raw)
print("Every returned image saved; complete response metadata retained")
f=Path(os.environ["AILOOT_PROMPT_FILE"])
if not f.is_file():raise SystemExit("Set your actual UTF-8 image brief file")
request={'model': 'wan-image-latest', 'prompt': ''}
request["prompt"]=f.read_text(encoding="utf-8")
client=OpenAI(base_url="https://api.ailoot.ai/v1",api_key=os.environ["AILOOT_API_KEY"],max_retries=0)
result=client.images.generate(**request)
Path("sdk-result.txt").write_text(str(result),encoding="utf-8")
save_images([{"b64_json":getattr(item,"b64_json",None),"url":getattr(item,"url",None)} for item in result.data])
import OpenAI from "openai";
import { readFileSync, writeFileSync } from "node:fs";
const key=process.env.AILOOT_API_KEY;
if(!key) throw new Error("Set your actual Ailoot API key");
const client=new OpenAI({baseURL:"https://api.ailoot.ai/v1",apiKey:key,maxRetries:0});
const request={"model": "wan-image-latest", "prompt": ""};
if(!process.env.AILOOT_PROMPT_FILE)throw new Error("Set your actual UTF-8 image brief file");
request.prompt=readFileSync(process.env.AILOOT_PROMPT_FILE,"utf8");
const result=await client.images.generate(request);
writeFileSync("sdk-result.json",JSON.stringify(result,null,2));
if(!result.data?.length) throw new Error("No completed images");
for(let index=0;index<result.data.length;index++) {
const item=result.data[index];let encoded=item.b64_json,uri=item.url||"",raw;
if(!encoded && uri.startsWith("data:image/")) {
const comma=uri.indexOf(",");if(comma<0 || !uri.slice(0,comma).includes(";base64")) throw new Error("Unsupported image data URI");
encoded=uri.slice(comma+1);
}
if(encoded) {
if(encoded.length%4!==0 || !/^[A-Za-z0-9+/]*={0,2}$/.test(encoded)) throw new Error("Invalid Base64");
raw=Buffer.from(encoded,"base64");
} else if(uri) {
const u=new URL(uri,"https://api.ailoot.ai");
if(u.protocol!=="https:" || u.username || u.password) throw new Error("Invalid returned URL");
const owned=u.origin==="https://api.ailoot.ai" && u.pathname.startsWith("/v1/media/assets/") && u.pathname.endsWith("/content");
const response=await fetch(u,{headers:owned?{Authorization:"Bearer "+key}:{},redirect:"manual"});
if(!response.ok) throw new Error("Image content download failed: "+response.status);
raw=Buffer.from(await response.arrayBuffer());
} else throw new Error("Image has neither bytes nor URL");
if(!raw.length) throw new Error("Empty image result");
const ext=raw.subarray(0,4).equals(Buffer.from([137,80,78,71]))?"png":raw[0]===255&&raw[1]===216?"jpg":raw.toString("ascii",0,4)==="RIFF"&&raw.toString("ascii",8,12)==="WEBP"?"webp":raw.toString("utf8").trimStart().startsWith("<svg")||raw.toString("utf8").trimStart().startsWith("<?xml")?"svg":"bin";
writeFileSync(`image-${index}.${ext}`,raw);
}
console.log("Every returned image saved; sdk-result.json retains complete metadata");
Ergebnisse abrufen und speichern
Ailoot · Bilder
Laden Sie jedes zurückgegebene Bild herunter oder speichern Sie seinen Base64-Inhalt
GET /v1/media/tasks/{task_id}GET /v1/media/assets/{asset_id}/contentGET /v1/media/assetsGET /v1/media/assets/{asset_id}
Alle fertiggestellten Ergebnisse aufbewahren
Speichern Sie jedes fertiggestellte Bild; rufen Sie jede zurückgegebene URL ab oder dekodieren Sie seinen Base64-Inhalt.
Jedes Datenelement speichern. Jedes b64_json dekodieren oder jede zurückgegebene signierte URL abrufen. Die Dateiendung anhand des tatsächlichen MIME-Typs bzw. der Bytes wählen.
Wenn die ursprüngliche Antwort geprüft werden muss
Wenn das Ergebnis einer Bildgenerierung oder -bearbeitung geprüft werden muss, die ursprüngliche operation_id/X-Client-Request-ID und die zurückgegebenen Ergebnisinformationen aufbewahren. Bereits vorhandene eigene Ergebnisse über die Medienbibliothek anhand tatsächlicher task_id- oder asset_id-Werte wiederherstellen. Die Generierungs-/Bearbeitungsanfrage nicht erneut senden und keine Abfrage-URL aus operation_id bilden.
Antwortfelder
| Feld | Typ |
|---|---|
Feldcreated | Typinteger |
Felddata[].url | Typstring |
Felddata[].b64_json | Typbase64 string |
Feldusage | Typobject |
Fehler und nächste Schritte
| Antwort | Bedingung | Nächster Schritt |
|---|---|---|
Antwort400 · invalid_request_error | BedingungPflichtfelder, Darstellung des Eingabematerials oder Parameterwert ungültig | Nächster SchrittDie angegebenen Felder vor einer neuen Erstellungsanfrage korrigieren. |
Antwortserver_error | BedingungDie zurückgegebene Antwort gibt an, dass der Vorgang oder das Ergebnis eine Prüfung erfordert | Nächster SchrittDie ursprünglich zurückgegebene Vorgangs-/Aufgaben-ID, die Anfrageheader und die Antwort aufbewahren; mit unterstützten Leseaufrufen für diesen ursprünglichen Vorgang fortfahren. Die Erstellungsanfrage nicht erneut senden. |
Aliasnamen
Modellaliasnamen
Ailoot wan2.7-image-pro, wan-image, wan-image-latest
Aliasnamen für Methodenpfade
Verwenden Sie die oben angezeigten Methodenpfade.
Zugehörige Aufrufer-IDs
FAQ · wan2.7-image-pro
- Welche Eingaben und Ergebnisse sind verfügbar?
POST /v1/images/generations·wan2.7-image-pro:text→imagePOST /v1/images/generations·wan-image:text→imagePOST /v1/images/generations·wan-image-latest:text→image- Welche Felder verwendet die Anfrage?
POST /v1/images/generations·wan2.7-image-pro:model,prompt,n,response_format,stream,image,image[]POST /v1/images/generations·wan-image:model,prompt,n,response_format,stream,image,image[]POST /v1/images/generations·wan-image-latest:model,prompt,n,response_format,stream,image,image[]- Welche Grenzen gelten?
POST /v1/images/generations·wan2.7-image-pro:n.minimum:1POST /v1/images/generations·wan-image:n.minimum:1POST /v1/images/generations·wan-image-latest:n.minimum:1