Wan 2.2 5B Fun Inpaint
從起始幀和結束幀高效進行影片區域性重繪。5B模型可快速疊代,適用於測試工作流程。
關於
「Wan 2.2 5B Fun Inpaint」工作流程是為了高效率的影片修補(inpainting)而設計,運用 Wan2.2 模型的能力。這個工作流程特別適合透過在起始與結束影格之間進行插幀來生成影片內容,方便進行創意探索與影片生成技術測試。工作流程使用一系列節點,包括用於取樣的 KSampler、用於文字提示詞編碼的 CLIPTextEncode,以及將潛變量解碼為視覺輸出的 VAEDecode。透過 Wan2.2 模型,本工作流程可在快速迭代下維持良好的影片生成品質,適合用於實驗與製作情境。
在技術上,工作流程由幾個關鍵步驟組成。首先使用 UNETLoader 與 VAELoader 等節點載入模型,為影片生成做準備。接著透過 CLIPTextEncode 節點建立提示詞,引導影片的視覺風格與內容。然後使用 LoadImage 與 CreateVideo 等節點指定起始圖片與影片參數(例如尺寸與長度)。最後使用 SaveVideo 節點生成並儲存影片,完成修補流程。這種結構化方式兼具效率與彈性,可滿足多種影片生成需求。
您提供的內容
- 正在讀取工作流程
在 ComfyUI 中執行。 此工作流程無法在此頁面上執行。請在已載入所有內容的 Comfy Cloud 中開啟,或下載到您自己的 ComfyUI。
在 Cloud 中試用工作流程內部
節點圖的唯讀預覽。請在 Comfy Cloud 中開啟,或下載後編輯節點。
Loading the graph
Open full-size workflow preview從程式碼使用此工作流程
可行時會根據工作流程圖和輸入內容產生;否則會顯示儲存的範例。執行可能產生費用的程式碼前,請檢查認證資訊和端點。
What you need
- Runs on
- Comfy Cloud
- 金鑰
- COMFY_API_KEY
需要付費 Cloud 方案與點數。
# 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": [
"73",
2
],
"model": [
"48",
0
],
"negative": [
"73",
1
],
"positive": [
"73",
0
],
"sampler_name": "uni_pc",
"scheduler": "simple",
"seed": 115716327295867,
"steps": 20
},
"_meta": {
"title": "KSampler"
}
},
"6": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": "Flowers are in full bloom, time-lapse photography"
},
"_meta": {
"title": "CLIP Text Encode (Positive Prompt)"
}
},
"7": {
"class_type": "CLIPTextEncode",
"inputs": {
"clip": [
"38",
0
],
"text": "色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走"
},
"_meta": {
"title": "CLIP Text Encode (Negative Prompt)"
}
},
"8": {
"class_type": "VAEDecode",
"inputs": {
"samples": [
"3",
0
],
"vae": [
"39",
0
]
},
"_meta": {
"title": "VAE Decode"
}
},
"37": {
"class_type": "UNETLoader",
"inputs": {
"unet_name": "wan2.2_fun_inpaint_5B_bf16.safetensors",
"weight_dtype": "default"
},
"_meta": {
"title": "Load Diffusion Model"
}
},
"38": {
"class_type": "CLIPLoader",
"inputs": {
"clip_name": "umt5_xxl_fp8_e4m3fn_scaled.safetensors",
"device": "default",
"type": "wan"
},
"_meta": {
"title": "Load CLIP"
}
},
"39": {
"class_type": "VAELoader",
"inputs": {
"vae_name": "wan2.2_vae.safetensors"
},
"_meta": {
"title": "Load VAE"
}
},
"48": {
"class_type": "ModelSamplingSD3",
"inputs": {
"model": [
"37",
0
],
"shift": 8
},
"_meta": {
"title": "ModelSamplingSD3"
}
},
"57": {
"class_type": "CreateVideo",
"inputs": {
"bit_depth": "auto",
"codec": "none",
"color_space": "sRGB",
"fps": 24,
"images": [
"8",
0
]
},
"_meta": {
"title": "Create Video"
}
},
"58": {
"class_type": "SaveVideo",
"inputs": {
"filename_prefix": "video/ComfyUI",
"format": "auto",
"format.codec": "auto",
"video": [
"57",
0
]
},
"_meta": {
"title": "Save Video"
}
},
"70": {
"class_type": "LoadImage",
"inputs": {
"image": "video_wan2_2_5B_fun_inpaint_start_image.png"
},
"_meta": {
"title": "Load Image"
}
},
"73": {
"class_type": "WanFunInpaintToVideo",
"inputs": {
"batch_size": 1,
"end_image": [
"74",
0
],
"height": 640,
"length": 81,
"negative": [
"7",
0
],
"positive": [
"6",
0
],
"start_image": [
"70",
0
],
"vae": [
"39",
0
],
"width": 640
},
"_meta": {
"title": "WanFunInpaintToVideo"
}
},
"74": {
"class_type": "LoadImage",
"inputs": {
"image": "video_wan2_2_5B_fun_inpaint_end_image.png"
},
"_meta": {
"title": "Load Image"
}
}
})
# run() also passes api_key to the partner nodes in this workflow.
job = client.run(workflow, api_key=api_key)問答
本流程使用 Wan2.2 模型進行影片修補,並搭配 VAE 與 UNET 元件進行解碼與取樣。
可以,您可在流程中的 CreateVideo 節點設定影片長度與尺寸等參數。
雖然流程設計高效,但若對 ComfyUI 及影片生成概念有基本認識,將有助於獲得最佳效果。
您可使用 LoadImage 節點輸入想要的起始影像,該影像將作為影片生成的基礎。