Wan is an open-source AI model for text-to-video (T2V) and image-to-video (I2V) generation. PAI provides built-in ComfyUI workflows and API calls to deploy and generate videos with Wan on EAS.
Deploy standard ComfyUI (single-user)
Deployment configuration
Deploy a standard ComfyUI image service with custom deployment:
-
Log on to the PAI console. Select a region on the top of the page. Then, select the desired workspace and click Elastic Algorithm Service (EAS).
-
Click Deploy Service. In the Custom Model Deployment section, click Custom Deployment.
-
On the Custom Deployment page, configure the following parameters.
-
In the Environment Information section, configure the following parameters.
Parameter
Description
Image Configuration
From the Alibaba Cloud Images list, select comfyui > comfyui:1.9.
Note1.9 is used in this example. Select the latest version during deployment.
Storage Mount
Mount external storage such as OSS or NAS to the EAS service. Generated videos are automatically saved to the mounted storage. For example, click OSS and configure:
-
Uri: Select an OSS bucket directory. To create a bucket and directory, see Console quick start. The bucket must be in the same region as the EAS service.
-
Mount Path: The mount path in the service instance, such as
/code/data-oss.
Command
Auto-populated after you select an image.
Set the
--data-dirparameter to your configured mount path.In version 1.9,
--data-diris pre-configured. Update its value to your mount path, for example,python main.py --listen --port 8000 --data-dir /code/data-oss. -
-
In the Resource Information section, select a resource specification.
Parameter
Description
Resource Type
Select Public Resources.
Deployment
Select a Resource Specification with at least 48 GB of GPU memory per card. GU60 is recommended, such as
ml.gu8is.c16m128.1-gu60. -
In the Network Information section, configure a VPC with internet access. Allow an EAS service to access the internet or an internal network.
NoteEAS services cannot access the internet by default. The I2V feature requires internet access to download images, so a VPC with internet access is required.
-
-
After you configure the parameters, click Deploy.
Web UI
After deployment, build a workflow in the WebUI:
-
Click the target service name to open the Overview page. In the upper-right corner, click Web applications.
-
In the upper-left corner of the web UI page, select Workflow > Open, select a JSON workflow file, and then click Open.
Example ComfyUI JSON workflows:
-
Image to Video (direct image upload): wanvideo_720P_I2V.json
After loading, click upload in the load image section to upload an image.

-
Image to Video (load image by URL): wanvideo_720P_I2V_URL.json
After loading, set the image URL in the load image by URL section.

-
-
Click run at the bottom of the page to generate the video.
Processing takes about 20 minutes. Results appear in the video combine section.

Synchronous API
The standard service supports synchronous calls only, sending requests directly to an inference instance without the EAS queue service:
-
Export the workflow JSON file.
The API request body depends on the workflow configuration. First, configure the workflow in the WebUI, then select Workflow > Export (API) to save it as a JSON file.

-
View the invocation method.
-
In the service list, click the service name. In the Basic Information section, click View Endpoint Information.
-
In the Invocation Information dialog box, get the endpoint and token.
Note-
To use the Internet Endpoint, your client must have public internet access.
-
To use the VPC Endpoint, your client must be in the same VPC as the service.

-
-
-
Call the service.
The following code example shows a complete call. Extract the output file path with
data[prompt_id]["outputs"]["fullpath"].Set the endpoint and token as environment variables:
# Replace with your service endpoint and token. export SERVICE_URL="http://test****.115770327099****.cn-beijing.pai-eas.aliyuncs.com/" export TOKEN="MzJlMDNjMmU3YzQ0ZDJ*****************TMxZA=="
ComfyUI API for high-concurrency scenarios
Configuration
To switch from standard to API mode, delete the existing service and create a new one.
Deploy a ComfyUI API image service with custom deployment:
-
Log on to the PAI console. Select a region on the top of the page. Then, select the desired workspace and click Elastic Algorithm Service (EAS).
-
Click Deploy Service. In the Custom Model Deployment section, click Custom Deployment.
-
On the Custom Deployment page, configure the following parameters.
-
In the Environment Information section, configure the following parameters.
Parameter
Description
Image Configuration
From the Alibaba Cloud image list, select comfyui > comfyui:1.9-api.
Note1.9 is used in this example. Select the latest version during deployment.
Storage Mount
Mount external storage such as OSS or NAS for the EAS service. Generated videos are automatically saved to this storage. For example, click OSS and configure:
-
Uri: Select an OSS bucket directory. To create a bucket and directory, see Console quick start. The bucket must be in the same region as the EAS service.
-
Mount Path: The mount path in the service instance, such as
/code/data-oss.
Command to Run
Auto-populated after you select an image.
Set the
--data-dirparameter to your configured mount path.In version 1.9,
--data-diris pre-configured. Update its value to your mount path, for example,python main.py --listen --port 8000 --api --data-dir /code/data-oss. -
-
In the Resource Information section, select a resource specification.
Parameter
Description
Resource Type
Select Public Resources.
Deployment
Select a Resource Specification with at least 48 GB of GPU memory per card. GU60 is recommended, such as
ml.gu8is.c16m128.1-gu60. -
In the Asynchronous Queue section, configure the Maximum Data for A Single Input Request and Maximum Data for A Single Output parameters. A common setting for these parameters is 1024 KB.
NoteSet appropriate queue sizes to prevent rejected requests, dropped samples, failed responses, or queue blocking.
-
In the Network Information section, select a VPC with public internet access. Allow an EAS service to access public or private network resources.
NoteEAS services cannot access the public internet by default. The I2V feature requires internet access to download images, so a VPC with public internet access is required.
-
-
After configuring the parameters, click Deploy.
Asynchronous API call
The API supports asynchronous calls only through the /api_prompt endpoint via the EAS queue service. Send a request to an input queue and subscribe to an output queue for results:
-
In the Invocation Information dialog box, get the endpoint and token.
Note-
To use the internet endpoint, your client must have public internet access.
-
To use the VPC endpoint, your client must be in the same VPC as the service.
-
-
Run the following command in your terminal to install the eas_prediction SDK.
pip install eas_prediction --user -
Call the service.
The following code example shows a complete call. Extract the output file path with
json.loads(x.data.decode('utf-8'))[1]["data"]["output"]["gifs"][0]["fullpath"].Set the endpoint and token as environment variables:
# Replace the values with your service endpoint and token. export SERVICE_URL="http://test****.115770327099****.cn-beijing.pai-eas.aliyuncs.com/" export TOKEN="MzJlMDNjMmU3YzQ0ZDJ*****************TMxZA=="
Examples
T2V and I2V share the same deployment and invocation workflow. T2V does not require internet access, so VPC configuration is not needed.
Load the example workflow file (wanvideo_720P_T2V.json) in the WebUI as described in Using the WebUI. Enter a text prompt in the WanVideo TextEncode input box and click Run.
To make an API call, see the code example below.
Set the endpoint and token as environment variables:
# Replace with your endpoint and token.
export SERVICE_URL="http://test****.115770327099****.cn-beijing.pai-eas.aliyuncs.com/"
export TOKEN="MzJlMDNjMmU3YzQ0ZDJ*****************TMxZA=="
Synchronous API call
Asynchronous API call
References
For custom models, ComfyUI plug-ins, and troubleshooting, see AI video generation - ComfyUI deployment.