본문 바로가기
AI&개발&데이터분석/VisionAI

내 서버에서 Wan2.1로 영상만들기!! - 오픈소스 영상생성모델

by 일등박사 2025. 9. 24.

 

 

미약하지만,,

저에게는 3090 GPU 서버가하나있습니다!!

(여러분의 서버에도 GPU와 cuda 세팅이 끝났다는 가정하에 시작합니다!)

여기에 영상생성 오픈소스모델 Wan2.1을 설치해보겠습니다!!

 

 

https://github.com/Wan-Video/Wan2.1

 

GitHub - Wan-Video/Wan2.1: Wan: Open and Advanced Large-Scale Video Generative Models

Wan: Open and Advanced Large-Scale Video Generative Models - Wan-Video/Wan2.1

github.com

 

git에 나온대로 잘 따라해주기전, wan2라는 환경을 먼저 만들어주겠습니다!

 

conda create -n wan2 python=3.12

 

이제 readme를 따라 설치합니다!!

 

git clone https://github.com/Wan-Video/Wan2.1.git
cd Wan2.1

# Ensure torch >= 2.4.0
pip install -r requirements.txt

 

그리고는,

제 분수에 맞게 1.3B의 모델을 받아줍니다!!

pip install "huggingface_hub[cli]"
huggingface-cli download Wan-AI/Wan2.1-T2V-1.3B --local-dir ./Wan2.1-T2V-1.3B

 

이제 준비가 끝났습니다!!

 

예시텍스트대로 실행해보아요!

python generate.py  --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."

 

그럼 코드가 막 돌아가면서! 로그가 찍힙니다!!

python generate.py  --task t2v-1.3B --size 832*480 --ckpt_dir ./Wan2.1-T2V-1.3B --prompt "Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage."
[2025-09-22 11:29:23,218] INFO: offload_model is not specified, set to True.
[2025-09-22 11:29:23,218] INFO: Generation job args: Namespace(task='t2v-1.3B', size='832*480', frame_num=81, ckpt_dir='./Wan2.1-T2V-1.3B', offload_model=True, ulysses_size=1, ring_size=1, t5_fsdp=False, t5_cpu=False, dit_fsdp=False, save_file=None, src_video=None, src_mask=None, src_ref_images=None, prompt='Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage.', use_prompt_extend=False, prompt_extend_method='local_qwen', prompt_extend_model=None, prompt_extend_target_lang='zh', base_seed=6207652638682605426, image=None, first_frame=None, last_frame=None, sample_solver='unipc', sample_steps=50, sample_shift=5.0, sample_guide_scale=5.0)
[2025-09-22 11:29:23,218] INFO: Generation model config: {'__name__': 'Config: Wan T2V 1.3B', 't5_model': 'umt5_xxl', 't5_dtype': torch.bfloat16, 'text_len': 512, 'param_dtype': torch.bfloat16, 'num_train_timesteps': 1000, 'sample_fps': 16, 'sample_neg_prompt': '色调艳丽,过曝,静态,细节模糊不清,字幕,风格,作品,画作,画面,静止,整体发灰,最差质量,低质量,JPEG压缩残留,丑陋的,残缺的,多余的手指,画得不好的手部,画得不好的脸部,畸形的,毁容的,形态畸形的肢体,手指融合,静止不动的画面,杂乱的背景,三条腿,背景人很多,倒着走', 't5_checkpoint': 'models_t5_umt5-xxl-enc-bf16.pth', 't5_tokenizer': 'google/umt5-xxl', 'vae_checkpoint': 'Wan2.1_VAE.pth', 'vae_stride': (4, 8, 8), 'patch_size': (1, 2, 2), 'dim': 1536, 'ffn_dim': 8960, 'freq_dim': 256, 'num_heads': 12, 'num_layers': 30, 'window_size': (-1, -1), 'qk_norm': True, 'cross_attn_norm': True, 'eps': 1e-06}
[2025-09-22 11:29:23,218] INFO: Input prompt: Two anthropomorphic cats in comfy boxing gear and bright gloves fight intensely on a spotlighted stage.
[2025-09-22 11:29:23,218] INFO: Creating WanT2V pipeline.
[2025-09-22 11:30:05,118] INFO: loading ./Wan2.1-T2V-1.3B/models_t5_umt5-xxl-enc-bf16.pth
[2025-09-22 11:30:11,935] INFO: loading ./Wan2.1-T2V-1.3B/Wan2.1_VAE.pth
[2025-09-22 11:30:12,343] INFO: Creating WanModel from ./Wan2.1-T2V-1.3B
[2025-09-22 11:30:14,346] INFO: Generating video ...
 56%|█████████████████████████████████████████████████████▊                                          | 28/50 [04:55<03:56, 10.74s/it]

 

GPU도 사용됩니다!!

 

결과는!?

아래와 같이 영상이 생성되었습니다!^^

그럴듯 하구만유!

 

댓글