All Products
Search
Document Center

Container Service for Kubernetes:Deploy a ComfyUI application on an ACK cluster

Last Updated:Sep 17, 2025

This topic shows how to deploy a ComfyUI application on an Alibaba Cloud Container Service for Kubernetes (ACK) managed Pro cluster that has GPU-accelerated nodes. Deploying on ACK overcomes the performance bottlenecks and complex environment setup associated with running it locally.

Prerequisites

  • You have an ACK managed Pro cluster running Kubernetes version 1.22 or later. The cluster must also include GPU-accelerated nodes, each with at least 16 GB of GPU memory.

  • The NVIDIA driver version is 535 or later. This topic uses an example where the ack.aliyun.com/nvidia-driver-version label is added to the GPU node pool with the value 550.144.03.

Step 1: Prepare the model data

In this example, we will use the sdxl-turbo model. It creates images from your text prompts in just one step. The following steps show how to download the model, upload it to Object Storage Service (OSS), and create a Persistent Volume (PV) and Persistent Volume Claim (PVC) in the ACK cluster for persistent storage.

  1. Download the model file.

    1. Install Git and the Git Large File Storage (LFS) extension.

      macOS

      1. Install Git.

        The officially maintained macOS Git installer is available from the official Git website.
        brew install git
      2. Install the Git LFS extension to pull large files.

        brew install git-lfs

      Windows

      1. Install Git.

        Download and install a suitable version from the official Git website.

      2. Install the Git LFS extension to pull large files. Git LFS is integrated into Git for Windows. Download and use the latest version.

      Linux

      1. Install Git.

        The following command is for Red Hat-based Linux distributions. For other systems, see the official Git website.

        yum install git
      2. Install the Git LFS extension to pull large files.

        yum install git-lfs
    2. Download the sdxl-turbo model.

      GIT_LFS_SKIP_SMUDGE=1 git clone https://www.modelscope.cn/AI-ModelScope/sdxl-turbo.git
      cd sdxl-turbo
      git lfs pull
  2. Upload the downloaded sdxl-turbo folder to OSS.

    1. Install ossutil.

      ossutil is a command-line tool for managing OSS resources.

    2. Create an OSS bucket.

      If you do not have a bucket, create one by running the following command. Replace <Your-Bucket-Name> with a globally unique name for your bucket.

      ossutil mb oss://<Your-Bucket-Name>
    3. Create a directory within the bucket.
      Create a directory named sdxl-turbo inside your bucket to store the model files.

      ossutil mkdir oss://<Your-Bucket-Name>/sdxl-turbo
    4. Upload the model files.
      Run the following command from the directory where you downloaded the model to recursively copy all files into the OSS directory you just created.

      ossutil cp -r ./sdxl-turbo oss://<Your-Bucket-Name>/sdxl-turbo
  3. Create a PV for the model data.

    1. Log on to the ACK console and go to the cluster details page.

    2. In the left navigation pane, choose Volumes > Persistent Volumes.

    3. On the Persistent Volumes page, click Create, and configure the following parameters:

      • PV Type: Select OSS

      • Volume Name: Enter sdxl-turbo-model

      • Capacity: Enter 20Gi

      • Access Mode: Select ReadWriteMany

      • Access Certificate: Select Create Secret

      • Optional Parameters: Enter -o umask=022 -o max_stat_cache_size=0 -o allow_other

      • Bucket ID: Select the bucket where you uploaded the model.

      • OSS Path: Enter /sdxl-turbo

      • Endpoint: Select Internet Endpoint

    4. Click Create.

  4. Create a PVC to bind to the PV.

    1. In the left navigation pane of the ACK console, choose Volumes > Persistent Volume Claims.

    2. On the Persistent Volume Claims page, click Create, and configure the following parameters:

      • PVC Type: Select OSS

      • Name: Enter sdxl-turbo-model

      • Allocation Mode: Select Existing Volumes

      • Existing Volumes: Select the sdxl-turbo-model PV you just created.

      • Capacity: 20 Gi

    3. Click Create. The sdxl-turbo-model PVC will appear in the list with a bound status.

Step 2: Configure the ComfyUI application

  1. Log on to the ACK console. In the left navigation pane, click Clusters.

  2. On the Clusters page, click the name of the target cluster. In the left navigation pane, choose Application > Helm.

  3. On the Helm page, click Deploy. Find the comfyui component, configure the parameters as needed, and click Next.image

  4. In the Parameters step, scroll to the persistence section and modify it to use the PVC you created for the model files. Leave all other settings as default.

    persistence:
      - mountPath: "/app/ComfyUI/models/checkpoints"       # Mount path for the model
        annotations:
          helm.sh/resource-policy: keep
        persistentVolumeClaim:      
          existingClaim: "sdxl-turbo-model"    # Use the PVC created earlier
          accessModes: ReadWriteMany
          storageClass: oss                    # Specify the storage type as OSS
          size: 20Gi
          subPath: ""
    • Change the model source: mountPath: "/app/ComfyUI/models/checkpoints".

    • Change the PVC to the one you created: existingClaim: "sdxl-turbo-model".

    • Change the storage class: storageClass: oss.

Step 3: Access and test the service

  1. Use kubectl to forward the ComfyUI service to local port 8080.

    Ensure port 8080 is not in use on your local machine. Keep the terminal window open to maintain the port forwarding connection.
    kubectl port-forward svc/ack-comfyui 8080:8188

    Expected output:

    Forwarding from 127.0.0.1:8080 -> 8188
    Forwarding from [::1]:8080 -> 8188

    Open a web browser and navigate to http://localhost:8080.

  2. Download the sdxl-turbo example workflow. On the ComfyUI page, click Load and select the workflow file you just downloaded..

  3. In the CLIP Text Encode (Prompt) text box, enter your desired prompt, for example:

    beautiful landscape scenery glass bottle with a galaxy inside cute fennec fox snow HDR sunset
  4. On the ComfyUI page, enable Extra Options and Auto Queue in the settings. Then, click Queue Prompt to generate an image.

    image