Skip to content
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.84】新增模型视频生成模型MS-Image2Video+MS-Vid2Vid-XL #345

Merged
merged 13 commits into from
Jan 8, 2024

Conversation

Yang-Changhui
Copy link
Contributor

@Yang-Changhui Yang-Changhui commented Dec 8, 2023

目前已完成图生视频,已加入pipeline,请问权重和配置文件上传到哪里

Copy link

paddle-bot bot commented Dec 8, 2023

Thanks for your contribution!

@westfish
Copy link
Contributor

目前已完成图生视频,已加入pipeline,请问权重和配置文件上传到哪里

你好,可以提供一个权重的网盘链接,我们可以帮你上传到bos上

@westfish
Copy link
Contributor

image models下的这些新增的模块,还请额外增加前缀,如modelscope_,以此区分现有的一些模块

@Yang-Changhui
Copy link
Contributor Author

目前已完成图生视频,已加入pipeline,请问权重和配置文件上传到哪里

你好,可以提供一个权重的网盘链接,我们可以帮你上传到bos上
你好,百度网盘无法上传大于4G的文件,压缩后权重文件还是大于4G;阿里云盘可以上传,但是不能分享大于2G的文件,请问是否可以分享ai studio项目链接

@westfish
Copy link
Contributor

目前已完成图生视频,已加入pipeline,请问权重和配置文件上传到哪里

你好,可以提供一个权重的网盘链接,我们可以帮你上传到bos上
你好,百度网盘无法上传大于4G的文件,压缩后权重文件还是大于4G;阿里云盘可以上传,但是不能分享大于2G的文件,请问是否可以分享ai studio项目链接

可以的

@Yang-Changhui
Copy link
Contributor Author

目前已完成图生视频,已加入pipeline,请问权重和配置文件上传到哪里

你好,可以提供一个权重的网盘链接,我们可以帮你上传到bos上
你好,百度网盘无法上传大于4G的文件,压缩后权重文件还是大于4G;阿里云盘可以上传,但是不能分享大于2G的文件,请问是否可以分享ai studio项目链接

可以的

ai studio生成版本不能超过1G,这又该怎么办啊,

@westfish
Copy link
Contributor

目前已完成图生视频,已加入pipeline,请问权重和配置文件上传到哪里

你好,可以提供一个权重的网盘链接,我们可以帮你上传到bos上

你好,百度网盘无法上传大于4G的文件,压缩后权重文件还是大于4G;阿里云盘可以上传,但是不能分享大于2G的文件,请问是否可以分享ai studio项目链接

可以的

ai studio生成版本不能超过1G,这又该怎么办啊,

你可以上传到huggingface上,然后把相关链接分享给我,也是可以的

@shiyutang
Copy link
Collaborator

@westfish 请问CI需要看下么~

@LokeZhou
Copy link
Collaborator

@westfish 请问CI需要看下么~

已rerun

@westfish westfish self-requested a review December 21, 2023 02:47
@westfish
Copy link
Contributor

请问vid2vid任务完成的怎么样了呀,快到时间点了

@Yang-Changhui
Copy link
Contributor Author

请问vid2vid任务完成的怎么样了呀,快到时间点了

这个还没有完成

@Yang-Changhui
Copy link
Contributor Author

Yang-Changhui commented Dec 28, 2023

请问vid2vid任务完成的怎么样了呀,快到时间点了

你好,vid2vid任务已完成,与原始模型有误差,具体问题已提交issue,PaddlePaddle/Paddle#60293

@westfish
Copy link
Contributor

权重文件准备好了吗

@Yang-Changhui
Copy link
Contributor Author

权重文件准备好了吗
权重文件太大了,我上传不了huggingface,你可不可以登陆我的ai studio账号,进去下载啊

@westfish
Copy link
Contributor

公开到这里试试看呢 https://aistudio.baidu.com/modelsoverview

@Yang-Changhui
Copy link
Contributor Author

Yang-Changhui commented Dec 29, 2023

公开到这里试试看呢 https://aistudio.baidu.com/modelsoverview

这里只能上传1M以内的文件,因为我上传的模型是通过利用ai studio的数据集上传后使用的,我把数据集公开后,你从哪里下是不是也可以,
模型文件下载地址:https://aistudio.baidu.com/datasetdetail/246052

@westfish
Copy link
Contributor

请提供完整的推理脚本,可以上传到这个目录:ppdiffusers/tests/community

@Yang-Changhui
Copy link
Contributor Author

请提供完整的推理脚本,可以上传到这个目录:ppdiffusers/tests/community

在上传的两个pipeline中,都有example,这个可以吗
image

@westfish
Copy link
Contributor

image
提供的文件貌似有问题

@westfish
Copy link
Contributor

image

@Yang-Changhui
Copy link
Contributor Author

image 提供的文件貌似有问题

请问,你运行的是video-to-video任务吗,如果是的话是正常的,因为这个模型中即包含了vision-transformer权重,也包含了text-transformer权重,只是在这个任务中并没有用到vision模块

