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

生成的图像会裁剪问题 #55

Open
WalkingwithAI opened this issue Sep 12, 2024 · 2 comments
Open

生成的图像会裁剪问题 #55

WalkingwithAI opened this issue Sep 12, 2024 · 2 comments

Comments

@WalkingwithAI
Copy link

大佬,我使用Comfyui的节点生成图片时,输出的图片比原图会裁剪掉一部分,请问这个问题是什么原因呢?望解答,感谢!
输入图像:image
输出图像:image

@Zheng-Chong
Copy link
Owner

请参考 #51

@WalkingwithAI
Copy link
Author

请参考 #51

Since the model only accepts images of size 768x1024, we crop the input person image to fit the corresponding aspect ratio. You can adjust the aspect ratio of the input image to 4:3 to avoid cropping or edit the resize&crop code to padding rather than crop.

大佬我改了下pipeline.py中的代码,把check_inputs函数中的:
image = resize_and_crop(image, (width, height))
mask = resize_and_crop(mask, (width, height))
改成:
image = resize_and_padding(image, (width, height))
mask = resize_and_padding(mask, (width, height))
但是没有生效,输出图片依然是有裁剪的。

我使用的是Comfyui,麻烦大佬帮看下,感谢!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants