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
-
You have activated PAI ArtLab and granted the required permissions. For more information, see Activate PAI ArtLab and grant permissions.
-
(Optional) You have claimed free trial resources or a coupon, or purchased a resource plan. For more information, see Billing of PAI ArtLab.
Use your free trial resources, coupon, or resource plan within their validity period. For more information, see View usage and validity period.
Procedure
Use ComfyUI (Shared Edition) to generate a style-transferred image and create a video from it.
-
Log on to PAI ArtLab. In the upper-right corner, hover over the
icon and select the China (Shanghai) region. -
On the toolbox page, click the ComfyUI (Shared Edition) card to start the tool.
-
Generate a style-transferred image.
-
Drag the sample workflow file into the ComfyUI interface.
-
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.
-
-
Generate a video.
-
On the workflow page, click the
icon to browse sample templates. -
Select ComfyUI-WanVideoWrapper > wanvideo_480p_I2V_example_01.
-
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.
-
Click Execute and wait for the video to generate.
-
Related operations
Use third-party models and custom nodes
-
Ensure that you are using ComfyUI (Exclusive Edition). ComfyUI (Shared Edition) does not support third-party models or custom nodes.
-
Go to the OSS storage directory that is mounted to the workflow. In the upper-right corner, click the
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/, andunet/subdirectories.-
custom_nodes: Stores node files.-
Example: To install a third-party node, download its library package and upload the folder to the
custom_nodesdirectory. For example, download a folder namedComfyUI_FlashVSR-mainand upload it to yourcustom_nodesdirectory. 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
modelsdirectory: theFlashVSRdirectory and thevaedirectory. All the preceding model files should be uploaded tomodels/FlashVSRandmodels/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
modelsdirectory. For example, ifdepth_anything_v2_vits_fp16.safetensorsis missing, add it to themodels/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.
-
-
-
-
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.
-
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.