All Products
Search
Document Center

Container Compute Service:Accelerate Wan2.1 video generation with DeepGPU

Last Updated:Jun 21, 2026

Compute resources from Container Compute Service (ACS) let you get started immediately, without needing to understand underlying hardware or manage GPU nodes. ACS is easy to deploy, supports pay-as-you-go, and is ideal for cost-effective large language model (LLM) inference. This topic shows you how to use ACS GPU compute resources with the deepgpu-comfyui plugin to accelerate Wan2.1 video generation.

Background information

ComfyUI

ComfyUI is a node-based graphical user interface (GUI) for running and customizing Stable Diffusion, a popular text-to-image model. It uses a visual workflow that lets you build complex image generation pipelines by dragging and dropping nodes without writing code.

Wan model

Wan (Tongyi Wanxiang) is a large AI art and text-to-image (AIGC) model developed by Alibaba's Tongyi Lab. It is the visual generation branch of the Qianwen large model series. Wan is the world's first AI art model to support Chinese prompts. It has multimodal capabilities and can generate high-quality artwork from text descriptions, hand-drawn sketches, or image style transfers.

Prerequisites

  • If this is your first time using Container Compute Service (ACS), you must grant the default system role to the service account. This role is required for ACS to call related services, such as ECS, OSS, NAS, CPFS, and SLB, create clusters, and save logs. For more information, see Use Container Compute Service for the first time.

  • Supported GPU types: L20 (GN8IS) and G49E.

Procedure

Step 1: Prepare the model data

Create a NAS or OSS volume to store model files persistently. The following steps use a NAS volume as an example.

For more information about how to create a persistent volume, see Create a NAS file system as a volume or Use a statically provisioned OSS volume.
  1. Run the following command to download ComfyUI.

    Make sure that Git is installed in your environment.
    git clone https://github.com/comfyanonymous/ComfyUI.git
  2. Run the commands below to download the three required model files into their corresponding directories in ComfyUI. For more information about the models, see the Wan_2.1_ComfyUI_repackaged project.

    To ensure a smooth download, you may need to increase your peak public bandwidth. The download takes approximately 30 minutes.
    1. The wan2.1_t2v_14B_fp16.safetensors file

      cd ComfyUI/models/diffusion_models
      wget https://modelscope.cn/models/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/master/split_files/diffusion_models/wan2.1_t2v_14B_fp16.safetensors 
    2. The wan_2.1_vae.safetensors file

      cd ComfyUI/models/vae
      wget https://modelscope.cn/models/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/master/split_files/vae/wan_2.1_vae.safetensors
    3. The umt5_xxl_fp8_e4m3fn_scaled.safetensors file

      cd ComfyUI/models/text_encoders
      wget https://modelscope.cn/models/Comfy-Org/Wan_2.1_ComfyUI_repackaged/resolve/master/split_files/text_encoders/umt5_xxl_fp8_e4m3fn_scaled.safetensors
  3. Download and decompress ComfyUI-deepgpu.

    cd ComfyUI/custom_nodes
    wget https://aiacc-inference-public-v2.oss-cn-hangzhou.aliyuncs.com/deepgpu/comfyui/nodes/20250513/ComfyUI-deepgpu.tar.gz
    tar zxf ComfyUI-deepgpu.tar.gz

