- 踩了一些坑,來記錄下
環境
- CentOS Linux release 7.5.1804 (Core) 服務器
- RTX 3090
復現流程
- 按照Stable Diffusion的readme下載模型權重、我下載的是stable-diffusion-v1-4 版本的
1
- 因為服務器沒法上huggingface,所以得把權重下載到本地,但是運行鏈接
ln -s <path/to/model.ckpt> models/ldm/stable-diffusion-v1/model.ckpt
時會報錯,因此直接將權重改名放到了這個文件夾
2
- 好像是需要下載檢測器,那段代碼直接注釋掉了
3
OSError: Can’t load tokenizer for ‘openai/clip-vit-large-patch14’.
- 還是因為被墻了,從clip上下載權重,然后修改文件夾名字為clip-vit-large-patch14
- 同時修改
diffusion-webui/repositories/stable-diffusion-stability-ai/ldm/modules/encoders/modules.py
文件內的路徑
結果
python scripts/txt2img.py --ckpt "sd-v1-4.ckpt" --prompt "a photograph of an astronaut riding a elephant" --plms
歷經千辛萬苦,生成了demo圖片
參考資料
- Stable Diffusion搭建全過程記錄,生成自己的專屬藝術照
- stable-diffusion官方版本地復現手冊(2023年4月10日)