Crea un video Wan
Crea un video Wan da testo, contenuti multimediali di riferimento o primo e ultimo fotogramma tramite CometAPI, quindi interroga l’attività e scarica il file MP4.
id restituito per interrogare l’attività e scaricare il video completato.
POST /v1/videos utilizza multipart/form-data. Invia un valore intero esplicito seconds e un size nel formato WxH.
Scegli una modalità di input
Ogni modalità richiedemodel e prompt. Gli input multimediali disponibili dipendono dal modello:
Usa immagini di riferimento
Perwan2.7, wan3.0 e wan3.0-prime, invia immagini di riferimento tramite input_reference come URL HTTPS accessibili pubblicamente o file caricati.
Per più immagini, ripeti il campo nell’ordine delle immagini, con un URL o file per campo.
Usa solo URL o solo file all’interno di input_reference. Invia ogni URL separatamente anziché combinare gli URL in un valore separato da virgole.
Usa immagini PNG o JPEG fino a 20 MB ciascuna.
Un singolo URL o file input_reference utilizza il flusso di lavoro da immagine a video. L’immagine guida la composizione e l’aspetto; usa il prompt per descrivere il movimento e il comportamento della videocamera.
Per wan3.0 e wan3.0-prime, invia al massimo 10 immagini di riferimento tramite input_reference, sia che utilizzi URL sia file caricati.
Usa video e audio di riferimento
Invia i video tramitereference_videos e i clip audio tramite reference_audios, ripetendo ciascun campo una volta per ogni input.
Ogni input può essere un URL HTTPS accessibile pubblicamente o un file caricato.
Per i riferimenti video, usa file MP4 con video codificato in H.264. Per i riferimenti audio, usa file MP3 separati.
Campi diversi possono utilizzare tipi di input diversi, ad esempio un URL di immagine insieme a video caricati. All’interno di reference_videos o reference_audios, usa solo URL oppure solo file.
Puoi caricare fino a cinque file video, ciascuno di massimo 50 MiB (50 × 1024 × 1024 byte).
Puoi caricare fino a cinque file audio, ciascuno di massimo 15 MiB (15 × 1024 × 1024 byte).
Riferimenti video Wan 2.6
Invia da uno a trereference_videos, ciascuno di 2–30 secondi, fino a 30 MB e almeno 16 fps.
Questi limiti si applicano sia agli URL sia ai video caricati. Nel prompt, fai riferimento ai soggetti come @Video1, @Video2 e @Video3 nell’ordine degli input.
Per questa modalità, ometti input_reference, reference_audios, first_frame e last_frame. Imposta seconds su 5 o 10.
Questi esempi creano un video di cinque secondi a partire da due riferimenti video. Sostituisci gli URL dei media o i nomi dei file con i tuoi input:
Riferimenti immagini e video Wan 2.7
Combina riferimenti di immagini e video per guidare l’aspetto e il movimento del soggetto. Impostaseconds su un numero intero da 2 a 10. Ometti reference_audios.
Usa due URL di immagini o due immagini caricate con un riferimento video:
Riferimenti di immagini, video e audio Wan 3.0
Perwan3.0 e wan3.0-prime, combina riferimenti di immagini e video con riferimenti audio per guidare aspetto, movimento e ritmo.
Invia al massimo cinque riferimenti video, con una durata complessiva massima di 15 secondi. Ogni video deve avere almeno 16 fps.
Invia al massimo cinque riferimenti audio, con una durata complessiva massima di 15 secondi. Calcola separatamente la durata di video e audio.
Imposta seconds dell’output su un numero intero da 2 a 30.
Usa due URL di immagini o due immagini caricate con un video e due clip audio:
Usa il primo e l’ultimo fotogramma
Perwan2.7, wan3.0 e wan3.0-prime, invia first_frame per l’immagine iniziale e, facoltativamente, last_frame per l’immagine finale.
Ogni campo accetta un URL HTTPS PNG o JPEG accessibile pubblicamente oppure un file PNG o JPEG caricato.
Per gli input dei fotogrammi Wan 2.7, l’immagine iniziale determina le proporzioni, mentre size seleziona il livello di risoluzione dell’output.
Invia gli input dei fotogrammi in una richiesta separata da input_reference, reference_videos e reference_audios.
Questi esempi di Wan 2.7 creano una transizione tra i fotogrammi iniziale e finale:
Imposta durata e dimensioni
Inviaseconds come numero intero compreso nell’intervallo previsto per il modello e la modalità di input.
size su uno dei valori WxH seguenti per il modello di destinazione.
I valori delle dimensioni di Wan 3.0 si applicano anche a wan3.0-prime.
Valori delle dimensioni di Wan 3.0
Valori delle dimensioni di Wan 2.7
Valori delle dimensioni di Wan 2.6
Flusso dell’attività
Crea l'attività
id restituito.Interroga l'attività
status non è completed, failed o error.Scarica il risultato
completed, chiama Recupera il contenuto del video Wan per scaricare il file MP4.Autorizzazioni
Bearer authentication. Use your CometAPI API key.
Corpo
Wan model ID: wan2.6, wan2.7, wan3.0, or wan3.0-prime. Use wan2.6 for text or reference-video input. Use wan2.7 for text, image/video references, or frame inputs. Use wan3.0 or wan3.0-prime to also include reference audio.
"wan3.0"
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: 832x480, 480x832, 624x624, 640x480, 480x640, 1280x720, 720x1280, 960x960, 1088x832, 832x1088, 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://Risposta
Task created. Store the returned id and poll GET /v1/videos/{task_id}.
Task ID. Use this value with retrieve and content endpoints.
"task_example"
Object type. Video tasks return video.
"video"
Model ID used for the task.
"wan3.0"
Task lifecycle status. Poll until the value is completed, failed, or error.
queued, in_progress, completed, failed, error "queued"
Task progress as a coarse percentage.
0 <= x <= 1000
Task creation time as a Unix timestamp in seconds.
1779938152
Compatibility alias for id when present.
"task_example"
Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.
1779938219
Temporary video delivery URL. This field appears on completed tasks.
"<temporary-video-url>"
Failure details. This field appears when the task fails.