Step 2: Deploy the ComfyUI service

  1. Log on to the ACS console. In the left-side navigation pane, click Clusters. Click the name of the target cluster. In the left-side navigation pane, choose Workloads > Deployments, and then click Create from YAML in the upper-right corner.

  2. This example uses a mounted NAS volume. Copy the following YAML template and click Create.

    Modify the persistentVolumeClaim.claimName value to match the name of your persistent volume claim (PVC).
    This example uses the inference-nv-pytorch 25.07 image from the China (Beijing) (cn-beijing) region to minimize image pull times. If you want to use a private image from another region, adjust the image path in the YAML file based on Usage.
    The test container image used in this example has the deepgpu-torch and deepgpu-comfyui plugins pre-installed. If you need to use these plugins in other container environments, contact a Pre-sales Solutions Architect (PDSA) to obtain the installation packages.
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      labels:
        app: wanx-deployment
      name: wanx-deployment-test
      namespace: default
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: wanx-deployment
      template:
        metadata:
          labels:
            alibabacloud.com/compute-class: gpu
            alibabacloud.com/compute-qos: default
            alibabacloud.com/gpu-model-series: L20 # Supported GPU types: L20 (GN8IS) and G49E
            app: wanx-deployment
        spec:
          containers:
          - command:
            - sh
            - -c
            - DEEPGPU_PUB_LS=true python3 /mnt/ComfyUI/main.py --listen 0.0.0.0 --port 7860
            image: acs-registry-vpc.cn-beijing.cr.aliyuncs.com/egslingjun/inference-nv-pytorch:25.07-vllm0.9.2-pytorch2.7-cu128-20250714-serverless
            imagePullPolicy: Always
            name: main
            resources:
              limits:
                nvidia.com/gpu: "1"
                cpu: "16"
                memory: 64Gi
              requests:
                nvidia.com/gpu: "1"
                cpu: "16"
                memory: 64Gi
            terminationMessagePath: /dev/termination-log
            terminationMessagePolicy: File
            volumeMounts:
            - mountPath: /dev/shm
              name: cache-volume
            - mountPath: /mnt # /mnt is the path in the pod where the NAS volume claim is mapped
              name: data
          dnsPolicy: ClusterFirst
          restartPolicy: Always
          schedulerName: default-scheduler
          securityContext: {}
          terminationGracePeriodSeconds: 30
          volumes:
          - emptyDir:
              medium: Memory
              sizeLimit: 500G
            name: cache-volume
          - name: data
            persistentVolumeClaim:
              claimName: wanx-nas # wanx-nas is the volume claim created from the NAS volume
    ---
    apiVersion: v1
    kind: Service
    metadata:
      name: wanx-test
    spec:
      type: LoadBalancer
      ports:
        - port: 7860
          protocol: TCP
          targetPort: 7860
      selector:
        app: wanx-deployment
  3. In the dialog box that appears, click View to go to the workload details page. Click the Logs tab. If the following output is displayed, the service has started successfully.

    Device: cuda:0 NVIDIA L20 : cudaMallocAsync
    Using pytorch attention
    Python version: 3.12.7+gc (main, Jan 10 2025, 17:28:43) [GCC 13.3.0]
    ComfyUI version: 0.3.45
    ****** User settings have been changed to be stored on the server instead of browser storage. ******
    ****** For multi-user setups add the --multi-user CLI argument to enable multiple user profiles. ******
    ComfyUI frontend version: 1.23.4
    [Prompt Server] web root: /opt/ac2/lib/python3.12/site-packages/comfyui_frontend_package/static
    generated new fontManager
    Import times for custom nodes:
       0.0 seconds: /mnt/ComfyUI/custom_nodes/websocket_image_save.py
      57.2 seconds: /mnt/ComfyUI/custom_nodes/ComfyUI-deepgpu
    Context impl SQLiteImpl.
    Will assume non-transactional DDL.
    No target revision found.
    Starting server
    To see the GUI go to: http://0.0.0.0:7860

