QwenCloudBRASIL
Tradução de apoio para consulta. Código e identificadores técnicos preservados. Consultar referência original ↗

Texto-para-vídeo

Gere vídeo de texto.

O Wan O modelo texto-vídeo suporta entrada multimodal, incluindo texto e áudio, e gera vídeos de até 30 segundos de resolução 1080P.

Acesso rápido:https://home.qwencloud.com/try-ai Referência da API:wan3.0](/api-reference/video-generation/wan30-video/create-task), wan2.7, [wan2.6](/api-reference/video-generation/wan-text-to-video/create-task(Guia de apoio) (/developer-guides/accuracy-tuning/video-generation)

Começando.

<table style={{width: "100%", borderCollapse: "collapse", tableLayout: "fixed"}}> <tr> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingRight: "12px"}}>? Prompt de entrada ?</th> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingLeft: "12px"}}> Vídeo de saída (multi-shot, áudio habilitado)</th> </tr>

<tr> <td style={{verticalAlign: "top", paddingRight: "12px"}}> Uma emocionante história de perseguição de detetives com histórias cinematográficas. Tiro de 1 [0-3 s]: tiro largo de uma rua chuvosa Nova York à noite, luzes de néon piscando, um detetive de casaco preto andando vivamente. Tiro médio do detetive entrando num prédio antigo, chuva embebedando seu casaco, a porta se fechando lentamente atrás dele. Tiro 3 [6-9 s]: close-up do detetive focado, olhos determinados como sirenes distantes uivam e ele franzi um pouco em pensamento. Tiro 4 [9-12 s]: tiro médio do detetive movendo-se cuidadosamente por um corredor escuro, sua lanterna iluminando o caminho à frente. Tiro 5, 12-15, close-up do detetive descobrindo uma pista chave, seu rosto iluminando-se com a realização repentina. </td>

<td style={{verticalAlign: "top", paddingLeft: "12px"}}>
  <video style={{display: "block", width: "100%"}} src="https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260126/desnzy/wan-t2v-demo.mp4" controls />
</td>

</tr> </table>

Antes de chamar a API, [obtenha uma chave de API] (/api-reference/preparation/api-key). Então [defina sua chave API como uma variável de ambiente] (/api-reference/preparation/export-api-key-env). Para usar o SDK, [instale o DashScope SDK] (/api-reference/preparation/install-sdk).

Wan 2.7 usa resolution + ratio Em vez de sizeE descreve multi-tiro diretamente no prompt (não shot_type parâmetro).

Passo 1: Crie uma tarefa para obter a identificação da tarefa

curl --location 'https://maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis' \
  -H 'X-DashScope-Async: enable' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wan2.7-t2v",
  "input": {
    "prompt": "A thrilling detective chase story with cinematic storytelling. Shot 1 [0-3 s]: Wide shot of a rainy New York street at night, neon lights flickering, a detective in a black trench coat walking briskly. Shot 2 [3-6 s]: Medium shot of the detective entering an old building, rain soaking his coat, the door closing slowly behind him. Shot 3 [6-9 s]: Close-up of the detective focused, determined eyes as distant sirens wail and he frowns slightly in thought. Shot 4 [9-12 s]: Medium shot of the detective moving carefully down a dim hallway, his flashlight illuminating the path ahead. Shot 5 [12-15 s]: Close-up of the detective discovering a key clue, his face lighting up with sudden realization."
  },
  "parameters": {
    "resolution": "1080P",
    "ratio": "16:9",
    "prompt_extend": true,
    "duration": 15
  }
}'

Passo 2: Obtenha o resultado usando a identificação da tarefa

Substituir task_id com o task_id O valor retornado pela chamada anterior da API.

curl -X GET https://maas.qwencloudapi.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

wan2.6 examples (Python SDK, Java SDK, curl)

Para usar o SDK, [instale o DashScope SDK] (/api-reference/preparation/install-sdk).

