PaddleNLP icon indicating copy to clipboard operation
PaddleNLP copied to clipboard

[Question]: stable diffusion模型下载失败

Open Yiheng-Liu opened this issue 2 years ago • 6 comments

请提出你的问题

使用paddlenlp的stable diffusion功能下载模型时报错:

Downloading from https://bj.bcebos.com/paddlenlp/models/community/CompVis/stable-diffusion-v1-4\tokenizer_config.json failed with code 404!

paddlenlp版本:2.4.2 paddlepaddle版本:2.3.2 平台:Windows11 python版本:3.10.8

代码示例:

from paddlenlp import Taskflow


def stable_diffusion():
    text_to_image = Taskflow("text_to_image", model="CompVis/stable-diffusion-v1-4")
    prompt = [
        "In the morning light,Chinese ancient buildings in the mountains,Magnificent and fantastic John Howe landscape,lake,clouds,farm,Fairy tale,light effect,Dream,Greg Rutkowski,James Gurney,artstation",
        "clouds surround the mountains and Chinese palaces,sunshine,lake,overlook,overlook,unreal engine,light effect,Dream,Greg Rutkowski,James Gurney,artstation"
    ]
    image_list = text_to_image(prompt)
    for batch_index, batch_image in enumerate(image_list):
        for image_index_in_returned_images, each_image in enumerate(batch_image):
            each_image.save(f"stable-diffusion-figure_{batch_index}_{image_index_in_returned_images}.png")

Yiheng-Liu avatar Nov 02 '22 14:11 Yiheng-Liu

你好,在windows下,现在这个bug已经修复了 https://github.com/PaddlePaddle/PaddleNLP/pull/3640 。 您可以安装develop版本的paddlenlp,命令如下

git clone https://github.com/PaddlePaddle/PaddleNLP
python setup.py install

JunnYu avatar Nov 03 '22 01:11 JunnYu

您可以使用 https://github.com/PaddlePaddle/PaddleNLP/tree/develop/ppdiffusers 这里面的ppdiffusers(今天也将发个小版本修复 windows下载链接的问题),或者 在aistudio上快速体验文生图 https://aistudio.baidu.com/aistudio/projectdetail/4905623?channelType=0&channel=0

JunnYu avatar Nov 03 '22 01:11 JunnYu

您可以使用 https://github.com/PaddlePaddle/PaddleNLP/tree/develop/ppdiffusers 这里面的ppdiffusers(今天也将发个小版本修复 windows下载链接的问题),或者 在aistudio上快速体验文生图 https://aistudio.baidu.com/aistudio/projectdetail/4905623?channelType=0&channel=0

收到,感谢回复

Yiheng-Liu avatar Nov 03 '22 02:11 Yiheng-Liu

develop 未收到该bugfix。默认使用的是auto tokenizer,需要对transformers/auto目录下的tokenizer和modeling2个文件进行修改

shm007g avatar Nov 03 '22 06:11 shm007g

@shm007g 好的谢谢,的确忘了这个部分的。

JunnYu avatar Nov 03 '22 12:11 JunnYu

你好,已修复 #3670,感谢反馈

gongel avatar Nov 03 '22 13:11 gongel