Utwórz wideo Wan
Utwórz wideo Wan z tekstu, multimediów referencyjnych albo pierwszej i ostatniej klatki za pośrednictwem CometAPI, a następnie odpytyj zadanie i pobierz plik MP4.
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, aby odpytywać zadanie i pobrać gotowe wideo.
POST /v1/videos korzysta z multipart/form-data. Prześlij jawną całkowitą wartość seconds oraz size w formacie WxH.
wan3.0-prime korzysta z tych samych publicznych pól żądania, limitów multimediów i przepływu zadań co wan3.0. Ustaw model na dokładną wartość wan3.0-prime podczas kierowania żądania do Prime. Prime obsługuje generowanie wideo z tekstu, generowanie wideo z obrazu, dane wejściowe pierwszej i ostatniej klatki oraz połączone referencje do obrazów, wideo i dźwięku. Multimedia referencyjne i dane wejściowe klatek należy wysyłać w oddzielnych żądaniach.
Wybierz tryb wejściowy
Każdy tryb wymagamodel i prompt. Dostępne dane wejściowe multimediów zależą od modelu:
| Cel | Identyfikatory modeli | Pola multimediów |
|---|---|---|
| Generowanie wideo z tekstu | wan2.6, wan2.7, wan3.0, wan3.0-prime | Pomiń pola multimediów |
| Generowanie wideo z obrazu | wan2.7, wan3.0, wan3.0-prime | input_reference Adresy URL lub przesłane pliki obrazów |
| Referencyjne wideo | wan2.6 | reference_videos tylko |
| Referencje do obrazów i wideo | wan2.7, wan3.0, wan3.0-prime | input_reference z reference_videos |
| Referencje do obrazów, wideo i dźwięku | wan3.0, wan3.0-prime | Referencje do obrazów/wideo z reference_audios |
| Pierwsza i ostatnia klatka | wan2.7, wan3.0, wan3.0-prime | first_frame, opcjonalnie last_frame |
Utwórz wideo Wan 3.0 Prime
To minimalne żądanie tworzy pięciosekundowe zadanie generowania wideo z tekstu z 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'
Użyj obrazów referencyjnych
W przypadkuwan2.7, wan3.0 i wan3.0-prime wyślij obrazy referencyjne przez input_reference jako publicznie dostępne adresy URL HTTPS lub przesłane pliki.
W przypadku wielu obrazów powtórz pole w kolejności obrazów, podając jeden adres URL lub plik w każdym polu.
W obrębie input_reference używaj wyłącznie adresów URL albo wyłącznie plików. Wyślij każdy adres URL osobno, zamiast łączyć adresy URL w wartość rozdzielaną przecinkami.
Używaj obrazów PNG lub JPEG o rozmiarze do 20 MB każdy.
Pojedynczy adres URL lub plik input_reference korzysta z przepływu generowania wideo z obrazu. Obraz określa kompozycję i wygląd; użyj promptu, aby opisać ruch i zachowanie kamery.
W przypadku wan3.0 i wan3.0-prime wyślij maksymalnie 10 obrazów referencyjnych przez input_reference, niezależnie od tego, czy używasz adresów URL, czy przesłanych plików.
Używanie referencyjnych materiałów wideo i audio
Wysyłaj materiały wideo za pomocąreference_videos i klipy audio za pomocą reference_audios, powtarzając każde pole raz dla każdego wejścia.
Każde wejście może być publicznie dostępnym adresem URL HTTPS lub przesłanym plikiem.
W przypadku referencji wideo używaj plików MP4 z wideo zakodowanym w H.264. W przypadku referencji audio używaj oddzielnych plików MP3.
Różne pola mogą używać różnych typów wejścia, takich jak adres URL obrazu wraz z przesłanymi materiałami wideo. W obrębie reference_videos lub reference_audios używaj wyłącznie adresów URL albo wyłącznie plików.
Możesz przesłać maksymalnie pięć plików wideo, każdy o rozmiarze maksymalnie 50 MiB (50 × 1024 × 1024 bajtów).
Możesz przesłać maksymalnie pięć plików audio, każdy o rozmiarze maksymalnie 15 MiB (15 × 1024 × 1024 bajtów).
Referencje wideo Wan 2.6
Prześlij od jednego do trzechreference_videos, każde trwające 2–30 sekund, o rozmiarze do 30 MB i z częstotliwością co najmniej 16 fps.
Limity te dotyczą zarówno adresów URL, jak i przesłanych materiałów wideo. W Prompt odwołuj się do obiektów, używając @Video1, @Video2 i @Video3 w kolejności wejściowej.
W tym trybie pomiń input_reference, reference_audios, first_frame i last_frame. Ustaw seconds na 5 lub 10.
Te przykłady tworzą pięciosekundowe wideo na podstawie dwóch referencji wideo. Zastąp adresy URL multimediów lub nazwy plików własnymi wejściami:
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'
Referencje obrazów i wideo Wan 2.7
Łącz referencje obrazów i wideo, aby określić wygląd i ruch obiektu. Ustawseconds na liczbę całkowitą od 2 do 10. Pomiń reference_audios.
Użyj dwóch adresów URL obrazów lub dwóch przesłanych obrazów z referencją wideo:
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'
Referencje obrazów, wideo i audio Wan 3.0
W przypadkuwan3.0 i wan3.0-prime połącz referencje obrazów i wideo z referencjami audio, aby określić wygląd, ruch i rytm.
Prześlij maksymalnie pięć referencji wideo o łącznym czasie trwania nieprzekraczającym 15 sekund. Każde wideo musi mieć co najmniej 16 fps.
Prześlij maksymalnie pięć referencji audio o łącznym czasie trwania nieprzekraczającym 15 sekund. Czas trwania wideo i audio jest liczony osobno.
Ustaw wyjściowe seconds na liczbę całkowitą od 2 do 30.
Użyj dwóch adresów URL obrazów lub dwóch przesłanych obrazów z jednym wideo i dwoma klipami audio:
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'
Używanie pierwszej i ostatniej klatki
W przypadkuwan2.7, wan3.0 i wan3.0-prime wyślij first_frame dla obrazu początkowego oraz opcjonalnie last_frame dla obrazu końcowego.
Każde pole akceptuje jeden publicznie dostępny adres URL HTTPS do pliku PNG lub JPEG albo jeden przesłany plik PNG lub JPEG.
W przypadku wejściowych klatek Wan 2.7 obraz początkowy określa proporcje obrazu, a size wybiera poziom rozdzielczości wyjściowej.
Przesyłaj dane wejściowe klatek w osobnym żądaniu niż input_reference, reference_videos i reference_audios.
Te przykłady Wan 2.7 tworzą przejście między klatką początkową a końcową:
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'
Ustaw czas trwania i rozmiar
Wyślijseconds jako liczbę całkowitą mieszczącą się w zakresie dla używanego modelu i trybu wejściowego.
| Identyfikator modelu | Tryb wejściowy | seconds | Domyślnie |
|---|---|---|---|
wan3.0, wan3.0-prime | Tekst, referencje lub klatki | liczba całkowita 2–30 | 5 sekundy, 1920x1080 |
wan2.7 | Tekst | liczba całkowita 2–15 | 5 sekundy, 1920x1080 |
wan2.7 | Klatki | liczba całkowita 2–15 | 5 sekundy, poziom 1080p; współczynnik proporcji jest zgodny z obrazem otwierającym |
wan2.7 | Referencje obrazu/wideo | liczba całkowita 2–10 | 5 sekundy, 1920x1080 |
wan2.6 | Tekst | 5, 10, 15 | 5 sekundy, 1920x1080 |
wan2.6 | Referencje wideo | 5, 10 | 5 sekundy, 1920x1080 |
size na jedną z poniższych wartości WxH dla docelowego modelu.
Wartości rozmiaru Wan 3.0 mają również zastosowanie do wan3.0-prime.
Wartości rozmiaru Wan 3.0
| Poziom rozdzielczości | Współczynnik proporcji | 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 |
Wartości rozmiaru Wan 2.7
| Poziom rozdzielczości | Współczynnik proporcji | size (WxH) |
|---|---|---|
720p | 16:9 | 1280x720 |
9:16 | 720x1280 | |
1080p | 16:9 | 1920x1080 |
9:16 | 1080x1920 | |
1:1 | 1440x1440 |
Wartości rozmiaru Wan 2.6
| Poziom rozdzielczości | Współczynnik proporcji | 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 |
Przepływ zadania
Utwórz zadanie
id.Odpytuj zadanie
status będzie mieć wartość completed, failed lub error.Pobierz wynik
completed, wywołaj Pobieranie zawartości wideo Wan aby pobrać plik MP4.Treść
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://Odpowiedź
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
}