Merge pull request #361 from zanllp/enhance-comfyui-image-viewing-compatibility
Improve compatibility for viewing images generated by ComfyUIpull/364/head
commit
ab4e14357e
|
|
@ -71,8 +71,6 @@ https://github.com/zanllp/sd-webui-infinite-image-browsing/assets/25872019/807b8
|
||||||
- 允许你一次性打包下载多个图像
|
- 允许你一次性打包下载多个图像
|
||||||
- 数据来源可以是搜索结果/普通的图像网格查看页面/walk模式等。使用拖拽或者“发送到”都可将图片添加待处理列表
|
- 数据来源可以是搜索结果/普通的图像网格查看页面/walk模式等。使用拖拽或者“发送到”都可将图片添加待处理列表
|
||||||
|
|
||||||
强烈推荐使用在`在新页面打开`,比塞在gradio里舒服太多。
|
|
||||||
|
|
||||||
|
|
||||||
如果您喜欢这个项目并且觉得它对您有帮助,请考虑给我点个⭐️。这将对我持续开发和维护这个项目非常重要。如果您有任何建议或者想法,请随时在issue中提出,我会尽快回复。再次感谢您的支持!
|
如果您喜欢这个项目并且觉得它对您有帮助,请考虑给我点个⭐️。这将对我持续开发和维护这个项目非常重要。如果您有任何建议或者想法,请随时在issue中提出,我会尽快回复。再次感谢您的支持!
|
||||||
|
|
||||||
|
|
@ -93,7 +91,10 @@ https://github.com/zanllp/sd-webui-infinite-image-browsing/assets/25872019/807b8
|
||||||
## 作为使用Python运行的独立程序(不需要SD-webui):
|
## 作为使用Python运行的独立程序(不需要SD-webui):
|
||||||
请参考[Can the extension function without the web UI?](https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/47)
|
请参考[Can the extension function without the web UI?](https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/47)
|
||||||
|
|
||||||
|
如果需要查看ComfyUI生成的图片相关,请先参考 https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/202
|
||||||
|
|
||||||
## 作为桌面应用程序(不需要SD-webui和Python):
|
## 作为桌面应用程序(不需要SD-webui和Python):
|
||||||
|
|
||||||
从仓库页面右侧的`releases`部分下载并安装程序。
|
从仓库页面右侧的`releases`部分下载并安装程序。
|
||||||
# 预览
|
# 预览
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,9 +67,6 @@ https://github.com/zanllp/sd-webui-infinite-image-browsing/assets/25872019/807b8
|
||||||
- Allows for deleting and adding/removing tags, with customizable trigger buttons in the global settings page.
|
- Allows for deleting and adding/removing tags, with customizable trigger buttons in the global settings page.
|
||||||
|
|
||||||
|
|
||||||
> It is strongly recommended to use "Open in new tab", which is much more comfortable than being embedded in Gradio.
|
|
||||||
|
|
||||||
|
|
||||||
If you like this project and find it helpful, please consider giving it a ⭐️. This would be very important for me to continue developing and maintaining this project. If you have any suggestions or ideas, please feel free to raise them in the issue section, and I will respond as soon as possible. Thank you again for your support!
|
If you like this project and find it helpful, please consider giving it a ⭐️. This would be very important for me to continue developing and maintaining this project. If you have any suggestions or ideas, please feel free to raise them in the issue section, and I will respond as soon as possible. Thank you again for your support!
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -89,6 +86,8 @@ If you like this project and find it helpful, please consider giving it a ⭐️
|
||||||
|
|
||||||
Refer to [Can the extension function without the web UI?](https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/47)
|
Refer to [Can the extension function without the web UI?](https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/47)
|
||||||
|
|
||||||
|
If you need to view images generated by ComfyUI, please refer to https://github.com/zanllp/sd-webui-infinite-image-browsing/issues/202.
|
||||||
|
|
||||||
## As a desktop application (without SD-webui and Python):
|
## As a desktop application (without SD-webui and Python):
|
||||||
Download and install the program from the `releases` section on the right-hand side of the repository page.
|
Download and install the program from the `releases` section on the right-hand side of the repository page.
|
||||||
# Preview
|
# Preview
|
||||||
|
|
|
||||||
|
|
@ -314,11 +314,16 @@ def get_comfyui_exif_data(img: Image):
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
meta = {}
|
meta = {}
|
||||||
raw_prompt_data = data[meta_key]["inputs"]
|
KSampler_entry = data[meta_key]["inputs"]
|
||||||
meta["Sampler"] = data[meta_key]["inputs"]["sampler_name"]
|
meta["Sampler"] = KSampler_entry["sampler_name"]
|
||||||
meta["Model"] = data[raw_prompt_data["model"][0]]["inputs"]["ckpt_name"]
|
meta["Model"] = data[KSampler_entry["model"][0]]["inputs"]["ckpt_name"]
|
||||||
pos_prompt = data[raw_prompt_data["positive"][0]]["inputs"]["text"].strip()
|
def get_text_from_clip(idx: str) :
|
||||||
neg_prompt = data[raw_prompt_data["negative"][0]]["inputs"]["text"].strip()
|
text = data[idx]["inputs"]["text"]
|
||||||
|
if isinstance(text, list): # type:CLIPTextEncode (NSP) mode:Wildcards
|
||||||
|
text = data[text[0]]["inputs"]["text"]
|
||||||
|
return text.strip()
|
||||||
|
pos_prompt = get_text_from_clip(KSampler_entry["positive"][0])
|
||||||
|
neg_prompt = get_text_from_clip(KSampler_entry["negative"][0])
|
||||||
pos_prompt_arr = unique_by(parse_prompt(pos_prompt)["pos_prompt"])
|
pos_prompt_arr = unique_by(parse_prompt(pos_prompt)["pos_prompt"])
|
||||||
return {
|
return {
|
||||||
"meta": meta,
|
"meta": meta,
|
||||||
|
|
@ -331,8 +336,8 @@ def comfyui_exif_data_to_str(data):
|
||||||
res = data["pos_prompt_raw"] + "\nNegative prompt: " + data["neg_prompt_raw"] + "\n"
|
res = data["pos_prompt_raw"] + "\nNegative prompt: " + data["neg_prompt_raw"] + "\n"
|
||||||
meta_arr = []
|
meta_arr = []
|
||||||
for k,v in data["meta"].items():
|
for k,v in data["meta"].items():
|
||||||
meta_arr.append(f'{k}:{v}')
|
meta_arr.append(f'{k}: {v}')
|
||||||
return res + ",".join(meta_arr)
|
return res + ", ".join(meta_arr)
|
||||||
|
|
||||||
def read_sd_webui_gen_info_from_image(image: Image, path="") -> str:
|
def read_sd_webui_gen_info_from_image(image: Image, path="") -> str:
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue