Wan2.1 Alpha 文生影片
文生影片,支援透明度通道,適合透明背景與半透明物體。
下載工作流程在 Cloud 中試用 API 文件
關於
本 ComfyUI 工作流程「Wan2.1 Alpha T2V」可產生支援 Alpha 通道的文字轉影片,能製作透明背景與半透明物件,特別適合將影片元素疊加於不同背景或製作複雜視覺特效。流程結合 KSampler、CLIPTextEncode、VAEDecode、UNETLoader 等節點,將文字提示轉為影片內容。核心為 Wan2.1 模型,提供高品質影片生成能力。
流程先載入必要模型並設定影片尺寸,再以 CLIPTextEncode 編碼文字提示,將用戶輸入轉為視覺資料。KSampler 節點負責潛在空間取樣,產生連貫影片畫格。EmptyHunyuanLatentVideo 節點管理潛在影片資料,JoinImageWithAlpha 節點確保影片維持透明特性。此流程特別適合需將影片元素無縫整合至動畫、遊戲或多媒體簡報等專案的創作者。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用範例
工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
1 取得 API 金鑰 ↗
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
下載 API JSONAPI 文件 ↗
# Python 3.10+: pip install comfy-sdk==0.4.0
import os
from comfy_sdk import Comfy
api_key = os.environ.get("COMFY_API_KEY", "").strip()
if not api_key: raise RuntimeError("Set COMFY_API_KEY")
os.environ.setdefault("COMFY_BASE_URL", "https://cloud.comfy.org")
client = Comfy(api_key=api_key)
workflow = client.workflows.from_json({
"3": {
"class_type": "KSampler",
"inputs": {
"cfg": 6,
"denoise": 1,
"latent_image": [
"40",
0
],
"model": [
"48",
0
],
"negative": [
"7",
0
],
"positive": [
"6",
0
],
"sampler_name": "uni_pc",
"scheduler": "simple",
"seed": 558449140107503,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": "\"Medium shot. A little girl holds a bubble wand and blows out colorful bubbles that float and pop in the air. The background of this video is transparent. Realistic style.\"\t"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走"
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt) Useless s"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"39",
0
]
},
"_meta": {
"title": "RGB VAE Decode"
}
},
"37": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "wan2.1_t2v_14B_fp8_scaled.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Wan 2.1 t2v 14B"
}
},
"38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "umt5_xxl_fp8_e4m3fn_scaled.safetensors",
"device": "default",
"type": "wan"
},
"_meta": {
"title": "Load Text Encoder"
}
},
"39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "wan_alpha_2.1_vae_rgb_channel.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"40": {
"class_type": "EmptyHunyuanLatentVideo",
"inputs": {
"batch_size": 1,
"height": 480,
"length": 33,
"width": 832
},
"_meta": {
"title": "Empty Hunyuan Video 1.0 Latent"
}
},
"48": {
"class_type": "ModelSamplingSD3",
"inputs": {
"model": [
"65",
0
],
"shift": 5
},
"_meta": {
"title": "ModelSamplingSD3"
}
},
"51": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "wan_alpha_2.1_vae_alpha_channel.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"52": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"51",
0
]
},
"_meta": {
"title": "Alpha VAE Decode"
}
},
"65": {
"class_type": "LoraLoaderModelOnly",
"inputs": {
"lora_name": "wan_alpha_2.1_rgba_lora.safetensors",
"model": [
"37",
0
],
"strength_model": 1
},
"_meta": {
"title": "Load LoRA"
}
},
"80": {
"class_type": "SaveAnimatedWEBP",
"inputs": {
"filename_prefix": "ComfyUI",
"fps": 16,
"images": [
"86",
0
],
"lossless": True,
"method": "default",
"quality": 80
},
"_meta": {
"title": "Save Animated WEBP"
}
},
"82": {
"class_type": "ImageToMask",
"inputs": {
"channel": "red",
"image": [
"52",
0
]
},
"_meta": {
"title": "Convert Image to Mask"
}
},
"84": {
"class_type": "InvertMask",
"inputs": {
"mask": [
"82",
0
]
},
"_meta": {
"title": "Invert Mask"
}
},
"86": {
"class_type": "JoinImageWithAlpha",
"inputs": {
"alpha": [
"84",
0
],
"image": [
"8",
0
]
},
"_meta": {
"title": "Join Image with Alpha"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
Alpha 通道可讓影片具備透明效果,能產生透明背景或半透明物件。
可以,可於步驟 2 調整影片尺寸,依系統效能選擇高解析度。
請使用 JoinImageWithAlpha 節點維持透明度,並於提示中明確說明需透明元素。
可以,可用 SaveAnimatedWEBP 匯出後,再用影片編輯軟體進行後續修改。