Python SDK

     Certifique-se de que sua versão do DashScope Python SDK seja pelo menos `1.25.8`  Antes de executar o código abaixo.

    Se sua versão é muito baixa, você pode ver erros como "erro de url, por favor, verifique url!"./api-reference/preparation/install-sdk).
  


  ```python
  import os
  from http import HTTPStatus
  from dashscope import VideoSynthesis
  import dashscope

  dashscope.base_http_api_url = 'https://maas.qwencloudapi.com/api/v1'
  api_key = os.getenv("DASHSCOPE_API_KEY", "YOUR_API_KEY")

  print('please wait...')
  rsp = VideoSynthesis.call(api_key=api_key,
                              model='wan2.6-t2v',
                              prompt='A thrilling detective chase story with cinematic storytelling. Shot 1 [0–3 s]: Wide shot of a rainy New York street at night, neon lights flickering, a detective in a black trench coat walking briskly. Shot 2 [3–6 s]: Medium shot of the detective entering an old building, rain soaking his coat, the door closing slowly behind him. Shot 3 [6–9 s]: Close-up of the detective\'s focused, determined eyes as distant sirens wail and he frowns slightly in thought. Shot 4 [9–12 s]: Medium shot of the detective moving carefully down a dim hallway, his flashlight illuminating the path ahead. Shot 5 [12–15 s]: Close-up of the detective discovering a key clue, his face lighting up with sudden realization.',
                              size="1280*720",
                              duration=15,
                              shot_type="multi",
                              prompt_extend=True,
                              watermark=True)
  print(rsp)
  if rsp.status_code == HTTPStatus.OK:
    print("video_url:", rsp.output.video_url)
  else:
    print('Failed, status_code: %s, code: %s, message: %s' % (rsp.status_code, rsp.code, rsp.message))
  ```

Java SDK

     Certifique-se de que sua versão do DashScope Java SDK seja pelo menos `2.22.6`  Antes de executar o código abaixo.

    Se sua versão é muito baixa, você pode ver erros como "erro de url, por favor, verifique url!"./api-reference/preparation/install-sdk).
  


  ```java
  import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
  import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
  import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
  import com.alibaba.dashscope.exception.ApiException;
  import com.alibaba.dashscope.exception.InputRequiredException;
  import com.alibaba.dashscope.exception.NoApiKeyException;
  import com.alibaba.dashscope.utils.JsonUtils;
  import com.alibaba.dashscope.utils.Constants;

  public class Text2Video {

    static {
      Constants.baseHttpApiUrl = "https://maas.qwencloudapi.com/api/v1";
    }

    // If you have not set an environment variable, replace the line below with: apiKey="sk-xxx"
    static String apiKey = System.getenv("DASHSCOPE_API_KEY");

    public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
      VideoSynthesis vs = new VideoSynthesis();
      VideoSynthesisParam param =
          VideoSynthesisParam.builder()
              .apiKey(apiKey)
              .model("wan2.6-t2v")
              .prompt("A thrilling detective chase story with cinematic storytelling. Shot 1 [0–3 s]: Wide shot of a rainy New York street at night, neon lights flickering, a detective in a black trench coat walking briskly. Shot 2 [3–6 s]: Medium shot of the detective entering an old building, rain soaking his coat, the door closing slowly behind him. Shot 3 [6–9 s]: Close-up of the detective's focused, determined eyes as distant sirens wail and he frowns slightly in thought. Shot 4 [9–12 s]: Medium shot of the detective moving carefully down a dim hallway, his flashlight illuminating the path ahead. Shot 5 [12–15 s]: Close-up of the detective discovering a key clue, his face lighting up with sudden realization.")
              .duration(15)
              .size("1280*720")
              .shotType("multi")
              .promptExtend(true)
              .watermark(true)
              .build();
      System.out.println("please wait...");
      VideoSynthesisResult result = vs.call(param);
      System.out.println(JsonUtils.toJson(result));
    }

    public static void main(String[] args) {
      try {
        text2video();
      } catch (ApiException | NoApiKeyException | InputRequiredException e) {
        System.out.println(e.getMessage());
      }
      System.exit(0);
    }
  }
  ```

