receyuki / comfyui-prompt-reader-node

The ultimate solution for managing image metadata and multi-tool compatibility. ComfyUI node version of the SD Prompt Reader
MIT License
289 stars 22 forks source link

[BUG] - Error occurred when executing SDPromptReader: 'dict' object has no attribute 'strip' #9

Closed madvas closed 1 year ago

madvas commented 1 year ago

Description

In ComfyUI I get this error for all created images when I run SD prompt reader.

Error occurred when executing SDPromptReader:

'dict' object has no attribute 'strip'

File "[my path]\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[my path]\ComfyUI_windows_portable\ComfyUI\execution.py", line 83, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[my path]\ComfyUI_windows_portable\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "[my path]\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\nodes.py", line 125, in load_image
image_data = ImageDataReader(f)
^^^^^^^^^^^^^^^^^^
File "[my path]\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\stable_diffusion_prompt_reader\sd_prompt_reader\image_data_reader.py", line 45, in __init__
self.read_data(file)
File "[my path]\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\stable_diffusion_prompt_reader\sd_prompt_reader\image_data_reader.py", line 100, in read_data
self._parser = ComfyUI(
^^^^^^^^
File "[my path]\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\stable_diffusion_prompt_reader\sd_prompt_reader\format\comfyui.py", line 42, in __init__
self._comfy_png()
File "[my path]ComfyUI\custom_nodes\comfyui-prompt-reader-node\stable_diffusion_prompt_reader\sd_prompt_reader\format\comfyui.py", line 72, in _comfy_png
self._positive.strip(),
^^^^^^^^^^^^^^^^^^^^

Reproduction steps

No response

Image file

image

Version

1.0.0

madvas commented 1 year ago

It works okay when I use SD parameter generator -> SD prompt saver combo

receyuki commented 1 year ago

As I mentioned in the introduction

Due to custom nodes and complex workflows potentially causing issues with SD Prompt Reader's ability to read image metadata correctly, it is recommended to embed the Prompt Saver node within the workflow to ensure maximum compatibility.

Without the Prompt Saver node, I have to provide support for each custom node individually, which would be an endless task. So, please use the Prompt Saver node if possible.

receyuki commented 1 year ago

If everything is fine with this combo, I will mark this issue as resolved. BTW, don’t forget to update the node to the latest version.