安装与配置步骤
InstantCharacter需要支持GPU的环境运行,以下是详细的安装指南:
环境准备
- Python 3.8+版本
- PyTorch(CUDA支持)
- Git和Git LFS用于大文件下载
- 推荐NVIDIA GPU(最低48GB VRAM,优化后支持24GB)
安装流程
- 安装Python和PyTorch:
pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu118
- 安装依赖库:
pip install transformers accelerate diffusers huggingface_cli
- 克隆仓库:
git clone https://github.com/Tencent/InstantCharacter.git
- 下载模型检查点:
huggingface-cli download --resume-download Tencent/InstantCharacter --local-dir checkpoints
注意事项
需确保GPU驱动和CUDA版本与PyTorch兼容,模型需移至支持CUDA的设备。如遇下载问题,可使用Hugging Face镜像地址。
本答案来源于文章《InstantCharacter:从单张图片生成一致性角色的开源工具》