noise = self.build_noise()

model_kwargs = [{"y": img_embedding, "fps": self.fps_tensor}, {"y": self.zero_feature, "fps": self.fps_tensor}]
state_dict = paddle.load("/home/aistudio/img_to_video/unet/model_state.pdparams")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要删除

@westfish
Copy link
Contributor

westfish commented Jan 3, 2024

video2video运行到时候会遇到这个问题:

del from a BertForSequenceClassification model).
Traceback (most recent call last):
File "/root/paddlejob/workspace/zhangxu/project/upgrade/hackathon/pipe_video_to_video.py", line 7, in
video_frames = pipe(prompt=prompt, video_path=video_path).frames
File "/root/paddlejob/workspace/zhangxu/miniconda3/envs/paddle-develop/lib/python3.10/site-packages/decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "/root/paddlejob/workspace/zhangxu/miniconda3/envs/paddle-develop/lib/python3.10/site-packages/paddle/base/dygraph/base.py", line 352, in _decorate_function
return func(*args, **kwargs)
File "/root/paddlejob/workspace/zhangxu/project/upgrade/hackathon/PaddleMIX/ppdiffusers/ppdiffusers/pipelines/video_to_video/pipeline_video_to_video.py", line 329, in call
input = self.input_preprocess(
File "/root/paddlejob/workspace/zhangxu/project/upgrade/hackathon/PaddleMIX/ppdiffusers/ppdiffusers/pipelines/video_to_video/pipeline_video_to_video.py", line 267, in input_preprocess
stride = round(_fps / sample_fps)
ZeroDivisionError: float division by zero

@Yang-Changhui
Copy link
Contributor Author

Yang-Changhui commented Jan 3, 2024

video2video运行到时候会遇到这个问题:

del from a BertForSequenceClassification model). Traceback (most recent call last): File "/root/paddlejob/workspace/zhangxu/project/upgrade/hackathon/pipe_video_to_video.py", line 7, in video_frames = pipe(prompt=prompt, video_path=video_path).frames File "/root/paddlejob/workspace/zhangxu/miniconda3/envs/paddle-develop/lib/python3.10/site-packages/decorator.py", line 232, in fun return caller(func, *(extras + args), **kw) File "/root/paddlejob/workspace/zhangxu/miniconda3/envs/paddle-develop/lib/python3.10/site-packages/paddle/base/dygraph/base.py", line 352, in _decorate_function return func(*args, **kwargs) File "/root/paddlejob/workspace/zhangxu/project/upgrade/hackathon/PaddleMIX/ppdiffusers/ppdiffusers/pipelines/video_to_video/pipeline_video_to_video.py", line 329, in call input = self.input_preprocess( File "/root/paddlejob/workspace/zhangxu/project/upgrade/hackathon/PaddleMIX/ppdiffusers/ppdiffusers/pipelines/video_to_video/pipeline_video_to_video.py", line 267, in input_preprocess stride = round(_fps / sample_fps) ZeroDivisionError: float division by zero

你好,你这个问题好像是没有加载视频吧
image

@@ -57,14 +57,19 @@
else:
from .models import (
AsymmetricAutoencoderKL,
Vid2VidSDUNet,
Copy link
Contributor

@westfish westfish Jan 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请按照字母顺序排列,不然会太乱影响后续开发

@westfish
Copy link
Contributor

westfish commented Jan 3, 2024

模型已经上传,对应id为"Yang-Changhui/img-to-video-paddle"和"Yang-Changhui/video-to-video-paddle"
使用方法如下:

import paddle
from PIL import Image
from ppdiffusers import ImgToVideoSDPipeline
from ppdiffusers.utils import export_to_video, load_image

pipe = ImgToVideoSDPipeline.from_pretrained(
    "Yang-Changhui/img-to-video-paddle", paddle_dtype=paddle.float32
)
img = load_image(
    "https://paddlenlp.bj.bcebos.com/models/community/westfish/develop-upgrade0193/stable_diffusion_inpaint_boy.png"
)
# img = Image.open('test.jpg')
video_frames = pipe(img).frames
video_path = export_to_video(video_frames, output_video_path="test.mp4")
import paddle
from ppdiffusers import VideoToVideoModelscopePipeline
from ppdiffusers.utils import export_to_video
pipe = VideoToVideoModelscopePipeline.from_pretrained("Yang-Changhui/video-to-video-paddle")
video_path = 'test.mp4'
prompt = "A man is walking on the street."
video_frames = pipe(prompt=prompt, video_path=video_path).frames
video_path = export_to_video(video_frames, "video2video_test.mp4")

@Yang-Changhui
Copy link
Contributor Author

模型已经上传,对应id为"Yang-Changhui/img-to-video-paddle"和"Yang-Changhui/video-to-video-paddle" 使用方法如下:

import paddle
from PIL import Image
from ppdiffusers import ImgToVideoSDPipeline
from ppdiffusers.utils import export_to_video, load_image

pipe = ImgToVideoSDPipeline.from_pretrained(
    "Yang-Changhui/img-to-video-paddle", paddle_dtype=paddle.float32
)
img = load_image(
    "https://paddlenlp.bj.bcebos.com/models/community/westfish/develop-upgrade0193/stable_diffusion_inpaint_boy.png"
)
# img = Image.open('test.jpg')
video_frames = pipe(img).frames
video_path = export_to_video(video_frames, output_video_path="test.mp4")
import paddle
from ppdiffusers import VideoToVideoModelscopePipeline
from ppdiffusers.utils import export_to_video
pipe = VideoToVideoModelscopePipeline.from_pretrained("Yang-Changhui/video-to-video-paddle")
video_path = 'test.mp4'
prompt = "A man is walking on the street."
video_frames = pipe(prompt=prompt, video_path=video_path).frames
video_path = export_to_video(video_frames, "video2video_test.mp4")

那请问接下来还需要做什么,写gradio demo吗

@westfish
Copy link
Contributor

westfish commented Jan 3, 2024

模型已经上传,对应id为"Yang-Changhui/img-to-video-paddle"和"Yang-Changhui/video-to-video-paddle" 使用方法如下:

import paddle
from PIL import Image
from ppdiffusers import ImgToVideoSDPipeline
from ppdiffusers.utils import export_to_video, load_image

pipe = ImgToVideoSDPipeline.from_pretrained(
    "Yang-Changhui/img-to-video-paddle", paddle_dtype=paddle.float32
)
img = load_image(
    "https://paddlenlp.bj.bcebos.com/models/community/westfish/develop-upgrade0193/stable_diffusion_inpaint_boy.png"
)
# img = Image.open('test.jpg')
video_frames = pipe(img).frames
video_path = export_to_video(video_frames, output_video_path="test.mp4")
import paddle
from ppdiffusers import VideoToVideoModelscopePipeline
from ppdiffusers.utils import export_to_video
pipe = VideoToVideoModelscopePipeline.from_pretrained("Yang-Changhui/video-to-video-paddle")
video_path = 'test.mp4'
prompt = "A man is walking on the street."
video_frames = pipe(prompt=prompt, video_path=video_path).frames
video_path = export_to_video(video_frames, "video2video_test.mp4")

那请问接下来还需要做什么,写gradio demo吗

是的,还请辛苦在ppdiffusers/examples/inference/I2VGen-XL-gradio下加入相关gradio,类似这种https://modelscope.cn/studios/damo/I2VGen-XL-Demo/summary

@Yang-Changhui
Copy link
Contributor Author

@westfish 你好,gradio已上传,但是我发现使用gradio由图像生成的视频和使用代码生成的视频不一样,这种情况是什么问题呢

@westfish
Copy link
Contributor

westfish commented Jan 4, 2024

要确定随机种子,参数,还有输入的图片(是不是大小变了?)等都一致;你这个pipeline里没有把generaotr暴露出来,而是用的vae的seed,不知道哪里会不会又问题,你先多跑几次看看代码生成的视频是不是都一样先

@Yang-Changhui
Copy link
Contributor Author

Yang-Changhui commented Jan 5, 2024

@westfish 你好,unet模型的名字起错了,应该是STUnet,我的命名时SFUnet,已经修改了,能麻烦你将两个配置文件中的unet和model_index.json文件重新上传一下吗,https://aistudio.baidu.com/datasetdetail/246052 ,或者还是用原来的呢

@westfish
Copy link
Contributor

westfish commented Jan 5, 2024

@westfish 你好,unet模型的名字起错了,应该是STUnet,我的命名时SFUnet,已经修改了,能麻烦你将两个配置文件中的unet和model_index.json文件重新上传一下吗,https://aistudio.baidu.com/datasetdetail/246052 ,或者还是用原来的呢

嗯嗯 帮你重新上传bos了

@Yang-Changhui
Copy link
Contributor Author

要确定随机种子,参数,还有输入的图片(是不是大小变了?)等都一致;你这个pipeline里没有把generaotr暴露出来,而是用的vae的seed,不知道哪里会不会又问题,你先多跑几次看看代码生成的视频是不是都一样先

这个是没有问题的,代码由图生成的视频都是一样的,视频生成视频V100 32G会显示超内存,之前就不会有这个问题,使用的是相同的代码,

@westfish
Copy link
Contributor

westfish commented Jan 8, 2024

嗯嗯 目前相关工作都搞好了吧 现在给你合入吧

Copy link
Contributor

@westfish westfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@westfish westfish merged commit ff0d2f2 into PaddlePaddle:develop Jan 8, 2024
2 of 3 checks passed
westfish pushed a commit to westfish/PaddleMIX that referenced this pull request Sep 25, 2024
…ddle#345)

目前已完成图生视频,已加入pipeline,请问权重和配置文件上传到哪里
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants