Zum Inhalt springen
Öffne CastalyKonsole

Video

wan2.7-r2v API

Verwenden Sie die genaue wan2.7-r2v-Modell-ID über das asynchrone Videorouting von Modelflare.

Verwenden Sie die genaue Modell-ID wan2.7-r2v. Das Modellfeld muss genau mit dieser Seite übereinstimmen.

Beispielausgabewan2.7-r2vPOST /v1/videos5.0s

Parameter: duration=5resolution=1080Pratio=16:9Referenzbild

Prompt: One continuous take, no cuts. Keep the glass flowers from the reference exactly as they are and carry them into a new place: a wide city crossing at night in the rain. The whole bed of glass blooms now grows straight out of the wet asphalt across the junction, ringing as the rain strikes them, headlights firing caustics along the road. The camera starts at kerb height among the stems, moves forward through them and rises to look down the length of the crossing. One hard pink key from a shopfront on the left, cold blue signals behind. Real weight and inertia, glass and water, no text.

Anfrage, die dieses Beispiel erstellt hat, wobei die Eingabemedien-URL ersetzt wurde
{
"model": "wan2.7-r2v",
"input": {
"prompt": "One continuous take, no cuts. Keep the glass flowers from the reference exactly as they are and carry them into a new place: a wide city crossing at night in the rain. The whole bed of glass blooms now grows straight out of the wet asphalt across the junction, ringing as the rain strikes them, headlights firing caustics along the road. The camera starts at kerb height among the stems, moves forward through them and rises to look down the length of the crossing. One hard pink key from a shopfront on the left, cold blue signals behind. Real weight and inertia, glass and water, no text.",
"media": [
{
"type": "reference_image",
"url": "https://example.com/input-image.png"
}
]
},
"parameters": {
"duration": 5,
"resolution": "1080P",
"ratio": "16:9"
}
}

Verwenden Sie einen Modelflare-API-Schlüssel mit https://modelflare.dev/v1. Der Gateway-Einstiegspunkt ist POST /v1/videos.

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
Terminal-Fensterbash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-r2v",
"input": {"prompt": "The subject in Image 1 walks through the street from Video 1.", "media": [{"type": "reference_image", "url": "https://example.com/reference.png"}, {"type": "reference_video", "url": "https://example.com/reference.mp4"}]},
"parameters": {"resolution": "1080P", "ratio": "16:9", "duration": 5, "prompt_extend": false, "watermark": false}
}'

Speichern Sie die Aufgaben-ID. Abfrage GET /v1/videos/{task_id} und Download mit GET /v1/videos/{task_id}/content. Ergebnis-URLs können ablaufen. Übertragen Sie die Datei daher umgehend.

Terminal-Fensterbash
curl https://modelflare.dev/v1/videos/TASK_ID \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"

Wan verwendet üblicherweise input und parameters; Frame-Guided- und Reference-Media-Modi dürfen nicht gemischt werden.

Wan2.7 R2V verwendet reference_image/reference_video-Medien und kann reference_voice anhängen. Mischen Sie diesen Workflow nicht mit den Rollen first_frame/last_frame.

Feld Erforderlich Notizen
model Ja wan2.7-r2v
input.prompt Ja Beschreiben Sie die Szene und das Referenzmedium mithilfe der dokumentierten Syntax
input.media[] Ja Mindestens ein reference_image oder reference_video
input.media[].reference_voice Nein Öffentliche WAV/MP3-URL für Spracheigenschaften
parameters.resolution Nein 720P / 1080P (Standard 1080P)
parameters.ratio Nein 16:9 / 9:16 / 1:1 / 4:3 / 3:4 (wird ignoriert, wenn first_frame vorhanden ist)
parameters.duration Nein Verwenden Sie die kürzere Dauerbegrenzung, wenn ein Referenzvideo vorhanden ist
parameters.prompt_extend Nein Legen Sie „false“ fest, wenn dieser dedizierte Modellvertrag dies erfordert
parameters.watermark Nein Ob ein Wasserzeichen hinzugefügt werden soll
parameters.seed Nein Optionaler zufälliger Startwert

R2V erfordert mindestens ein reference_image oder reference_video mit höchstens fünf Referenzbildern/-videos zusammen. Es können ein first_frame und ein reference_voice angeschlossen werden; Die Dauerbegrenzung ist kürzer, wenn ein Referenzvideo vorhanden ist.

Terminal-Fensterbash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-r2v",
"input": {"prompt": "让图像主体沿视频动作自然移动", "media": [
{"type": "reference_image", "url": "https://example.com/subject.png"},
{"type": "reference_video", "url": "https://example.com/motion.mp4"}
]},
"parameters": {"resolution": "1080P", "duration": 8, "prompt_extend": false}
}'

Ungültige Modellparameter geben ein 4xx mit einer Anforderungs-ID zurück. Eine asynchrone Aufgabe kann auch nach erfolgreicher Erstellung als fehlgeschlagen gelten. Verwenden Sie error_code und error_message aus der Umfrageantwort als letzten Aufgabengrund. Wiederholen Sie dieselbe Anfrage nicht mit einer anderen JSON-Form.

Auf dieser Seite werden Modelflare-Modellgenerierungs- und -bearbeitungsaufrufe behandelt. Such- oder Kartenanreicherung, Sprachverwaltung und Elementbibliotheksverwaltung sind Ressourcen-APIs außerhalb dieser öffentlichen Modellaufrufoberfläche und keine erforderlichen Anforderungsfelder.

Dieses Modell verwendet eine Videoabrechnung pro Sekunde. Den aktuellen Kundenpreis, den Referenzlistenpreis und die vollständige Spezifikation finden Sie auf der Modellpreisseite.

Modell-ID Unterschied
wan2.7-r2v Das auf dieser Seite dokumentierte Modell.
Medienvertrag · v1

Vertrags-ID: media.wan2-7-r2v.v1Adapter: video.wan.r2v.v1@v1Fingerabdruck: 6f91913f171eb3e1e3ee31dbe85b9609d9ddbacc33bb89810a5c580807650414

Offizielle Quelle: Alibaba Cloud Model Studio

Vertragsparameter

AbsichtsfeldSteuerelementOptionen
ratioselect16:9 / 9:16 / 1:1 / 4:3 / 3:4
resolutionselect720p / 1080p
durationselect2 / 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15

Unterstützte Funktion

  • allowed_values · ratio · 16:9, 9:16, 1:1, 4:3, 3:4
  • allowed_values · resolution · 720p, 1080p
  • allowed_values · duration · 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
  • required_assets · reference_asset_ids
  • max_assets · reference_asset_ids · 6

Beispiel für eine strukturierte Anfrage

reference

Absicht

{
  "duration": 2,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "reference_asset_ids": [
    "asset_example"
  ],
  "resolution": "720p"
}

Anbieteranfrage

{
  "input": {
    "media": [
      {
        "type": "reference_image",
        "url": "https://example.com/reference.png"
      }
    ],
    "prompt": "A red paper kite over a quiet harbour at dusk."
  },
  "model": "wan2.7-r2v",
  "parameters": {
    "duration": 2,
    "resolution": "720P"
  }
}