欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 教育 > 高考 > module ‘PIL.Image‘ has no attribute ‘ANTIALIAS‘

module ‘PIL.Image‘ has no attribute ‘ANTIALIAS‘

2024/10/24 16:24:30 来源:https://blog.csdn.net/weixin_47420447/article/details/141646078  浏览:    关键词:module ‘PIL.Image‘ has no attribute ‘ANTIALIAS‘

在ComfyUI Manager Update All 之后,可能会出现以下情况:

module 'PIL.Image' has no attribute 'ANTIALIAS'

它主要是来以下路径:

ComfyUI-Custom-Scripts/py/constrain_image.py

原因:

    ANTIALIAS在 Pillow 10.0.0 中被删除(在之前的多个版本中被弃用)。现在您需要使用PIL.Image.LANCZOSPIL.Image.Resampling.LANCZOS

(这与提到的算法完全相同ANTIALIAS,只是您无法再通过名称访问它ANTIALIAS。)

解决方案:

修改第50行代码为:

resized_image = img.resize((constrained_width, constrained_height), Image.LANCZOS)

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com