赞
踩
step1:clone 代码
git clone https://github.com/lllyasviel/ControlNet.git
step2:创建虚拟环境
cd ControlNet
# 创建虚拟环境
conda env create -f environment.yaml
# 激活环境
conda activate control
step3:安装xformers
库
不安装报错,提示“No module ‘xformers’. Proceeding without it.”
RuntimeError: Attempting to deserialize object on a CUDA device but torch.cuda.is_available() is False. If you are running on a CPU-only machine, please use torch.load with map_location=torch.device(‘cpu’) to map your storages to the CPU.
pip install xformers
模型链接:https://huggingface.co/lllyasviel/ControlNet/tree/main
git lfs install
git clone https://huggingface.co/lllyasviel/ControlNet
将下载到的文件夹annotator、models放置ControlNet文件夹中
运行以下代码
python gradio_canny2image.py
登录网址:http://127.0.0.1:7860/ 即可在线体验。
运行以下代码
python gradio_pose2image.py
运行以下代码
python gradio_seg2image.py
分割不太准,换成SAM可能会好些。
其他demo感兴趣的可自行尝试。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。