nkchocoai / ComfyUI-SaveImageWithMetaData

Custom node for ComfyUI. Add a node to save images with metadata (PNGInfo) extracted from the input values of each node.
GNU General Public License v3.0
33 stars 10 forks source link

Error with multiple image generation #38

Open Tenofas opened 2 months ago

Tenofas commented 2 months ago

Hi, I have a problem using this node when I generate a second image with FaceDetailer. I guess the two images conflicts one another when SaveImageWithMetaData try to retrive the two different images' metadata. I attach the .json of my workflow Tenofas_v3.3.json If I turn off the FaceDetailer there are no error messages. But if I turn it on, as soon as Facedetailer ends its generation, I get the following error:

Error occurred when executing SaveImageWithMetaData:

'NoneType' object has no attribute 'tokenizer'

File "/workspace/ComfyUI/execution.py", line 316, in execute output_data, output_ui, has_subgraph = get_output_data(obj, input_data_all, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/execution.py", line 191, in get_output_data return_values = _map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True, execution_block_cb=execution_block_cb, pre_execute_cb=pre_execute_cb) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/execution.py", line 168, in _map_node_over_list process_inputs(input_dict, i) File "/workspace/ComfyUI/execution.py", line 157, in process_inputs results.append(getattr(obj, func)(**inputs)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-SaveImageWithMetaData/py/nodes/node.py", line 81, in save_images pnginfo_dict_src = self.gen_pnginfo( ^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-SaveImageWithMetaData/py/nodes/node.py", line 167, in gen_pnginfo inputs = Capture.get_inputs() ^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-SaveImageWithMetaData/py/capture.py", line 65, in get_inputs v = format(v, input_data) ^^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-SaveImageWithMetaData/py/defs/formatters.py", line 51, in extract_embedding_names embeddingnames, = _extract_embedding_names(text, input_data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/workspace/ComfyUI/custom_nodes/ComfyUI-SaveImageWithMetaData/py/defs/formatters.py", line 68, in _extract_embedding_names tokenizer = clip.tokenizer ^^^^^^^^^^^^^^

Any idea how to solve this? I would like to add the SaveImageWithMetaData node to every part of the workflow, so to the initial FLUX generated image, to the one with FaceDetailer and also to the Upscaled one at the end of the Workflow. Thanks in advance for your help.

P.S. Sorry, it came out all in bold text... no idea how to change it... sorry!!!

nkchocoai commented 2 months ago

I think I fixed it and the error no longer occurs.

Tenofas commented 2 months ago

Thanks!