Skip to content
代码片段 群组 项目
提交 ddf6899d 编辑于 作者: DepFA's avatar DepFA 提交者: AUTOMATIC1111
浏览文件

generalise to popular lossless formats

上级 9a1dcd78
No related branches found
No related tags found
无相关合并请求
......@@ -88,18 +88,14 @@ class EmbeddingDatabase:
data = []
if filename.upper().endswith('.PNG'):
if os.path.splitext(filename.upper())[-1] in ['.PNG', '.WEBP', '.JXL', '.AVIF']:
embed_image = Image.open(path)
if 'sd-ti-embedding' in embed_image.text:
if hasattr(embed_image, 'text') and 'sd-ti-embedding' in embed_image.text:
data = embedding_from_b64(embed_image.text['sd-ti-embedding'])
name = data.get('name', name)
else:
data = extract_image_data_embed(embed_image)
name = data.get('name', name)
elif filename.upper().endswith('.WEBP'):
embed_image = Image.open(path)
data = extract_image_data_embed(embed_image)
name = data.get('name', name)
else:
data = torch.load(path, map_location="cpu")
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册