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

[复制链接]
发表于 2024-8-29 23:49:06 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
在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.LANCZOS或PIL.Image.Resampling.LANCZOS。


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


办理方案:


修改第50行代码为:

  1. resized_image = img.resize((constrained_width, constrained_height), Image.LANCZOS)
复制代码

回复

使用道具 举报

登录后关闭弹窗

登录参与点评抽奖  加入IT实名职场社区
去登录
快速回复 返回顶部 返回列表