-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
【Hackathon 5th No.87】Add edict_pipeline, pipeline_fabric #307
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
你好,
这里需要改为从paddlenlp中加载,代码如下:
from paddlenlp.transformers import CLIPTextModel, CLIPTokenizer
import paddle | ||
from packaging import version | ||
from PIL import Image | ||
from transformers import CLIPTextModel, CLIPTokenizer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from paddlenlp.transformers import CLIPTextModel, CLIPTokenizer
已修改 |
你好,请新建一个ppdiffusers/tests/community/,并将测试文件放到该文件夹下 |
已修改,使用 get_examples_pipeline 获取 examples 目录pipeline |
@westfish @CrazyBoyM @JunnYu 请辛苦看是否还有修改需要开发者执行。 |
最后的话,https://github.com/PaddlePaddle/PaddleMIX/blob/develop/ppdiffusers/examples/community/README.md 这里面可以加一下有关这个新pipeline的介绍 |
已增加pipeline @JunnYu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
也想请问下,看于edict生成结果中相较于输入图片在颜色上有一个整体的偏移,这个对所有图片都有这样的情况吗。看原始repo给的case好像没这个情况,这个是否可能是diffusers中实现存在一些问题 https://github.com/salesforce/EDICT ,这个请问下了解不 |
不了解,torch测试运行也是同样,https://github.com/salesforce/EDICT 这里如果测试不同那再对比查找是不是有修改 |
…e#307) https://github.com/PaddlePaddle/community/blob/master/hackathon/hackathon_5th/%E3%80%90PaddlePaddle%20Hackathon%205th%E3%80%91%E5%BC%80%E6%BA%90%E8%B4%A1%E7%8C%AE%E4%B8%AA%E4%BA%BA%E6%8C%91%E6%88%98%E8%B5%9B%E5%A5%97%E4%BB%B6%E5%BC%80%E5%8F%91%E4%BB%BB%E5%8A%A1%E5%90%88%E9%9B%86.md#no87paddlemix-ppdiffusers%E6%96%B0%E5%A2%9Ehf-community%E5%BA%94%E7%94%A8pipeline 参考 edict_pipeline.py https://github.com/huggingface/diffusers/blob/main/examples/community/edict_pipeline.py 基于 ppdiffusers https://github.com/PaddlePaddle/PaddleMIX/tree/develop/ppdiffusers/examples/community 下的 pipeline 实现 fp16不存在,取消设置revision="fp16" https://bj.bcebos.com/paddlenlp/models/community/CompVis/stable-diffusion-v1-4/fp16/model_index.json 测试 ``` python test_pipeline_fabric.py python test_edict_pipeline.py ``` 原图 ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/2913ef2b-7192-4e08-8d7a-4e397fec0cd8) paddle生成图 ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/9cacc784-3be0-4d91-ba1f-e049bd2ec0ad) torch生成图 ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/ef37e202-3e6a-4985-8169-c47ad8e41512) paddle和torch生成一致 pipeline_fabric.py torch中使用generator=torch.Generator().manual_seed(17) 测试第一张图和paddle一致,修改randn调用第二张图一致 paddle ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/efb1f1d8-dcaa-4250-a90e-198b9ab01ff6) ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/2cc4b360-3c51-43ef-8f4e-292ae776566a) torch ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/681ac02f-7f0c-44d0-b2db-0d5756cad3ce) ![image](https://github.com/PaddlePaddle/PaddleMIX/assets/4617245/b675a2f2-9756-4390-9c32-1dd103dbd4dc)
https://github.com/PaddlePaddle/community/blob/master/hackathon/hackathon_5th/%E3%80%90PaddlePaddle%20Hackathon%205th%E3%80%91%E5%BC%80%E6%BA%90%E8%B4%A1%E7%8C%AE%E4%B8%AA%E4%BA%BA%E6%8C%91%E6%88%98%E8%B5%9B%E5%A5%97%E4%BB%B6%E5%BC%80%E5%8F%91%E4%BB%BB%E5%8A%A1%E5%90%88%E9%9B%86.md#no87paddlemix-ppdiffusers%E6%96%B0%E5%A2%9Ehf-community%E5%BA%94%E7%94%A8pipeline
参考 edict_pipeline.py https://github.com/huggingface/diffusers/blob/main/examples/community/edict_pipeline.py 基于 ppdiffusers https://github.com/PaddlePaddle/PaddleMIX/tree/develop/ppdiffusers/examples/community 下的 pipeline 实现
fp16不存在,取消设置revision="fp16"
https://bj.bcebos.com/paddlenlp/models/community/CompVis/stable-diffusion-v1-4/fp16/model_index.json
测试
原图
paddle生成图
torch生成图
paddle和torch生成一致
pipeline_fabric.py torch中使用generator=torch.Generator().manual_seed(17) 测试第一张图和paddle一致,修改randn调用第二张图一致
paddle
torch