PaddlePaddle / PaddleNLP

👑 Easy-to-use and powerful NLP and LLM library with 🤗 Awesome model zoo, supporting wide-range of NLP tasks from research to industrial applications, including 🗂Text Classification, 🔍 Neural Search, ❓ Question Answering, ℹ️ Information Extraction, 📄 Document Intelligence, 💌 Sentiment Analysis etc.
https://paddlenlp.readthedocs.io
Apache License 2.0
11.76k stars 2.87k forks source link

[Question]: ValueError when running stable-diffusion-2 model #7872

Closed ATblackwhite closed 6 months ago

ATblackwhite commented 6 months ago

请提出你的问题

code below

import cv2 as cv
import paddle
from ppdiffusers import StableDiffusionAdapterPipeline

pipe = StableDiffusionAdapterPipeline.from_pretrained("stabilityai/stable-diffusion-2")

paddle.seed(114514)
prompt = "A cute pokemon"
image = pipe(prompt, guidance_scale=7.5, height=768, width=768).images[0]
cv.imshow("window", image)

Warning Python\Python39\lib\site-packages\paddle\nn\layer\layers.py:2084: UserWarning: Skip loading for text_model.position_ids. text_model.position_ids is not found in the provided dict.

Error Python\Python39\lib\site-packages\ppdiffusers-0.16.1-py3.9.egg\ppdiffusers\pipelines\pipeline_utils.py", line 1132, in from_pretrained raise ValueError( ValueError: Pipeline <class 'ppdiffusers.pipelines.stable_diffusion.pipeline_stable_diffusion_adapter.StableDiffusionAdapterPipeline'> expected {'vae', 'tokenizer', 'unet', 'feature_extractor', 'safety_checker', 'scheduler', 'adapter', 'text_encoder'}, but only {'vae', 'tokenizer', 'unet', 'scheduler', 'text_encoder'} were passed.

ATblackwhite commented 6 months ago

change StableDiffusionAdapterPipeline into StableDiffusionPipeline