Een Wan-video maken
Maak via CometAPI een Wan-video op basis van tekst, referentiemedia of eerste en laatste frames, vraag vervolgens de taakstatus op en download het MP4-bestand.
{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "wan3.0",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}id op om de taakstatus op te vragen en de voltooide video te downloaden.
POST /v1/videos gebruikt multipart/form-data. Stuur een expliciete gehele waarde voor seconds en een size in de vorm WxH.
wan3.0-prime gebruikt dezelfde openbare aanvraagvelden, medialimieten en taakstroom als wan3.0. Stel model in op de exacte waarde wan3.0-prime wanneer je Prime gebruikt. Prime ondersteunt tekst-naar-video, afbeelding-naar-video, invoer voor eerste en laatste frames, en gecombineerde afbeeldings-, video- en audioverwijzingen. Referentiemedia en frame-invoer moeten in afzonderlijke aanvragen worden verzonden.
Kies een invoermodus
Elke modus vereistmodel en prompt. De beschikbare media-invoer hangt af van het model:
| Doel | Model-ID’s | Mediavelden |
|---|---|---|
| Tekst-naar-video | wan2.6, wan2.7, wan3.0, wan3.0-prime | Laat mediavelden weg |
| Afbeelding-naar-video | wan2.7, wan3.0, wan3.0-prime | input_reference URL’s of geüploade afbeeldingsbestanden |
| Referentievideo | wan2.6 | reference_videos alleen |
| Afbeeldings- en videoverwijzingen | wan2.7, wan3.0, wan3.0-prime | input_reference met reference_videos |
| Afbeeldings-, video- en audioverwijzingen | wan3.0, wan3.0-prime | Afbeeldings-/videoverwijzingen met reference_audios |
| Eerste en laatste frames | wan2.7, wan3.0, wan3.0-prime | first_frame, optioneel last_frame |
Een Wan 3.0 Prime-video maken
Deze minimale aanvraag maakt een tekst-naar-videotaak van vijf seconden met 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'
Referentieafbeeldingen gebruiken
Voorwan2.7, wan3.0 en wan3.0-prime verzend je referentieafbeeldingen via input_reference als openbaar toegankelijke HTTPS-URL’s of geüploade bestanden.
Herhaal voor meerdere afbeeldingen het veld in afbeeldingsvolgorde, met één URL of bestand per veld.
Gebruik binnen input_reference uitsluitend URL’s of uitsluitend bestanden. Verzend elke URL afzonderlijk in plaats van URL’s te combineren in een door komma’s gescheiden waarde.
Gebruik PNG- of JPEG-afbeeldingen van maximaal 20 MB per stuk.
Eén input_reference-URL of -bestand gebruikt de afbeelding-naar-videowerkflow. De afbeelding stuurt de compositie en het uiterlijk; gebruik de prompt om beweging en cameragedrag te beschrijven.
Verzend voor wan3.0 en wan3.0-prime maximaal 10 referentieafbeeldingen via input_reference, ongeacht of je URL’s of geüploade bestanden gebruikt.
Gebruik referentievideo’s en audio
Verstuur video’s viareference_videos en audiofragmenten via reference_audios, waarbij u elk veld één keer per invoer herhaalt.
Elke invoer kan een openbaar toegankelijke HTTPS-URL of een geüpload bestand zijn.
Gebruik MP4-bestanden met H.264-gecodeerde video voor videoreferenties. Gebruik afzonderlijke MP3-bestanden voor audioreferenties.
Verschillende velden kunnen verschillende invoertypen gebruiken, zoals een afbeeldings-URL met geüploade video’s. Gebruik binnen reference_videos of reference_audios uitsluitend URL’s of uitsluitend bestanden.
U kunt maximaal vijf videobestanden uploaden, elk maximaal 50 MiB (50 × 1024 × 1024 bytes).
U kunt maximaal vijf audiobestanden uploaden, elk maximaal 15 MiB (15 × 1024 × 1024 bytes).
Wan 2.6-videoreferenties
Verstuur één tot driereference_videos, elk 2–30 seconden, maximaal 30 MB en ten minste 16 fps.
Deze limieten gelden zowel voor URL’s als voor geüploade video’s. Verwijs in de Prompt naar onderwerpen als @Video1, @Video2 en @Video3 in invoervolgorde.
Laat voor deze modus input_reference, reference_audios, first_frame en last_frame weg. Stel seconds in op 5 of 10.
Deze voorbeelden maken een video van vijf seconden op basis van twee videoreferenties. Vervang de media-URL’s of bestandsnamen door uw invoer:
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-afbeeldings- en videoreferenties
Combineer afbeeldings- en videoreferenties om het uiterlijk en de beweging van onderwerpen te sturen. Stelseconds in op een geheel getal van 2 tot en met 10. Laat reference_audios weg.
Gebruik twee afbeeldings-URL’s of twee geüploade afbeeldingen met een videoreferentie:
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-afbeeldings-, video- en audioreferenties
Combineer voorwan3.0 en wan3.0-prime afbeeldings- en videoreferenties met audioreferenties om uiterlijk, beweging en ritme te sturen.
Verstuur maximaal vijf videoreferenties met een gezamenlijke duur van maximaal 15 seconden. Elke video moet ten minste 16 fps hebben.
Verstuur maximaal vijf audioreferenties met een gezamenlijke duur van maximaal 15 seconden. Tel de video- en audioduur afzonderlijk.
Stel seconds voor de uitvoer in op een geheel getal van 2 tot en met 30.
Gebruik twee afbeeldings-URL’s of twee geüploade afbeeldingen met één video en twee audiofragmenten:
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'
Gebruik eerste en laatste frames
Voorwan2.7, wan3.0 en wan3.0-prime verstuurt u first_frame voor de beginafbeelding en optioneel last_frame voor de eindafbeelding.
Elk veld accepteert één openbaar toegankelijke HTTPS PNG- of JPEG-URL of één geüpload PNG- of JPEG-bestand.
Voor Wan 2.7-frame-invoer bepaalt de beginafbeelding de beeldverhouding, terwijl size het uitvoerresolutieniveau selecteert.
Dien frame-invoer in via een afzonderlijk verzoek van input_reference, reference_videos en reference_audios.
Deze Wan 2.7-voorbeelden maken een overgang tussen begin- en eindframes:
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'
Duur en grootte instellen
Verstuurseconds als een geheel getal binnen het bereik voor je model en invoermodus.
| Model-ID | Invoermodus | seconds | Standaardwaarde |
|---|---|---|---|
wan3.0, wan3.0-prime | Tekst, referenties of frames | geheel getal 2–30 | 5 seconden, 1920x1080 |
wan2.7 | Tekst | geheel getal 2–15 | 5 seconden, 1920x1080 |
wan2.7 | Frames | geheel getal 2–15 | 5 seconden, 1080p-niveau; de beeldverhouding volgt de openingsafbeelding |
wan2.7 | Afbeeldings-/videoreferenties | geheel getal 2–10 | 5 seconden, 1920x1080 |
wan2.6 | Tekst | 5, 10, 15 | 5 seconden, 1920x1080 |
wan2.6 | Videoreferenties | 5, 10 | 5 seconden, 1920x1080 |
size in op een van de onderstaande WxH-waarden voor het doelmodel.
De groottewaarden van Wan 3.0 gelden ook voor wan3.0-prime.
Groottewaarden van Wan 3.0
| Resolutieniveau | Beeldverhouding | 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 |
Groottewaarden van Wan 2.7
| Resolutieniveau | Beeldverhouding | size (WxH) |
|---|---|---|
720p | 16:9 | 1280x720 |
9:16 | 720x1280 | |
1080p | 16:9 | 1920x1080 |
9:16 | 1080x1920 | |
1:1 | 1440x1440 |
Groottewaarden van Wan 2.6
| Resolutieniveau | Beeldverhouding | 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 |
Taakstroom
De taak maken
id op.De taak pollen
status de waarde completed, failed of error heeft.Het resultaat downloaden
completed heeft, roep Wan-video-inhoud ophalen aan om het MP4-bestand te downloaden.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://Respons
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
{
"id": "task_example",
"task_id": "task_example",
"object": "video",
"model": "wan3.0",
"status": "queued",
"progress": 0,
"created_at": 1779938152
}