conda create -n MMAudioAI -y python==3.11.3
conda activate MMAudioAI
git clone https://github.com/hkchengrex/MMAudio.git
cd MMAudio
pip install pandas pydantic
pip install timm>=1.0.17
pip install aiofiles==23.2.1
pip install matplotlib
pip install torch==2.6.0 torchvision==0.21.0 torchaudio==2.6.0 --index-url https://download.pytorch.org/whl/cu124
pip install https://github.com/kingbri1/flash-attention/releases/download/v2.7.4.post1/flash_attn-2.7.4.post1+cu124torch2.6.0cxx11abiFALSE-cp311-cp311-win_amd64.whl
pip install xformers==0.0.29.post3 --index-url=https://download.pytorch.org/whl/cu124
pip install https://github.com/woct0rdho/triton-windows/releases/download/v3.1.0-windows.post9/triton-3.1.0-cp311-cp311-win_amd64.whl
pip install huggingface_hub[hf_xet]
pip install https://github.com/woct0rdho/SageAttention/releases/download/v2.1.1-windows/sageattention-2.1.1+cu126torch2.6.0-cp311-cp311-win_amd64.whl
pip install "huggingface_hub[cli]"
pip install -e .
#snapshot_download.py
from huggingface_hub import snapshot_download
import os
import shutil
# 캐시 삭제 함수 (통합)
def clear_cache():
cache_dir = os.path.expanduser("~/.cache/huggingface")
if os.path.exists(cache_dir):
shutil.rmtree(cache_dir)
print("캐시 삭제 완료!")
clear_cache() # 먼저 캐시 삭제
repo_id = "hkchengrex/MMAudio"
desired_path = "./" # 또는 "Q:/MMAudio/models"
ignore_patterns = [
"checkpoints/mmaudio_large_44k_ckpt.pth",
"checkpoints/mmaudio_medium_44k_ckpt.pth",
"checkpoints/mmaudio_*_ckpt.pth" # 와일드카드 패턴
]
try:
local_dir = snapshot_download(
repo_id=repo_id,
local_dir=desired_path,
ignore_patterns=ignore_patterns, # exclude와 동일
allow_patterns=["*.pth", "*.ckpt"], # 필요한 파일만 (선택적)
force_download=True, # 기존 파일 무시
resume_download=True # 중단 재개
)
print(f"다운로드 완료! 디렉토리: {local_dir}")
except Exception as e:
print(f"에러: {e}")
python snapshot_download.py
python demo.py --duration=8 --video="path/to/your/video.mp4" --prompt "평화로운 숲 속 바람 소리와 배경 음악"

python gradio_demo.py
다음과 같은 무성비디오를
정말 어울리는 소리를 만들어준다.
