Compare commits

...
2 Commits
Author SHA1 Message Date
audioscavenger 61f89b803f release 2.46
- bug discovered with *rgthree's Ksampler Config*: using `steps_total` as an input to a Ksampler, will issue the index of the output, instead of the steps value ("\[nodeNum, 0]" instead of steps value). FIX: use `steps_total` instead of `steps`!
- uncommented \_\_all\_\_ in init.py
- potential bugfix in splitKey, `len(splitKey) = 2` to identify actual "node.widget" format
	modified:   README.md
	modified:   __init__.py
	new file:   assets/bug-rgthree-ksampler_config-steps_total.png
	modified:   save_image_extended.py
2024-05-21 07:07:13 -07:00
audioscavenger a2f4b00fa1 WIP 2.45 💾
- new title
	modified:   README.md
	modified:   save_image_extended.py
2024-05-11 11:44:40 -07:00
4 changed files with 29 additions and 15 deletions
+18 -6
View File
@@ -1,5 +1,5 @@
# Save Image Extended for ComfyUI
**AVIF** support!
# 💾 Save Image Extended for ComfyUI
**AVIF** and **WebP** support!
<p align="center">
<img src="assets/save-image-extended-comfyui-example.png" />
@@ -8,7 +8,7 @@
* Customize the folder, sub-folders, and filenames of your images!
* Save data about the generated job (sampler, prompts, models) as entries in a `json` (text) file, in each folder.
* Use the values of ANY node's widget, by simply adding its badge number in the form _id.widget_name_:
* Oh btw... also saves your output as **WebP** or **JPEG**... And yes the prompt is included :) ComfyUI can load it but a PR approval is needed.
* Oh btw... also saves your output as **WebP** / **JPEG** / **AVIP** ... And yes the prompt is included :) ComfyUI can load it but a PR approval is needed to fix a bug on their side.
<br>
@@ -34,7 +34,7 @@ pip install piexif pillow pillow-avif-plugin
```
### Installation
### Manual Download
1. Open a terminal inside the 'custom_nodes' folder located in your ComfyUI installation dir
2. Use the `git clone` command to clone the [save-image-extended-comfyui](https://github.com/audioscavenger/save-image-extended-comfyui) repo.
```
@@ -79,11 +79,14 @@ Tested and working with default samplers, Efficiency nodes, UltimateSDUpscale, C
#
Quality and compression settings:
* AVIF quality is fixed at 50.
* AVIF quality is fixed at 60.
* WebP quality is fixed at 75.
* JPEG quality is fixed at 91.
* PNG is maxed compressed (9)
Start a discussion or a poll if you want to change output quality, and add another attribute in the node. There's so many already, some complain about the node being too tall.
#
About extensions WebP AVIF JPEG: ComfyUI cannot load it atm... Feel free to ask ComfyUI team to add support for AVIF/WebP/jpeg!
@@ -119,11 +122,12 @@ jobs.json sample:
## RoadMap
I won't promise anything, just like @thedyze did not promise anything when they released this custom node.
Then disappeared for good 3 months later. That's fine, I do that too.
Then disappeared for good 3 months later. That's fine, I do that too somtimes :)
However, I do provide a way to contact me, and will accept PR and collabs.
Once I feel like I don't have time to work on it, I will gladly transfer ownership or let collabs maintain it.
- [ ] ComfyRoll CR XY Save Grid Image: it offers jpeg webp tif - check how it embeds prompt and see if that works better with Comfy!
- [ ] offer quality setting in the node?
- [ ] remove save_job_to_json? thisis pretty much useless actually, since it only saves the last value found for each node.
- [ ] remove job_custom_text? what is this for?
@@ -132,6 +136,14 @@ Once I feel like I don't have time to work on it, I will gladly transfer ownersh
- [ ] offer to place the counter anywhere, as a key in filename_keys
- [ ] files can get out of order if prefixes change... that is expected, but is this what we want? another reason to have the counter place anywhere we want
### release 2.46 💾
- bug discovered with *rgthree's Ksampler Config*: using `steps_total` as an input to a Ksampler, will issue the index of the output, instead of the steps value ("\[nodeNum, 0]" instead of steps value). FIX: use `steps_total` instead of `steps`!
- uncommented \_\_all\_\_ in init.py
- potential bugfix in splitKey, `len(splitKey) = 2` to identify actual "node.widget" format
### release 2.45 💾
- added 💾 in the name
### release 2.44
- so many bugfixes
- complete rework of generate_custom_name to handle ALL the possible scenarios
+1 -1
View File
@@ -13,4 +13,4 @@
from .save_image_extended import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
# __all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
__all__ = ['NODE_CLASS_MAPPINGS', 'NODE_DISPLAY_NAME_MAPPINGS']
Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

+10 -8
View File
@@ -26,7 +26,7 @@ original_locale = locale.setlocale(locale.LC_TIME, '')
# class SaveImageExtended -------------------------------------------------------------------------------
class SaveImageExtended:
version = 2.44
version = 2.46
type = 'output'
png_compress_level = 9
@@ -219,7 +219,6 @@ class SaveImageExtended:
# print(f"debug generate_custom_name: --prefix: {prefix}")
# print(f"debug generate_custom_name: --keys_to_extract: {keys_to_extract}")
# print(f"debug generate_custom_name: --prompt:")
# pprint.pprint(prompt)
# now separating numbered keys from non-numbered keys:
# 37.ckpt_name = i want the ckpt_name from node #37
@@ -234,12 +233,12 @@ class SaveImageExtended:
# check if this is a subfolder: starts with ./ or /, can also end with /
if '/' in key:
# key is a fsubfolder
# key is a subfolder: ./subfolder or ../subfolder or /subfolder
value = key
else:
splitKey = key.split('.')
# we also exclude cases like "string." or ".string" or "string.string"
if len(splitKey) > 1:
# we also exclude cases like "..string" or "sting.string.x" etc
if len(splitKey) == 2:
# key has the form string.string
if '' not in splitKey:
# key has the form string.string
@@ -258,10 +257,10 @@ class SaveImageExtended:
# key is in the form string.string = fixed string
value = self.cleanup_fileName(key)
else:
# key is in the form ".string" or "string." or "." - we won't clean that up and keep as is
# key is in the form ".string" or "string." or "." - we won't clean that up and keep as is, maybe it's a separator
value = key
else:
# nodeKey is not a folder, has no dot, could be a valid key to find, could be a fixed string - keep as is
# nodeKey is not a folder, has no dot, or multiple dots, could be a valid key to find, could be a fixed string - keep as is
nodeKey = key
self.find_keys_recursively(prompt, [nodeKey], found_values)
# is key num.widget_name
@@ -537,6 +536,9 @@ class SaveImageExtended:
filename_keys_to_extract = [item.strip() for item in filename_keys.split(',')]
foldername_keys_to_extract = [item.strip() for item in foldername_keys.split(',')]
################################## UNCOMMENT HERE TO SEE THE ENTIRE PROMPT
# pprint.pprint(prompt)
##########################################################################
custom_filename = self.generate_custom_name(filename_keys_to_extract, filename_prefix, delimiter, prompt)
custom_foldername = self.generate_custom_name(foldername_keys_to_extract, foldername_prefix, delimiter, prompt)
@@ -593,7 +595,7 @@ NODE_CLASS_MAPPINGS = {
NODE_DISPLAY_NAME_MAPPINGS = {
'SaveImageExtended': 'Save Image Extended',
'SaveImageExtended': '💾 Save Image Extended',
}