curl

   Passo 1: Crie uma tarefa para obter a identificação da tarefa

  ```bash
  curl --location 'https://maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.6-t2v",
    "input": {
      "prompt": "A thrilling detective chase story with cinematic storytelling. Shot 1 [0–3 s]: Wide shot of a rainy New York street at night, neon lights flickering, a detective in a black trench coat walking briskly. Shot 2 [3–6 s]: Medium shot of the detective entering an old building, rain soaking his coat, the door closing slowly behind him. Shot 3 [6–9 s]: Close-up of the detective's focused, determined eyes as distant sirens wail and he frowns slightly in thought. Shot 4 [9–12 s]: Medium shot of the detective moving carefully down a dim hallway, his flashlight illuminating the path ahead. Shot 5 [12–15 s]: Close-up of the detective discovering a key clue, his face lighting up with sudden realization."
    },
    "parameters": {
      "size": "1280*720",
      "prompt_extend": true,
      "watermark": true,
      "duration": 15,
      "shot_type":"multi"
    }
  }'
  ```

   Passo 2: Obtenha o resultado usando a identificação da tarefa

   Substituir `task_id` com o `task_id` O valor retornado pela chamada anterior da API.

  ```bash
  curl -X GET https://maas.qwencloudapi.com/api/v1/tasks/{task_id} \
  --header "Authorization: Bearer $DASHSCOPE_API_KEY"
  ```

Sample output

video_url expira após 24 horas. Baixe o vídeo imediatamente.

{
  "request_id": "c1209113-8437-424f-a386-xxxxxx",
  "output": {
    "task_id": "966cebcd-dedc-4962-af88-xxxxxx",
    "task_status": "SUCCEEDED",
    "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
         ...
  },
  ...
}

Capacidades principais.

Crie vídeos multi-shot

Modelos apoiados: wan2.7, wan2.6 series.

Descrição: O modelo muda automaticamente entre as tomadas - por exemplo, de uma cena larga para um close-up - ideal para vídeos musicais e casos de uso semelhantes.

<table style={{width: "100%", borderCollapse: "collapse", tableLayout: "fixed"}}> <tr> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingRight: "12px"}}>? Prompt de entrada ?</th> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingLeft: "12px"}}>** Vídeo de saída (vídeo multi-shot)</th> </tr>

<tr> <td style={{verticalAlign: "top", paddingRight: "12px"}}> Uma visão de harmonia entre a tecnologia futura e a natureza. Tiro 1 [0-2 s]: Tiro largo de um jardim aéreo em uma cidade futurista, plantas flutuantes balançando suavemente na brisa. Um jardineiro robô corta cuidadosamente plantas com movimentos precisos e graciosos. Tiro 3 [4-7 s]: Luz solar flui através de uma cúpula transparente, iluminando todo o jardim e mostrando perfeita fusão de tecnologia e natureza. A câmera puxa para trás para revelar a grande escala de toda a cidade futurista, com o jardim aéreo apenas uma parte dele. </td>

<td style={{verticalAlign: "top", paddingLeft: "12px"}}>
  <video style={{display: "block", width: "100%"}} src="https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20260126/bczhoy/wan-i2v-video-multi.mp4" controls />
</td>

</tr> </table>

Python SDK

   Certifique-se de que sua versão do DashScope Python SDK seja pelo menos `1.25.8`[Instalar o SDK] (/api-reference/preparation/install-sdk).



```python
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

dashscope.base_http_api_url = 'https://maas.qwencloudapi.com/api/v1'

# If you have not set an environment variable, replace the line below with: api_key="sk-xxx"
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
  # Asynchronous call returns a task_id
  rsp = VideoSynthesis.async_call(api_key=api_key,
                  model='wan2.6-t2v',
                  prompt='A vision of harmony between future technology and nature. Shot 1 [0–2 s]: Wide shot of an aerial garden in a futuristic city, floating plants swaying gently in the breeze. Shot 2 [2–4 s]: A robot gardener carefully trims plants with precise, graceful movements. Shot 3 [4–7 s]: Sunlight streams through a transparent dome, illuminating the entire garden and showcasing perfect fusion of technology and nature. Shot 4 [7–10 s]: The camera pulls back to reveal the grand scale of the entire futuristic city, with the aerial garden just one part of it.',
                  size='1280*720',
                  shot_type="multi",  # Multi-shot
                  duration=10,
                  prompt_extend=True,
                  watermark=True,
                  negative_prompt="",
                  seed=12345)
  print(rsp)
  if rsp.status_code == HTTPStatus.OK:
    print("task_id: %s" % rsp.output.task_id)
  else:
    print('Failed, status_code: %s, code: %s, message: %s' % (rsp.status_code, rsp.code, rsp.message))

  # Wait for asynchronous task to complete
  rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
  print(rsp)
  if rsp.status_code == HTTPStatus.OK:
    print(rsp.output.video_url)
  else:
    print('Failed, status_code: %s, code: %s, message: %s' % (rsp.status_code, rsp.code, rsp.message))

if __name__ == '__main__':
  sample_async_call_t2v()
```

