stable-diffusion-webui 加載 Taiyi-Stable-Diffusion-1B-Chinese-v0.1
軟件地址
https://github.com/IDEA-CCNL/stable-diffusion-webui?(這個(gè)是修改過代碼的,可以直接用)
模型地址
?https://huggingface.co/IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1/tree/main
報(bào)錯(cuò)貼地址
https://huggingface.co/IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1/discussions
https://github.com/IDEA-CCNL/Fengshenbang-LM/issues/186
1.錯(cuò)誤
RuntimeError: Error(s) in loading state_dict for LatentDiffusion:
size mismatch for cond_stage_model.transformer.text_model.embeddings.position_ids: copying a param with shape torch.Size([1, 512]) from checkpoint, the shape in current model is torch.Size([1, 77])
這個(gè)是 roberta模型,與 CLIP模型不同,SDwebui無法直接調(diào)用,需改代碼
修改方法
https://github.com/IDEA-CCNL/stable-diffusion-webui/commit/61ece0cec1097ab8f5e2b52c8d340ca203c5917b
2.錯(cuò)誤
OSError: Can't load tokenizer for 'IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1/'. If you were trying to load it from 'https://huggingface.co/models', make sure you don't have a local directory with the same name. Otherwise, make sure 'IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1/' is the correct path to a directory containing all relevant files for a BertTokenizer tokenizer.
需要python安裝tokenizer,然后下載運(yùn)行環(huán)境
tokenizer環(huán)境可以通過PyCharm等軟件添加
太乙運(yùn)行環(huán)境下載地址
git clone?https://huggingface.co/IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1
把下載好的文件放根目錄,新建文件夾IDEA-CCNL/Taiyi-Stable-Diffusion-1B-Chinese-v0.1
我之前一直報(bào)錯(cuò),就是因?yàn)檫\(yùn)行環(huán)境路徑?jīng)]放對(duì)
安裝好后的截圖

運(yùn)行程序,示例圖


好了,到此為止,可以愉快的玩耍了