Zheng-Chong / CatVTON

CatVTON is a simple and efficient virtual try-on diffusion model with 1) Lightweight Network (899.06M parameters totally), 2) Parameter-Efficient Training (49.57M parameters trainable) and 3) Simplified Inference (< 8G VRAM for 1024X768 resolution).
Other
964 stars 114 forks source link

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

Open WalkingwithAI opened 2 months ago

WalkingwithAI commented 2 months ago

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

Zheng-Chong commented 2 months ago

请参考 https://github.com/Zheng-Chong/CatVTON/issues/51

WalkingwithAI commented 2 months ago

请参考 #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,麻烦大佬帮看下,感谢!