Java SDK

   Certifique-se de que sua versão do DashScope Java SDK seja pelo menos `2.22.6`[Instalar o SDK] (/api-reference/preparation/install-sdk).



```java
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

public class Text2Video {
  static {
    Constants.baseHttpApiUrl = "https://maas.qwencloudapi.com/api/v1";
  }

  // If you have not set an environment variable, replace the line below with: apiKey="sk-xxx"
  static String apiKey = System.getenv("DASHSCOPE_API_KEY");

  public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
    VideoSynthesis vs = new VideoSynthesis();
         VideoSynthesisParam param =
        VideoSynthesisParam.builder()
            .apiKey(apiKey)
            .model("wan2.6-t2v")
            .prompt("A vision of harmony between future technology and nature. Shot 1 [0–2 s]: Wide shot of an aerial garden in a futuristic city, floating plants swaying gently in the breeze. Shot 2 [2–4 s]: A robot gardener carefully trims plants with precise, graceful movements. Shot 3 [4–7 s]: Sunlight streams through a transparent dome, illuminating the entire garden and showcasing perfect fusion of technology and nature. Shot 4 [7–10 s]: The camera pulls back to reveal the grand scale of the entire futuristic city, with the aerial garden just one part of it.")
            .negativePrompt("")
            .size("1280*720")
            .shotType("multi")
            .duration(10)
            .promptExtend(true)
            .watermark(true)
            .seed(12345)
            .build();
    // Asynchronous call
    VideoSynthesisResult task = vs.asyncCall(param);
    System.out.println(JsonUtils.toJson(task));
    System.out.println("please wait...");

    // Get result
    VideoSynthesisResult result = vs.wait(task, apiKey);
    System.out.println(JsonUtils.toJson(result));
  }

  public static void main(String[] args) {
    try {
      text2video();
    } catch (ApiException | NoApiKeyException | InputRequiredException e) {
      System.out.println(e.getMessage());
    }
    System.exit(0);
  }
}
```

curl

 Passo 1: Crie uma tarefa para obter a identificação da tarefa

```bash
curl --location 'https://maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis' \
  -H 'X-DashScope-Async: enable' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wan2.6-t2v",
  "input": {
    "prompt": "A vision of harmony between future technology and nature. Shot 1 [0-2 s]: Wide shot of an aerial garden in a futuristic city, floating plants swaying gently in the breeze. Shot 2 [2-4 s]: A robot gardener carefully trims plants with precise, graceful movements. Shot 3 [4-7 s]: Sunlight streams through a transparent dome, illuminating the entire garden and showcasing perfect fusion of technology and nature. Shot 4 [7-10 s]: The camera pulls back to reveal the grand scale of the entire futuristic city, with the aerial garden just one part of it."
  },
  "parameters": {
    "size": "1280*720",
    "prompt_extend": true,
    "duration": 10,
    "shot_type":"multi"
  }
}'
```

 Passo 2: Obtenha o resultado usando a identificação da tarefa

 Substituir `task_id` com o `task_id` O valor retornado pela chamada anterior da API.

```bash
curl -X GET https://maas.qwencloudapi.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
```

Sincronize áudio e vídeo

Modelos apoiados: wan2.7, wan2.6 series, wan2.5 series.

Faça personagens no vídeo falarem ou cantarem, com movimentos de boca iguais ao áudio. Para mais exemplos, veja [Geração de áudio vídeo] (/developer-guides/accuracy-tuning/video-generation).

<table style={{width: "100%", borderCollapse: "collapse", tableLayout: "fixed"}}> <tr> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingRight: "12px"}}>** Exemplo de entrada </th> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingLeft: "12px"}}> Vídeo de saída (vídeo habilitado para áudio)</th> </tr>

<tr> <td style={{verticalAlign: "top", paddingRight: "12px"}}> Prompt de entrada Tiro de um ângulo baixo, em um close-up médio, com tons quentes, iluminação mista (a luz prática da lâmpada de mesa combina com a luz nublada da janela), iluminação lateral, e uma composição central. Em um escritório de detetive clássico, estantes de madeira são cheias de arquivos antigos e cinzeiros. Uma lâmpada verde ilumina um arquivo de caso espalhado no centro da mesa. Uma raposa, usando uma capa marrom escura e um chapéu cinza claro, senta-se em uma cadeira de couro, seu couro carmesim, sua cauda descansando levemente na borda, seus dedos lentamente virando páginas amareladas. Lá fora, um garoa constante cai sob um céu azul, esguichando o vidro com estrias melancólicas. Ele levanta lentamente a cabeça, seus ouvidos se contorcendo ligeiramente, seus olhos âmbar olhando diretamente para a câmera, sua boca claramente se movendo enquanto fala em uma voz suave e cínica: O caso era frio, mais frio que um peixe no inverno. Mas cada galinha tem seus segredos, e eu, por exemplo, pretendia encontrá-los.. ** Áudio de entrada**: <audio style={{width: "100%"}} src="https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20250929/ajcbjm/%E7%8B%90%E7%8B%B8.mp3" controls /> </td>

<td style={{verticalAlign: "top", paddingLeft: "12px"}}>
  <video style={{display: "block", width: "100%"}} src="https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20251218/yqyrak/wan2.6-intl+%281%29.mp4" controls />
</td>

</tr> </table>

Python SDK

   Certifique-se de que sua versão do DashScope Python SDK seja pelo menos `1.25.8`[Instalar o SDK] (/api-reference/preparation/install-sdk).



```python
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

dashscope.base_http_api_url = 'https://maas.qwencloudapi.com/api/v1'

# If you have not set an environment variable, replace the line below with: api_key="sk-xxx"
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
  # Asynchronous call returns a task_id
  rsp = VideoSynthesis.async_call(api_key=api_key,
                  model='wan2.6-t2v',
                  prompt="Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
                  audio_url='https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
                  size='1280*720',
                  duration=10,
                  shot_type="multi",  # Multi-shot
                  prompt_extend=True,
                  watermark=True,
                  negative_prompt="",
                  seed=12345)
  print(rsp)
  if rsp.status_code == HTTPStatus.OK:
    print("task_id: %s" % rsp.output.task_id)
  else:
    print('Failed, status_code: %s, code: %s, message: %s' % (rsp.status_code, rsp.code, rsp.message))

  # Wait for asynchronous task to complete
  rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
  print(rsp)
  if rsp.status_code == HTTPStatus.OK:
    print(rsp.output.video_url)
  else:
    print('Failed, status_code: %s, code: %s, message: %s' % (rsp.status_code, rsp.code, rsp.message))

if __name__ == '__main__':
  sample_async_call_t2v()
```

Java SDK

   Certifique-se de que sua versão do DashScope Java SDK seja pelo menos `2.22.6`[Instalar o SDK] (/api-reference/preparation/install-sdk).



```java
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

public class Text2Video {
  static {
    Constants.baseHttpApiUrl = "https://maas.qwencloudapi.com/api/v1";
  }

  // If you have not set an environment variable, replace the line below with: apiKey="sk-xxx"
  static String apiKey = System.getenv("DASHSCOPE_API_KEY");

  public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
    VideoSynthesis vs = new VideoSynthesis();
         VideoSynthesisParam param =
        VideoSynthesisParam.builder()
            .apiKey(apiKey)
            .model("wan2.6-t2v")
            .prompt("Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.")
            .audioUrl("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3")
            .negativePrompt("")
            .size("1280*720")
            .shotType("multi")
            .duration(10)
            .promptExtend(true)
            .watermark(true)
            .seed(12345)
            .build();
    // Asynchronous call
    VideoSynthesisResult task = vs.asyncCall(param);
    System.out.println(JsonUtils.toJson(task));
    System.out.println("please wait...");

    // Get result
    VideoSynthesisResult result = vs.wait(task, apiKey);
    System.out.println(JsonUtils.toJson(result));
  }

  public static void main(String[] args) {
    try {
      text2video();
    } catch (ApiException | NoApiKeyException | InputRequiredException e) {
      System.out.println(e.getMessage());
    }
    System.exit(0);
  }
}
```

curl

 Passo 1: Crie uma tarefa para obter a identificação da tarefa

```bash
curl --location 'https://maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis' \
  -H 'X-DashScope-Async: enable' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wan2.6-t2v",
  "input": {
    "prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them \". ",
    "audio_url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3"
  },
  "parameters": {
    "size": "1280*720",
    "prompt_extend": true,
    "duration": 10,
    "shot_type":"multi"
  }
}'
```

 Passo 2: Obtenha o resultado usando a identificação da tarefa

 Substituir `task_id` com o `task_id` O valor retornado pela chamada anterior da API.

```bash
curl -X GET https://maas.qwencloudapi.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
```

Gere vídeos silenciosos.

Modelos apoiados: wan2.2 series, wan2.1 series.

Descrição: Ideal para casos de uso visual, como cartazes animados ou vídeos curtos silenciosos.

O vídeo silencioso é a saída padrão para o filme. wan2.2 e versões anteriores. Nenhuma configuração extra é necessária.

<table style={{width: "100%", borderCollapse: "collapse", tableLayout: "fixed"}}> <tr> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingRight: "12px"}}>? Prompt de entrada ?</th> <th style={{textAlign: "left", width: "50%", paddingBottom: "8px", paddingLeft: "12px"}}>** Vídeo de saída (vídeo silencioso)</th> </tr>

<tr> <td style={{verticalAlign: "top", paddingRight: "12px"}}> Baixo contraste. Um músico de rua se apresenta em uma estação de metrô retro estilo anos 70, banhado em cores escuras e texturas ásperas. Ele usa uma jaqueta vintage e toca guitarra com foco intenso. Os passageiros passam. Uma pequena multidão gradualmente se reúne para ouvir. A câmera se aproxima lentamente da direita, captando a interação de sons de instrumentos e ruído da cidade, com placas de metrô vintage e paredes descascadas no fundo. </td>

<td style={{verticalAlign: "top", paddingLeft: "12px"}}>
  <video style={{display: "block", width: "100%"}} src="https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/en-US/20250806/sxjvix/text2video.mp4" controls />
</td>

</tr> </table>

Python SDK

   Certifique-se que o DashScope SDK para a versão Python é pelo menos `1.25.8`. Para instruções sobre como atualizar, veja [Instalar o SDK] (/api-reference/preparation/install-sdk).



```python
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope

dashscope.base_http_api_url = 'https://maas.qwencloudapi.com/api/v1'

# If you have not set an environment variable, replace the line below with: api_key="sk-xxx"
api_key = os.getenv("DASHSCOPE_API_KEY")

def sample_async_call_t2v():
  # Asynchronous call returns a task_id
  rsp = VideoSynthesis.async_call(api_key=api_key,
                  model='wan2.2-t2v-plus',
                  prompt='Low contrast. A street musician performs in a retro 1970s-style subway station, bathed in dim colors and rough textures. He wears a vintage jacket and plays guitar with intense focus. Commuters rush past. A small crowd gradually gathers to listen. The camera pans slowly right, capturing the interplay of instrument sounds and city noise, with vintage subway signs and peeling walls in the background.',
                  prompt_extend=True,
                  size='832*480',
                  negative_prompt="",
                  watermark=True,
                  seed=12345)
  print(rsp)
  if rsp.status_code == HTTPStatus.OK:
    print("task_id: %s" % rsp.output.task_id)
  else:
    print('Failed, status_code: %s, code: %s, message: %s' % (rsp.status_code, rsp.code, rsp.message))

  # Wait for asynchronous task to complete
  rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
  print(rsp)
  if rsp.status_code == HTTPStatus.OK:
    print(rsp.output.video_url)
  else:
    print('Failed, status_code: %s, code: %s, message: %s' % (rsp.status_code, rsp.code, rsp.message))

if __name__ == '__main__':
  sample_async_call_t2v()
```

Java SDK

   Certifique-se que a versão Java SDK DashScope seja pelo menos `2.22.6`. Para atualizar o SDK, veja [Instalar o SDK] (/api-reference/preparation/install-sdk).



```java
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;

public class Text2Video {
  static {
    Constants.baseHttpApiUrl = "https://maas.qwencloudapi.com/api/v1";
  }

  // If you have not set an environment variable, replace the line below with: apiKey="sk-xxx"
  static String apiKey = System.getenv("DASHSCOPE_API_KEY");

  public static void text2video() throws ApiException, NoApiKeyException, InputRequiredException {
    VideoSynthesis vs = new VideoSynthesis();
    VideoSynthesisParam param =
        VideoSynthesisParam.builder()
            .apiKey(apiKey)
            .model("wan2.2-t2v-plus")
            .prompt("Low contrast. A street musician performs in a retro 1970s-style subway station, bathed in dim colors and rough textures. He wears a vintage jacket and plays guitar with intense focus. Commuters rush past. A small crowd gradually gathers to listen. The camera pans slowly right, capturing the interplay of instrument sounds and city noise, with vintage subway signs and peeling walls in the background.")
            .size("832*480")
            .promptExtend(true)
            .watermark(true)
            .seed(12345)
            .build();
    // Asynchronous call
    VideoSynthesisResult task = vs.asyncCall(param);
    System.out.println(JsonUtils.toJson(task));
    System.out.println("please wait...");

    // Get result
    VideoSynthesisResult result = vs.wait(task, apiKey);
    System.out.println(JsonUtils.toJson(result));
  }

  public static void main(String[] args) {
    try {
      text2video();
    } catch (ApiException | NoApiKeyException | InputRequiredException e) {
      System.out.println(e.getMessage());
    }
    System.exit(0);
  }
}
```

curl

 Passo 1: Crie uma tarefa para obter a identificação da tarefa

```bash
curl --location 'https://maas.qwencloudapi.com/api/v1/services/aigc/video-generation/video-synthesis' \
  -H 'X-DashScope-Async: enable' \
  -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "wan2.2-t2v-plus",
  "input": {
    "prompt": "Low contrast. A street musician performs in a retro 1970s-style subway station, bathed in dim colors and rough textures. He wears a vintage jacket and plays guitar with intense focus. Commuters rush past. A small crowd gradually gathers to listen. The camera pans slowly right, capturing the interplay of instrument sounds and city noise, with vintage subway signs and peeling walls in the background."
  },
  "parameters": {
    "size": "832*480",
    "prompt_extend": true,
    "watermark": true
  }
}'
```

 Passo 2: Obtenha o resultado usando a identificação da tarefa

 Substituir `task_id` com o `task_id` O valor retornado pela chamada anterior da API.

```bash
curl -X GET https://maas.qwencloudapi.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"
```

Áudio de entrada

Vídeo de saída

Referência da API

FAQ

Como eu definimos a proporção de aspecto do vídeo (por exemplo, 16:9)?

**wan3.0 e wan2.7Use o ratio parâmetro diretamente (por exemplo, "16:9", "9:16", "1:1", "4:3", "3:4"), combinado com resolution ("480P", "720P", ou "1080P").

**wan2.6 Use o size parâmetro para especificar a resolução de vídeo em pixels. O sistema calcula a proporção de aspecto automaticamente. Por exemplo, size=1280*720 sai um vídeo 16:9.

Erro SDK: "erro de url, por favor verifique url!"

Certifique-se:

Se sua versão é muito baixa, você pode ver o "erro de url, por favor verifique url!" erro./api-reference/preparation/install-sdk).

Por que a ligação falha com "Modelo não existe"?

Verifique estes itens:

Para uma lista de modelos suportados, veja [Modelos de geração de vídeo] (/developer-guides/getting-started/video-models).