PAI ArtLab ComfyUI

更新时间:
复制 MD 格式

Generate images and videos with AI models using ComfyUI, a node-based workflow tool in PAI ArtLab.

Log on to the PAI ArtLab console.

Prerequisites

Procedure

Use ComfyUI (Shared Edition) to generate a style-transferred image and create a video from it.

  1. Log on to PAI ArtLab. In the upper-right corner, hover over the image icon and select the China (Shanghai) region.

  2. On the toolbox page, click the ComfyUI (Shared Edition) card to start the tool.

  3. Generate a style-transferred image.

    1. Drag the sample workflow file into the ComfyUI interface.

    2. In the Upload Style Image ① area, upload a sample style image. In the Upload Style Image ② area, upload a sample building image. Then, click Execute and wait for the image to generate.

  4. Generate a video.

    1. On the workflow page, click the image icon to browse sample templates.

    2. Select ComfyUI-WanVideoWrapper > wanvideo_480p_I2V_example_01.

    3. Configure the following parameters.

      Node

      Description

      #22 WanVideoWrapper

      (WanVideo Model Loader)

      For model, select WanVideo/Wan2_1-I2V-14B-480P_fp8_e4m3fn.safetensors.

      #16 WanVideoWrapper

      (WanVideo TextEncode)

      This iconic building is completely covered by beautiful pink flowers, lush green leaves, intricate vines, spring garden aesthetics, as well as falling petals and fluttering butterflies. Surrealism, rich details, warm sunshine, 8K resolution, realistic natural and architectural scenes, advanced aesthetics, surrealism, high quality, and ultra clarity.

      #21 WanVideoWrapper

      (WanVideo VAE Loader)

      For model_name, select WanVideo_1_VAE_bf16.safetensors.

      #18

      (Load Image)

      Click upload and select the style-transferred image you generated.

    4. Click Execute and wait for the video to generate.

Related operations

Use third-party models and custom nodes

  1. Ensure that you are using ComfyUI (Exclusive Edition). ComfyUI (Shared Edition) does not support third-party models or custom nodes.

  2. Go to the OSS storage directory that is mounted to the workflow. In the upper-right corner, click the image icon and click the link to the storage bucket.

    The OSS path has the following directory structure.

    It contains the custom_nodes/, input/, models/, output/, temp/, and unet/ subdirectories.

    • custom_nodes: Stores node files.

      • Example: To install a third-party node, download its library package and upload the folder to the custom_nodes directory. For example, download a folder named ComfyUI_FlashVSR-main and upload it to your custom_nodes directory. On a GitHub repository page, you can get the package by clicking Code > Download ZIP. Decompress the downloaded ZIP file to find the node folder.

    • models: Stores model files.

      • Example 1: Models that a node library depends on

        • Node libraries often depend on specific models. To ensure the nodes run correctly, download and upload the required models. Upload the models to the corresponding directories within the models directory: the FlashVSR directory and the vae directory. All the preceding model files should be uploaded to models/FlashVSR and models/vae.

          ComfyUI/models/FlashVSR
          ├── LQ_proj_in.ckpt                                          # v1.1 or v1.0
          ├── TDecoder.ckpt
          ├── diffusion_pytorch_model_streaming_dmd.safetensors         # v1.1 or v1.0
          ├── posi_prompt.pth
          ComfyUI/models/vae
          ├── Wan2.1_VAE.pth                                           # or safetensors
          ├── lightvae2_1.pth                                          # 32.2M or taev2_1.pth, lighttaev2_1.pth
          ├── Wan2.1_VAE_upscale2x_imageonly_real_v1_diff.safetensors   # rename from diffusion_p
      • Example 2: A workflow reports a missing model error

        • A missing model error usually occurs because the platform cannot connect to the public internet by default. To resolve this, add the required model to the models directory. For example, if depth_anything_v2_vits_fp16.safetensors is missing, add it to the models/depthanything/ directory in OSS. The error message specifies the node that requires the model, such as DownloadAndLoadDepthAnythingV2Model, and the full file path.

        • If the required path does not exist in OSS, create it.

  3. Load new models or nodes

    After you upload a model to the mounted storage space, click PaiCustom > Load New Model. If the model is not found, click Restart Process. After the process restarts, refresh the browser page.

    After you upload a node file, click Restart Process. After the process restarts, refresh the browser page.

    If the new model or node is still not found, in the left-side navigation pane, click Developer Center. Find the corresponding ComfyUI service, Stop the service, and then Start it again.

  4. Upload model or node files You can upload files to OSS by using the console. For large files, see How do I upload large objects to OSS?.

Export a workflow

Shared edition (new UI)

Click Workflow > Export (API) to export the workflow in API format. Click Export to export the workflow in its original format.

Shared edition (old UI)

Click Save (API format) to export the workflow in API format. Click Save to export the workflow in its original format.

Exclusive edition

Click Export (API) to export the workflow in API format. Click Export to export the workflow in its original format.

Switch UI versions

  • Switch from the old UI to the new UI:

    Open the Settings dialog box. In the left pane, select Comfy. In the Region settings area on the right, select New from the drop-down list.

  • Switch from the new UI to the old UI:

    Open the Settings dialog box and go to the Comfy section. In the Region settings area, select Old from the drop-down list.

Verify ComfyUI API integration

For more information, see PAI ArtLab Developer Center usage guide.