Big congratulations to the authors of the paper "Video-As-Prompt: Unified Semantic Control for Video Generation" for their excellent work. This repository is based on the original ByteDance code https://github.com/bytedance/Video-As-Prompt and provides ComfyUI custom nodes to run WAN Video-As-Prompt (VAP).
node.pyprovides two nodes that load the WAN VAP pipeline and run sampling.- Model sources can be local folders or Hugging Face repo ids.
- On CUDA, the loader attempts
enable_sequential_cpu_offload()to reduce memory use.
Loads and caches the WAN VAP pipeline.
- Inputs
model_id(STRING): Hugging Face repo id or local pathdevice(auto/cuda/cpu): device hint (default: auto)
- Behavior
- Resolves
model_idfrom local folders / ComfyUI model folders /ckpts - Downloads from Hugging Face if not found locally
- Reuses the same
model_id+devicepipeline from cache
- Resolves
- Output
WANVAP_PIPE
Generates frames from a reference image and reference video frames.
- Inputs
pipe(WANVAP_PIPE)image(IMAGE): reference imageref_video(IMAGE): reference video frames batchprompt(STRING): text promptprompt_mot_ref(STRING): motion/semantic reference prompts, separated by|
- Optional
num_frames(INT, default 49)height(INT, default 480)width(INT, default 832)num_inference_steps(INT, default 50)frames_selection(evenly/first/random)guidance_scale(FLOAT, default 5.0)seed(INT, default 42)
- Output
frames(IMAGE): generated frames batch
- Install in ComfyUI
custom_nodes
cd <ComfyUI>
cd custom_nodes
git clone https://github.com/<your_name>/ComfyUI-Video-As-Prompt.git- Install dependencies in your ComfyUI Python environment
pip install -r requirements.txt- Prepare the model (choose one)
- Auto-download from Hugging Face
- Set
model_idtoByteDance/Video-As-Prompt-Wan2.1-14B
- Set
- Place locally
- Put the model in one of the locations below:
ComfyUI/models/video_as_prompt/<model_name>/pretrained_weights/ComfyUI/models/video-as-prompt/<model_name>/pretrained_weights/ComfyUI/models/Video-As-Prompt/<model_name>/pretrained_weights/ComfyUI/models/<model_name>/pretrained_weights/ComfyUI/models/ckpts/<model_name>/pretrained_weights/
- If
pretrained_weightsdoes not exist, the folder itself is used.
- Put the model in one of the locations below:
- Restart ComfyUI
- Add and connect
WANVAP_LoadandWANVAP_Sample. - Connect your reference image to
imageand your video frame batch toref_video. - Use
|to separate multiple prompts inprompt_mot_ref. - The output
framesis a ComfyUIIMAGEbatch.
- Model folders must include
image_encoder,vae, andtransformer. - If you hit memory limits, reduce
num_frames,height, orwidth. - You can pass a local folder path or folder name as
model_id.
- Original code: https://github.com/bytedance/Video-As-Prompt
- Paper: Video-As-Prompt: Unified Semantic Control for Video Generation
