Ein Wan-Video erstellen
Erstellen Sie über CometAPI ein Wan-Video aus Text, Referenzmedien oder Start- und Endframes, fragen Sie dann die Aufgabe ab und laden Sie die MP4-Datei herunter.
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F model=wan3.0 \
-F 'prompt=A small robot walks through a bright greenhouse with smooth camera movement.' \
-F seconds=5 \
-F size=1920x1080{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "wan3.0",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id, um die Aufgabe abzufragen und das fertige Video herunterzuladen.
POST /v1/videos verwendet multipart/form-data. Senden Sie einen expliziten ganzzahligen Wert für seconds und einen size im Format WxH.
wan3.0-prime verwendet dieselben öffentlichen Anfragefelder, Medienbeschränkungen und denselben Aufgabenablauf wie wan3.0. Setzen Sie model auf den exakten Wert wan3.0-prime, wenn Sie Prime ansprechen. Prime unterstützt Text-zu-Video, Bild-zu-Video, Eingaben für Start- und Endframes sowie kombinierte Bild-, Video- und Audioreferenzen. Referenzmedien und Frame-Eingaben müssen in separaten Anfragen gesendet werden.
Eingabemodus auswählen
Jeder Modus erfordertmodel und prompt. Die verfügbaren Medieneingaben hängen vom Modell ab:
| Ziel | Modell-IDs | Medienfelder |
|---|---|---|
| Text-zu-Video | wan2.6, wan2.7, wan3.0, wan3.0-prime | Medienfelder weglassen |
| Bild-zu-Video | wan2.7, wan3.0, wan3.0-prime | input_reference URLs oder hochgeladene Bilddateien |
| Referenzvideo | wan2.6 | reference_videos nur |
| Bild- und Videoreferenzen | wan2.7, wan3.0, wan3.0-prime | input_reference mit reference_videos |
| Bild-, Video- und Audioreferenzen | wan3.0, wan3.0-prime | Bild-/Videoreferenzen mit reference_audios |
| Start- und Endframes | wan2.7, wan3.0, wan3.0-prime | first_frame, optional last_frame |
Ein Wan 3.0 Prime-Video erstellen
Diese minimale Anfrage erstellt eine fünfsekündige Text-zu-Video-Aufgabe mit Prime:prompt='A small robot walks through a bright greenhouse '
prompt+='with smooth camera movement.'
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan3.0-prime' \
--form-string "prompt=$prompt" \
-F 'seconds=5' \
-F 'size=1920x1080'
Referenzbilder verwenden
Fürwan2.7, wan3.0 und wan3.0-prime senden Sie Referenzbilder über input_reference als öffentlich zugängliche HTTPS-URLs oder hochgeladene Dateien.
Bei mehreren Bildern wiederholen Sie das Feld in Bildreihenfolge, mit einer URL oder Datei pro Feld.
Verwenden Sie innerhalb von input_reference entweder ausschließlich URLs oder ausschließlich Dateien. Senden Sie jede URL separat, statt URLs zu einem kommagetrennten Wert zusammenzufassen.
Verwenden Sie PNG- oder JPEG-Bilder mit einer Größe von jeweils bis zu 20 MB.
Eine einzelne input_reference-URL oder -Datei verwendet den Bild-zu-Video-Workflow. Das Bild steuert Komposition und Erscheinungsbild; verwenden Sie den Prompt, um Bewegung und Kameraverhalten zu beschreiben.
Für wan3.0 und wan3.0-prime senden Sie über input_reference höchstens 10 Referenzbilder, unabhängig davon, ob Sie URLs oder hochgeladene Dateien verwenden.
Referenzvideos und -audio verwenden
Senden Sie Videos überreference_videos und Audioclips über reference_audios, wobei Sie jedes Feld einmal pro Eingabe wiederholen.
Jede Eingabe kann eine öffentlich zugängliche HTTPS-URL oder eine hochgeladene Datei sein.
Verwenden Sie für Videoreferenzen MP4-Dateien mit H.264-codiertem Video. Verwenden Sie für Audioreferenzen separate MP3-Dateien.
Verschiedene Felder können unterschiedliche Eingabetypen verwenden, beispielsweise eine Bild-URL zusammen mit hochgeladenen Videos. Verwenden Sie innerhalb von reference_videos oder reference_audios entweder ausschließlich URLs oder ausschließlich Dateien.
Sie können bis zu fünf Videodateien hochladen, jeweils maximal 50 MiB (50 × 1024 × 1024 Byte).
Sie können bis zu fünf Audiodateien hochladen, jeweils maximal 15 MiB (15 × 1024 × 1024 Byte).
Wan 2.6-Videoreferenzen
Senden Sie ein bis dreireference_videos, jeweils 2–30 Sekunden lang, bis zu 30 MB groß und mit mindestens 16 fps.
Diese Grenzwerte gelten sowohl für URLs als auch für hochgeladene Videos. Beziehen Sie sich im Prompt in der Eingabereihenfolge auf Motive als @Video1, @Video2 und @Video3.
Lassen Sie für diesen Modus input_reference, reference_audios, first_frame und last_frame weg. Setzen Sie seconds auf 5 oder 10.
Diese Beispiele erstellen aus zwei Videoreferenzen ein fünf Sekunden langes Video. Ersetzen Sie die Medien-URLs oder Dateinamen durch Ihre Eingaben:
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan2.6' \
--form-string 'prompt=Keep @Video1 and @Video2 recognizable as they walk.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'reference_videos=https://your-media-host/reference-1.mp4' \
-F 'reference_videos=https://your-media-host/reference-2.mp4'
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan2.6' \
--form-string 'prompt=Keep @Video1 and @Video2 recognizable as they walk.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'reference_videos=@reference-1.mp4;type=video/mp4' \
-F 'reference_videos=@reference-2.mp4;type=video/mp4'
Wan 2.7-Bild- und Videoreferenzen
Kombinieren Sie Bild- und Videoreferenzen, um das Erscheinungsbild und die Bewegung von Motiven zu steuern. Setzen Sieseconds auf eine ganze Zahl von 2 bis 10. Lassen Sie reference_audios weg.
Verwenden Sie zwei Bild-URLs oder zwei hochgeladene Bilder mit einer Videoreferenz:
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan2.7' \
-F 'prompt=Preserve the image subjects and follow the video motion.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'input_reference=https://your-image-host/reference-1.png' \
-F 'input_reference=https://your-image-host/reference-2.jpg' \
-F 'reference_videos=https://your-media-host/reference.mp4'
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan2.7' \
-F 'prompt=Preserve the image subjects and follow the video motion.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'input_reference=@reference-1.png;type=image/png' \
-F 'input_reference=@reference-2.jpg;type=image/jpeg' \
-F 'reference_videos=@reference.mp4;type=video/mp4'
Wan 3.0-Bild-, Video- und Audioreferenzen
Kombinieren Sie fürwan3.0 und wan3.0-prime Bild- und Videoreferenzen mit Audioreferenzen, um Erscheinungsbild, Bewegung und Rhythmus zu steuern.
Senden Sie höchstens fünf Videoreferenzen mit einer Gesamtdauer von höchstens 15 Sekunden. Jedes Video muss mindestens 16 fps haben.
Senden Sie höchstens fünf Audioreferenzen mit einer Gesamtdauer von höchstens 15 Sekunden. Zählen Sie die Video- und Audiodauer getrennt.
Setzen Sie die Ausgabe seconds auf eine ganze Zahl von 2 bis 30.
Verwenden Sie zwei Bild-URLs oder zwei hochgeladene Bilder mit einem Video und zwei Audioclips:
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan3.0' \
-F 'prompt=Preserve image subjects, video motion, and audio rhythm.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'input_reference=https://your-image-host/reference-1.png' \
-F 'input_reference=https://your-image-host/reference-2.jpg' \
-F 'reference_videos=https://your-media-host/reference.mp4' \
-F 'reference_audios=https://your-media-host/reference-1.mp3' \
-F 'reference_audios=https://your-media-host/reference-2.mp3'
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan3.0-prime' \
-F 'prompt=Preserve image subjects, video motion, and audio rhythm.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'input_reference=https://your-image-host/reference-1.png' \
-F 'input_reference=https://your-image-host/reference-2.jpg' \
-F 'reference_videos=https://your-media-host/reference.mp4' \
-F 'reference_audios=https://your-media-host/reference-1.mp3' \
-F 'reference_audios=https://your-media-host/reference-2.mp3'
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan3.0' \
-F 'prompt=Preserve image subjects, video motion, and audio rhythm.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'input_reference=@reference-1.png;type=image/png' \
-F 'input_reference=@reference-2.jpg;type=image/jpeg' \
-F 'reference_videos=@reference.mp4;type=video/mp4' \
-F 'reference_audios=@reference-1.mp3;type=audio/mpeg' \
-F 'reference_audios=@reference-2.mp3;type=audio/mpeg'
Erste und letzte Frames verwenden
Senden Sie fürwan2.7, wan3.0 und wan3.0-prime first_frame für das Anfangsbild und optional last_frame für das Endbild.
Jedes Feld akzeptiert eine öffentlich zugängliche HTTPS-URL für eine PNG- oder JPEG-Datei oder eine hochgeladene PNG- oder JPEG-Datei.
Bei Wan 2.7-Frame-Eingaben bestimmt das Anfangsbild das Seitenverhältnis, während size die Ausgabeauflösungsstufe auswählt.
Senden Sie Frame-Eingaben in einer separaten Anfrage, getrennt von input_reference, reference_videos und reference_audios.
Diese Wan 2.7-Beispiele erstellen einen Übergang zwischen Anfangs- und Endframes:
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan2.7' \
-F 'prompt=Move smoothly from the opening frame to the ending frame.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'first_frame=https://your-image-host/first-frame.png' \
-F 'last_frame=https://your-image-host/last-frame.jpg'
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan2.7' \
-F 'prompt=Move smoothly from the opening frame to the ending frame.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'first_frame=@first-frame.png;type=image/png' \
-F 'last_frame=@last-frame.jpg;type=image/jpeg'
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan3.0' \
-F 'prompt=Move smoothly from the opening frame to the ending frame.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'first_frame=https://your-image-host/first-frame.png' \
-F 'last_frame=https://your-image-host/last-frame.jpg'
curl \
https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan3.0-prime' \
-F 'prompt=Move smoothly from the opening frame to the ending frame.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'first_frame=https://your-image-host/first-frame.png' \
-F 'last_frame=https://your-image-host/last-frame.jpg'
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F 'model=wan3.0' \
-F 'prompt=Move smoothly from the opening frame to the ending frame.' \
-F 'seconds=5' \
-F 'size=1280x720' \
-F 'first_frame=@first-frame.png;type=image/png' \
-F 'last_frame=@last-frame.jpg;type=image/jpeg'
Dauer und Größe festlegen
Senden Sieseconds als ganze Zahl innerhalb des Bereichs für Ihr Modell und Ihren Eingabemodus.
| Modell-ID | Eingabemodus | seconds | Standard |
|---|---|---|---|
wan3.0, wan3.0-prime | Text, Referenzen oder Frames | Ganzzahl 2–30 | 5 Sekunden, 1920x1080 |
wan2.7 | Text | Ganzzahl 2–15 | 5 Sekunden, 1920x1080 |
wan2.7 | Frames | Ganzzahl 2–15 | 5 Sekunden, 1080p-Stufe; das Seitenverhältnis richtet sich nach dem Anfangsbild |
wan2.7 | Bild-/Videoreferenzen | Ganzzahl 2–10 | 5 Sekunden, 1920x1080 |
wan2.6 | Text | 5, 10, 15 | 5 Sekunden, 1920x1080 |
wan2.6 | Videoreferenzen | 5, 10 | 5 Sekunden, 1920x1080 |
size auf einen der unten aufgeführten WxH-Werte für das Zielmodell fest.
Die Wan 3.0-Größenwerte gelten auch für wan3.0-prime.
Wan 3.0-Größenwerte
| Auflösungsstufe | Seitenverhältnis | size (WxH) |
|---|---|---|
480p | 16:9 | 832x480 |
9:16 | 480x832 | |
1:1 | 624x624 | |
4:3 | 704x528 | |
3:4 | 528x704 | |
720p | 16:9 | 1280x720 |
9:16 | 720x1280 | |
1:1 | 960x960 | |
4:3 | 1088x832 | |
3:4 | 832x1088 | |
1080p | 16:9 | 1920x1080 |
9:16 | 1080x1920 | |
1:1 | 1440x1440 | |
4:3 | 1632x1248 | |
3:4 | 1248x1632 |
Wan 2.7-Größenwerte
| Auflösungsstufe | Seitenverhältnis | size (WxH) |
|---|---|---|
720p | 16:9 | 1280x720 |
9:16 | 720x1280 | |
1080p | 16:9 | 1920x1080 |
9:16 | 1080x1920 | |
1:1 | 1440x1440 |
Wan 2.6-Größenwerte
| Auflösungsstufe | Seitenverhältnis | size (WxH) |
|---|---|---|
720p | 16:9 | 1280x720 |
9:16 | 720x1280 | |
4:3 | 1088x832 | |
3:4 | 832x1088 | |
1080p | 16:9 | 1920x1080 |
9:16 | 1080x1920 | |
1:1 | 1440x1440 | |
4:3 | 1632x1248 | |
3:4 | 1248x1632 |
Aufgabenablauf
Aufgabe erstellen
id.Aufgabe abfragen
status den Wert completed, failed oder error hat.Ergebnis herunterladen
completed ist, rufen Sie Wan-Videoinhalt abrufen auf, um die MP4-Datei herunterzuladen.Autorisierungen
Body
Wan model ID: wan2.6, wan2.7, wan3.0, or wan3.0-prime. Wan 3.0 and Wan 3.0 Prime use the same public request fields, task flow, and media limits; use the exact model ID wan3.0-prime when targeting Prime. Use wan2.6 for text or reference-video input. Use wan2.7 for text, image/video references, or frame inputs. Wan 3.0 and Wan 3.0 Prime also support reference audio.
"wan3.0-prime"
Text prompt that describes the video to generate. Describe the appearance and motion to preserve from references, or the transition between first_frame and last_frame. For wan2.6 video references, use @Video1, @Video2, and @Video3 in input order.
"A small robot walks through a bright greenhouse with smooth camera movement."
Requested output duration in whole seconds. Send an explicit integer. For wan2.6 reference-to-video, use 5 or 10; text-to-video also accepts 15. For wan2.7 reference-to-video, use 2 through 10; text and frame inputs accept 2 through 15. For wan3.0 and wan3.0-prime, use 2 through 30. Default is 5.
2 <= x <= 305
Supported WxH size values. For wan3.0 and wan3.0-prime, 480p: 832x480, 480x832, 624x624, 704x528, 528x704; 720p: 1280x720, 720x1280, 960x960, 1088x832, 832x1088; 1080p: 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.6: 1280x720, 720x1280, 1088x832, 832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For wan2.7: 1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default is 1920x1080. For Wan 2.7 frame inputs, the opening image determines the aspect ratio; size selects the output resolution tier.
"1920x1080"
PNG or JPEG reference images for wan2.7, wan3.0, and wan3.0-prime. Repeat input_reference with one publicly accessible HTTPS image URL or uploaded image file per field. Use all URLs or all files within this field. Do not combine URLs into a comma-separated value. A single URL or file uses the image-to-video workflow. Each image can be up to 20 MB. For wan3.0 and wan3.0-prime, send at most 10 reference images, whether you use URLs or uploaded files. Image and video references can share a request; reference audio requires wan3.0 or wan3.0-prime. Submit frame inputs separately. Omit for text-to-video and wan2.6 reference-to-video. Submit images in the order you want to reference them in the prompt.
^https://Reference videos for wan2.6, wan2.7, wan3.0, and wan3.0-prime. Repeat reference_videos with publicly accessible HTTPS URLs or uploaded MP4 files with H.264 video. Use one input type within this field: all URLs or all files. For wan2.6, send 1 to 3 clips, each 2 to 30 seconds and up to 30 MB, with at least 16 fps; omit image, audio, and frame fields. For wan2.7, combine video references with image references. For wan3.0 and wan3.0-prime, send at most 5 clips totaling at most 15 seconds, with at least 16 fps. Video uploads are limited to 5 files, each at most 50 MiB (50 x 1024 x 1024 bytes); the lower wan2.6 limits still apply. Submit frame inputs separately.
1^https://Reference audio for wan3.0 and wan3.0-prime, combined with image or video references. Repeat reference_audios with publicly accessible HTTPS MP3 URLs or uploaded MP3 files. Use one input type within this field: all URLs or all files. Send at most 5 audio references totaling at most 15 seconds, counted separately from reference video duration. Audio uploads are limited to 5 files, each at most 15 MiB (15 x 1024 x 1024 bytes). Submit frame inputs separately. Omit for wan2.6 and wan2.7.
1^https://Opening frame for wan2.7, wan3.0, and wan3.0-prime, as one publicly accessible HTTPS PNG or JPEG URL or one uploaded PNG or JPEG file. Use first_frame alone or add last_frame to guide the ending. Submit frame inputs in a separate request from input_reference, reference_videos, and reference_audios. Omit for wan2.6. For Wan 2.7 frame inputs, the opening image determines the aspect ratio; size selects the output resolution tier.
^https://Ending frame for wan2.7, wan3.0, and wan3.0-prime, as one publicly accessible HTTPS PNG or JPEG URL or one uploaded PNG or JPEG file. Use with first_frame to guide the ending. Submit frame inputs in a separate request from input_reference, reference_videos, and reference_audios. Omit for wan2.6. For Wan 2.7 frame inputs, the opening image determines the aspect ratio; size selects the output resolution tier.
^https://Antwort
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
curl https://api.cometapi.com/v1/videos \
-H "Authorization: Bearer $COMETAPI_KEY" \
-F model=wan3.0 \
-F 'prompt=A small robot walks through a bright greenhouse with smooth camera movement.' \
-F seconds=5 \
-F size=1920x1080{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "wan3.0",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}