Step 3: Use the plugin

  1. Click the Access Method tab to get the External Endpoint of the service, such as 8.xxx.xxx.114:7860.

  2. Access the ComfyUI URL http://8.xxx.xxx.114:7860/ in your browser. In the ComfyUI interface, right-click, then click Add Node, and you can see that the plugin contains DeepGPU-type nodes.

    The first time you access the URL, loading may take up to 5 minutes.

    The DeepGPU category contains five nodes: Apply DeepyTorch to diffusion model, Apply DeepyTorch to vae model, DeepyTorch Sampler to replace XlabsSampler, Save Image BASE64 of DeepGPU, and Apply Pulid Flux of DeepGPU.

    ApplyDeepyTorch node

    The ApplyDeepyTorch node optimizes model inference performance. In most cases, insert it after the last model-processing node in the workflow, such as after Load Diffusion Model, Load Checkpoint, or LoraLoaderModelOnly. The ApplyDeepyTorch node types are as follows:

    from deepgpu_comfyui.node import \
        ApplyDeepyTorch, \
        ApplyDeepyTorchVae, \
        DeepyTorchSampler, \
        DeepSaveImageBase64, \
        ApplyPulidFluxDeepyTorch
    NODE_CLASS_MAPPINGS = {
        "ApplyDeepyTorch": ApplyDeepyTorch,
        "ApplyDeepyTorchVae": ApplyDeepyTorchVae,
        "DeepyTorchSampler": DeepyTorchSampler,
        "DeepSaveImageBase64": DeepSaveImageBase64,
        "ApplyPulidFluxDeepyTorch": ApplyPulidFluxDeepyTorch,
    }
    NODE_DISPLAY_NAME_MAPPINGS = {
        "ApplyDeepyTorch": "Apply DeepyTorch to diffusion model",
        "ApplyDeepyTorchVae": "Apply DeepyTorch to vae model",
        "DeepyTorchSampler": "DeepyTorch Sampler to replace XlabsSampler",
        "DeepSaveImageBase64": "Save Image BASE64 of DeepGPU",
        "ApplyPulidFluxDeepyTorch": "Apply Pulid Flux of DeepGPU",
    }

Step 4: Test the sample workflow

  1. Download the wan2.1 DeepyTorch-accelerated workflow file.

    1. Image-to-video workflow

      https://aiacc-inference-public-v2.oss-cn-hangzhou.aliyuncs.com/deepgpu/comfyui/wan/workflows/workflow_image_to_video_wan_1.3b_deepytorch.json
    2. Text-to-video workflow

      https://aiacc-inference-public-v2.oss-cn-hangzhou.aliyuncs.com/deepgpu/comfyui/wan/workflows/workflow_text_to_video_wan_deepytorch.json
  2. This example uses the accelerated text-to-video workflow. In ComfyUI, choose Workflow > Open, and select the downloaded workflow_text_to_video_wan_deepytorch.json file.

  3. After you open the workflow file, set Apply DeepyTorch to diffusion model > enable to true. This enables acceleration. Then, click Run and wait for the video to be generated.

    The DeepyTorch-accelerated workflow inserts an ApplyDeepyTorch node after the Load Diffusion Model node.

    This sample workflow includes the following key node configurations: the UNet Loader uses the wan2.1_t2v_14B_fp16.safetensors model with the data type set to default; the Load CLIP node uses umt5_xxl_fp8_e4m3fn_scaled.safetensors with the type set to wan; the K-Sampler has steps set to 20, cfg to 6.0, sampler to uni_pc, scheduler to simple, and denoising to 1.00; the Load VAE node uses wan_2.1_vae.safetensors; the Empty Latent Video (Hunyuan) node has width set to 832, height to 480, length to 81, and batch size to 1. The dynamic setting of the Apply DeepyTorch to diffusion model node is set to auto.

  4. Click the Queue button to view the video generation time and preview the video.

    The first test run may take longer. Run the workflow two or three more times for optimal performance.

    The queue panel displays thumbnails of three generated video clips, with each taking about 630 seconds to generate. Links connect the nodes to pass data through the workflow. The main canvas shows the complete text-to-video workflow nodes: UNet Loader (model: wan2.1_t2v_14B_fp16.safetensors, data type: default), CLIP Text Encode nodes for positive and negative prompts, K-Sampler (steps: 20, cfg: 6.0, sampler: uni_pc, scheduler: simple, denoising: 1.00), Load VAE (wan_2.1_vae.safetensors), Empty Latent Video (Hunyuan) (width: 832, height: 480, length: 81, batch size: 1), and Apply DeepyTorch to diffusion model (enable: true, dynamic: auto).

  5. (Optional) To test the non-accelerated scenario, restart the ComfyUI service and use the following workflow to generate the video.

    https://aiacc-inference-public-v2.oss-cn-hangzhou.aliyuncs.com/deepgpu/comfyui/wan/workflows/workflow_text_to_video_wan.json