首页 / 编程开发 / 用python读取stable diffusion生成的png图片的参数信息

用python读取stable diffusion生成的png图片的参数信息

2023-06-01 23:05:13编程开发 阅读 931

之前使用stable diffusion生成图片之后,如果要再看绘画参数,需要打开stable diffusion的webui来看图片的参数。

对于其它没安装环境的电脑颇为麻烦。

当然如果要脚本化保存这些Png信息,就不能依赖于webui了,必然需要实现用python读取绘图参数。


由于exiftool对汉字的支持非常不友好,时不是就坑到,已经寻找了另一个替代方法,以下技术依旧能用于学习,但实现功能建议尝试另一篇文章的方法,《简单版方法二,python读取stable diffusion生成png图片的参数提示词》


本次功能的实现主要使用 exiftool

1、下载exe

https://exiftool.org

2、pip install  pyexiftool

3、编写脚本代码

import exiftool

with exiftool.ExifToolHelper(executable='E:\\pytool\\exiftoo.exe') as et:
    metadata = et.get_metadata('E:\\images\\00001-1197544452.png')


print(metadata)
4、查看结果会有一个字段 PNG:Parameters
[{....'PNG:Interlace': 0, 'PNG:Parameters': 'complex 3d render ultra detailed of a beautiful porcelain profile woman android face, cyborg, robotic parts, 150 mm, beautiful studio soft light, rim light, vibrant details, luxurious cyberpunk, lace, hyperrealistic, anatomical, facial muscles, cable electric wires, microchip, elegant, beautiful background, octane render, H. R. Giger style, 8k, best quality, masterpiece, illustration, an extremely delicate and beautiful, extremely detailed ,CG ,unity ,wallpaper, (realistic, photo-realistic:1.37),Amazing, finely detail, masterpiece,best quality,official art, extremely detailed CG unity 8k wallpaper, absurdres, incredibly absurdres,\nNegative prompt: illustration, 3d, sepia, painting, cartoons, sketch, (worst quality:2), (low quality:2), (normal quality:2), lowres, bad anatomy, bad hands, normal quality, ((monochrome)), ((grayscale:1.2)), futanari, full-package_futanari, penis_from_girl, newhalf, collapsed eyeshadow, multiple eyebrows, vaginas in breasts,holes on breasts, fleckles, stretched nipples, gigantic penis, nipples on buttocks, analog, analogphoto, signatre, logo,2 faces\nSteps: 20, Sampler: Euler a, CFG scale: 7, Seed: 1197544452, Face restoration: GFPGAN, Size: 800x800, Model hash: fc2511737a, Model: chilloutmix_NiPrunedFp32Fix, Denoising strength: 0.75, Mask blur: 4', 'Composite:ImageSize': '800 800', 'Composite:Megapixels': 0.64}] 



本文《用python读取stable diffusion生成的png图片的参数信息》由爱思考吧 isres.com 分享,转载请注明出处。本文网址:https://www.isres.com/php/59.html

本站主要收集测评能够节省时间和提升效率的软件工具并分享使用与学习的过程和感受,任何情况下用户都需遵守所使用软件资源的相关协议。与《用python读取stable diffusion生成的png图片的参数信息》有关的本站文章及资源仅供个人学习交流使用,相关资源请下载后24小时内删除,请勿用于其它用途,因此产生的任何问题由您自行承担。

相关推荐

猜你喜欢