Code Monkey home page Code Monkey logo

comfyui-prompt-reader-node's People

Contributors

covert96 avatar haohaocreates avatar mcmonkey4eva avatar receyuki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

comfyui-prompt-reader-node's Issues

[BUG] - invalid literal for int() with base 10: 'None'

Description

I read one previous report with this issue, but op said he had complicated workflow. Also response suggested using Prompt Saver to save metadata w images.
I'm trying to read metadata from previously generated (ComfyUI) png images. The only node I have in my workspace is the Prompt Reader yet still get this error.

Reproduction steps

Start with clean, clear workspace
Load only the Prompt Reader node
Load image, either from slider or by upload
Queue Prompt
error generated

Image file

workflow

[BUG] - SD Prompt Saver node fails to save in jpg and webp formats

Description

Selecting any other format aside from png results in error (png works just fine) (latest build):

Error occurred when executing SDPromptSaver:

[Errno 2] No such file or directory: '00001.webp'

File "C:\Stable Diffusion\GUIs\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Stable Diffusion\GUIs\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 "C:\Stable Diffusion\GUIs\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 "C:\Stable Diffusion\GUIs\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\nodes.py", line 386, in save_images
piexif.insert(metadata, str(file))
File "C:\Stable Diffusion\GUIs\ComfyUI_windows_portable\python_embeded\Lib\site-packages\piexif_insert.py", line 32, in insert
with open(image, 'rb') as f:
^^^^^^^^^^^^^^^^^

Reproduction steps

  1. Image generated
  2. SD Prompt Saver node fails to save an image with jpg or webp format selected

Image file

No response

Version

1.0.0

[FEATURE REQUEST] - Positive and Negative Aesthetic Score print from Parameters output in Parameter Generator node

Summary

Currently, the SD Parameter Generator node allows the definition of both the Positive and Negative Aesthetic Score values, particularly important for SDXL Refiner. However, these two values are not printed as part of the Parameters output generated by the node.

Screenshot 2023-10-26 at 09 39 35

Would it be possible to add them to the output (perhaps, between the Scheduler and the Size outputs)?

Basic Example

Positive aesthetic score: 6.00
Negative aesthetic score: 2.50

Reference Issues.

No response

[BUG] - Reader Node Will Not install through ComfyUI Manager

Description

I have removed all other custom nodes, thinking that it might be a conflict with another one, but it continues to fail installation.

### Loading: ComfyUI-Manager (V1.25.2)
### ComfyUI Revision: 1881 [af94eb14] | Released on '2024-01-06'
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/custom-node-list.json
FETCH DATA from: https://raw.githubusercontent.com/ltdrdata/ComfyUI-Manager/main/extension-node-map.json
Traceback (most recent call last):
  File "/Users/username/AI/ComfyUI/nodes.py", line 1810, in load_custom_node
    module_spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/Users/username/AI/ComfyUI/custom_nodes/comfyui-prompt-reader-node/__init__.py", line 1, in <module>
    from .nodes import NODE_CLASS_MAPPINGS, NODE_DISPLAY_NAME_MAPPINGS
  File "/Users/username/AI/ComfyUI/custom_nodes/comfyui-prompt-reader-node/nodes.py", line 35, in <module>
    from .stable_diffusion_prompt_reader.sd_prompt_reader.image_data_reader import (
  File "/Users/username/AI/ComfyUI/custom_nodes/comfyui-prompt-reader-node/stable_diffusion_prompt_reader/sd_prompt_reader/image_data_reader.py", line 185
    match image_format:
          ^
SyntaxError: invalid syntax

Cannot import /Users/username/AI/ComfyUI/custom_nodes/comfyui-prompt-reader-node module for custom nodes: invalid syntax (image_data_reader.py, line 185)

Import times for custom nodes:
   0.0 seconds (IMPORT FAILED): /Users/username/AI/ComfyUI/custom_nodes/comfyui-prompt-reader-node

Reproduction steps

No response

Image file

image

[FEATURE REQUEST] - Batch support on ComfyUI

Summary

First, thank you for the node suite. I've been playing with it the last few days and it screams "must-have batch tool for upscaling workflow from low-quality rushes/seed images".

The abilty to load images with their metadata is awesome, especially when - like me - you use wildcards a lot.

But when we design an upscaling workflow, we most likely want it to support batch loading.

I tried the obvious way with "convert image to input" on the reader but I couldn't find any node able to link to this "image" input.

image

Basic Example

Abillity to connect image loaders to SD_Prompt_Read node.

Reference Issues.

No response

[BUG] - SDParameterGenerator doesn't load the seed value from previously generated images

Description

If I generate an image with a workflow that includes the SDParameterGenerator node (like the AP Workflow or the default ComfyUI workflow in the image below), and I later drag that image into the ComfyUI canvas, or Load it via the floating menu, all generation parameters are correctly loaded except the seed value. That remains to -1.

Reproduction steps

  1. Load the default ComfyUI workflow.
  2. Convert any control in the KSampler from widget to input
  3. Link the KSampler input to the corresponding output in the SDParameterGenerator node
  4. Generate a couple of images
  5. Load the before last image and notice that the seed remains at -1

Image file

Screenshot 2024-01-13 at 10 04 46

[BUG] - title

Description

Error occurred when executing SDPromptReader:

invalid literal for int() with base 10: 'None'

File "C:\Users\rober\Downloads\AI Creations\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\Downloads\AI Creations\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 "C:\Users\rober\Downloads\AI Creations\ComfyUI\execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rober\Downloads\AI Creations\ComfyUI\custom_nodes\comfyui-prompt-reader-node\nodes.py", line 161, in load_image
seed = int(
^^^^

I use impact wildcard nodes for my prompt strings/wildcards. Can I assume this is incompatible with the prompt reader?
This workflow was attempting to load an image that I have genned with verifiable metadata using the batch loader connected to the prompt reader.

Reproduction steps

No response

Image file

No response

[BUG] - Save in Root

Description

The extension no longer saves the images in ComfyUI's output folder as usual, in this case it saves the images. Now the images all end up in the root folder of the hard disc, without a file folder.

image

Reproduction steps

No response

Image file

No response

[BUG] - SD Batch Loader and SD Prompt Reader don't work together

Description

(Not sure if this is a bug or just me doing it wrong)
I have created a bunch of images with SD Prompt Saver. Each one has a different prompt. Now I would like to further process them in a batch using the prompt retrieved by SD Prompt Reader. But it seems I can only load the images individually and manually. Connecting the SD Batch Loader and SD Prompt Reader gives a runtime error.
Having the ability to use the original prompt in batch processing would be tremendously useful for the community, it would be really great if you have an answer to this!
image

Reproduction steps

No response

Image file

No response

[FEATURE REQUEST] - VAE selector for SD Parameter Generator

Summary

Right now the SD Parameter Generator node exports a VAE. Great, but it doesn't allow to define which one. Usually, this is a task for the Checkpoint Loader, as in the following case, with the Efficient Loader node:

Screenshot 2023-10-31 at 10 32 25

but, given that the use already has to define the type of model (SD1, SD2, SDXL), it would be convenient to have the VAE selector (mainly useful for SD1.5) baked into the Parameter Generator.

Basic Example

Just like the dropdown in my screenshot above.

Reference Issues.

No response

[BUG] - Adding the SDParamenterGenerator to a workflow disables the Queue button until the browser is refreshed

Description

I don't really know if it's a bug, but I'll report nonetheless.
A few users of the AP Workflow lament that, once downloaded it, they are unable to Queue any generation job. The Queue button does nothing, and there's no error message in the terminal.

So, to investigate, I cleared the canvas, loaded the default ComfyUI workflow, and added the SDParameterGenerator node.
From that moment on, even without connecting the SDParameterGenerator node to the default KSampler, my Queue button stopped working.
As soon as I remove the SDParameterGenerator node from the default workflow, the Queue button restarts working as expected. No need to restart ComfyUI or reload the workflow.

It took me 30 minutes to figure out that the only way to fix this is that, once you add the SDParameterGenerator node to the default workflow, you need to refresh the browser for the Queue button to start working as expected.

I don't know what's causing this but I thought that it's perhaps connected to the problem that the AP Workflow users lament.

Reproduction steps

  1. Clear the ComfyUI canvas and Load Default workflow.
  2. Generate an image to verify that everything is working as expected.
  3. Add the SDParameterGenerator node to the workflow. It doesn't matter if it's properly configured or even connected to anything.
  4. Try to Queue a new generation. You should fail. The Queue button should do nothing.
  5. Remove the SDParameterGenerator node from the workflow. The Queue button should work again as expected.
  6. Re-add the SDParameterGenerator node from the workflow. The Queue button should do nothing.
  7. Refresh the browser screen with CTRL/CMD+R
  8. Verify that the Queue button now works again (while theSDParameterGenerator node is still present in the workflow).

Image file

Screenshot 2024-01-13 at 10 04 46

[FEATURE REQUEST] - Compatibility with Image Receiver node (Impact Pack)

Summary

I'm considering different approaches to reduce the number of wires in the AP Workflows without sacrificing understandability of the information flow.

Among the other things, I'm evaluating the use of Impact Pack's Image Sender and Image Receiver nodes.

I would place an Image Sender node after each image generation node (e.g., KSampler, Detailers) and an Image Receiver node just before every SD Prompt Saver node.

My test shows that the latter don't play well together.

After a KSampler node generates the image, it passes it to the Image Sender node, which correctly passes it to the Image Receiver node. However, the Image Receiver node doesn't seem to pass the image to the SD Prompt Saver node as expected:

Screenshot 2023-11-03 at 13 22 34

I am not married to the idea of using Impact Pack's Image Sender/Receiver nodes at all costs. I'd just like to have the SD Prompt Saver to wirelessly receive the image to save, if possible.

Basic Example

See screenshot.

Reference Issues.

No response

[FEATURE REQUEST] - Generic string placeholder input for prompt saver

Summary

Hello,
I'm loving this node set, and one thing I'd like to have is the ability to pass in a string to the prompt saver node that would get filled in as a placeholder. This way I could craft custom strings that I wanted to be part of a filename. Currently I've just modified scheduler_str back into existence and use %scheduler to do this, but it would be nice to not redo this any time I update.

I don't know whether the node should handle filename sanitation or leave that up to the user, though.

Basic Example

Example: I want to make a series of images with a specific theme that gets passed into the prompt, e.g. "cyberpunk". I would pass this string into the prompt saver node as an input, say "custom", then set an output filename of %date_%custom_%counter to get 2024-02-02_cyberpunk_00001.png

Reference Issues.

No response

[BUG] - 'list' object has no attribute 'strip'

Description

I generated a image by comfyui-portrait-master

ComfyUI_temp_tnetk_00026_

After I loaded the image with comfyui-prompt-reader-node , got error

Reproduction steps

1ใ€Add the SD Prompt Reader node to your workflow.
2ใ€Drag and drop an image (generated from a previous workflow and otherwise unmodified) into the SD Prompt Reader node.
3ใ€hit "Queue Prompt,"
4ใ€error:

'list' object has no attribute 'strip'
File "/opt/ComfyUI/execution.py", line 155, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/opt/ComfyUI/execution.py", line 85, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/opt/ComfyUI/execution.py", line 78, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/opt/ComfyUI/custom_nodes/comfyui-prompt-reader-node/nodes.py", line 156, in load_image
image_data = ImageDataReader(f)
File "/opt/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 "/opt/ComfyUI/custom_nodes/comfyui-prompt-reader-node/stable_diffusion_prompt_reader/sd_prompt_reader/image_data_reader.py", line 105, in read_data
self._parser = ComfyUI(
File "/opt/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 "/opt/ComfyUI/custom_nodes/comfyui-prompt-reader-node/stable_diffusion_prompt_reader/sd_prompt_reader/format/comfyui.py", line 84, in _comfy_png
File "/opt/ComfyUI/custom_nodes/comfyui-prompt-reader-node/stable_diffusion_prompt_reader/sd_prompt_reader/format/comfyui.py", line 85, in
self._negative_sdxl.get(key).strip()

Image file

No response

[BUG] - SD Prompt Saver does not work with batches

Description

When generating more than one image in ComfyUI, the SD Prompt Saver only saves the last image.

It shows the correct number of images, but each image is the same last image (if batch = 4, you'll see 4 times the last image in the preview)

Reproduction steps

  1. set Batch > 1
  2. Generate Images
  3. look at preview in SD Promt Saver Node
  4. look at files saved

Image file

image

Version

1.0.0

[BUG] - title

Description

The 'image' as input, does not want to connect to another image loader?
It should be able to receive an image at that node?

Reproduction steps

Convert Image load to input.
Does not connect to the external loader.

Image file

image

Version

1.0.0

[FEATURE REQUEST] - File name/Path

Summary

Having a file name output on the file reader would be nice and path to the file would be nice

Basic Example

Having the file name and path lets you easy place the new image in the same folder and make a text file with comments or information named the same as the new image for easy sorting

Reference Issues.

No response

[BUG] - prompt reader node causes search dialog corruption

Description

When this node is enabled I encounter strange behaviour from the search dialog. From the search dialog, when clicking upon the top right dropdown control (which has things like LATENT, MODEL, CLIP, etc in it) i encounter anomalous behaviour. First the desktop locked up, graphical artifacts spans over the screen. Restarting the shell let me try again. This time clicking the control displays the normal items but also has appended:
STRING
INT
FLOAT
*

euler,euler_ancestral,heun,heunpp2,etc...
normal,karras,exponential,sgn_uniform,etc...

Reproduction steps

  1. Fresh install comfyui
  2. Fresh manual install comfyui-prompt-reader-node
  3. Open comfyui and double click any none-node space to bring up search
  4. Click the top right drop down control.

Image file

No response

[FEATURE REQUEST] - Counter in PATH

filename & path
%counter cannot be used for path, it can only be used for filename. This %counter is slightly different from the %counter in the built-in Saver node, it will count all image files in the path.

I know it's hardly imposible to please everyone. But I would like to have a counter in the path, like %date/%counter/, so that I can keep my renders separately, it's much easier for my workflow. Is there any workaround to achive this (not manually)?

[BUG] - Double-click menu to add nodes is very long

Description

With this extension loaded, the background-double click menu to add a node becomes much wider than the screen. Removing it and restarting comfyui show this menu in regular behavior.

Both Comfyui and prompt-reader-node are up to date on my end.

Reproduction steps

No response

Image file

image

Version

1.0.0

[BUG] - %counter overwrites existing files

Summary

I have a lot of images in different formats, but all the names starts with the counter. If possible, I'd like for SD Prompt Saver to calculate the value of %counter taking into account other images in the folder

Basic Example

Let's say I have next files:
00034 something something.jpg
00134 something something.png
01097.webp

And I have only %counter as a filename in the SD Prompt Saver node. I'd like it to save next generated picture with the name
01098.png
(png or any other format)

PS: thank you for your hard work!

[BUG] - Prompt Merger producing unsanitised output with concatenated NULL strings.

Description

SDPromptMerger throws an error when fed empty strings

Error occurred when executing SDPromptMerger:

list index out of range

File "D:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 143, in recursive_execute
input_data_all = get_input_data(inputs, class_def, unique_id, outputs, prompt, extra_data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 27, in get_input_data
obj = outputs[input_unique_id][output_index]
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^

Reproduction steps

image

Image file

No response

Cannot import module

File "L:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\nodes.py", line 27, in
from .stable_diffusion_prompt_reader.sd_prompt_reader.constants import (
ModuleNotFoundError: No module named 'comfyui-prompt-reader-node.stable_diffusion_prompt_reader.sd_prompt_reader'

Cannot import L:\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node module for custom nodes: No module named 'comfyui-prompt-reader-node.stable_diffusion_prompt_reader.sd_prompt_reader'
Traceback (most recent call last):

[FEATURE REQUEST] - File Input Pipeline

Summary

Re-adding this request, though I found it but it's just a text input.

Requesting a proper image pipeline into the prompt reader so that we can feed images generated in the workflow straight into it for metadata parsing.

Basic Example

generate image > parse metadata > use metadata

Reference Issues.

No response

[FEATURE REQUEST] - Clip Skip in Parameter Generator node

Summary

Just wanted to say congratulations for this package, it's amazing to have all parameters in (almost) one node.
I only miss Clip Skip to complete the whole thing. Have you ever think about it?
Thank you this marvellous job.

Basic Example

Clip Skip in SD Parameter Generator.

Reference Issues.

No response

[BUG] - The Prompt Reader doesn't populate when image is loaded, and can display the wrong information to the user.

Description

I feel like the only person running into this, since no one has mentioned it here so far, but whenever I drag an image or manually choose an image for the prompt reader node, the boxes stay blank. It can populate with the wrong information if changing images, causing problems if the user isn't aware that the prompt info doesn't match the current image. I added steps into the Reproduction Steps that you can follow.

Here's what it ends up looking like. It displays information from the wrong image.

image

Sorry if I'm doing something stupid. I'm on ComfyUI: 1930d1533d.

Reproduction steps

  1. Add an SD Prompt Reader node
  2. Add an SD Prompt Saver node (not necessary, but done because the usage instructions says to do that, even if you're not using it)
  3. Connect the Prompt Reader node to the Prompt Saver image input (not required for the bug, but just to be safe).
  4. Drag an image into the standalone SD Prompt Reader program, to confirm that it has metadata that can be read.
  5. In the SD Prompt Reader node, either drag the image from step 4 onto the node, or click on the "choose file to upload" button, and choose the file in step 4.
  6. Notice that nothing is being populated. It's completely blank.
  7. Add the generation to the queue.
  8. Notice that it's populated.
  9. Add several generations to the queue.
  10. Change the image in the SD Prompt Reader node.
  11. Notice that it doesn't change due to actions taking place, but only when adding it to a queue.

Image file

No response

[BUG] - Exception after updating ComfyUI

Description

There is an exception message "'NoneType' object has no attribute 'endswith'" after updating ComfyUI

Reproduction steps

  1. Go into the ComfyUI Manager Menu
  2. Click 'Update All'
  3. Wait and restart
  4. Create a simple workflow with 'SD Batch Loader' and 'SD Prompt Reader'
  5. Press 'Queue Prompt'

Image file

Exception

[BUG] - %counter overwriting

Description

ComfyUI: When using %counter in the filename, it will overwrite existing images. Basically %counter will reset to 0 everytime you queue up a render.

Result : When you queue X iterations with Batch_Size = Y, you will have Y images at the end, with %counter values from 0 to Y

Suggestion : have it work like the basic SaveImage node, where you supply the path&filename, and the counter is automatically added and incremented based on existing images with that filename at target path.

Reproduction steps

No response

Image file

No response

Version

1.3.4

OS

Windows

Tool

A1111's webUI

No data detected or unsupported format

Description

SDPromptReader node :
I got this error also i tried JPG,PNG images:
https://i.gyazo.com/3eb9df3545280bedb9b4b2fb91811a2c.png


Error occurred when executing SDPromptReader:

No data detected or unsupported format

File "D:\dev\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\dev\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 "D:\dev\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 "D:\dev\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\nodes.py", line 159, in load_image
raise ValueError(MESSAGE["format_error"][1])

Error occurred when executing SDPromptReader:

No data detected or unsupported format

File "D:\dev\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\dev\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 "D:\dev\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 "D:\dev\ComfyUI_windows_portable\ComfyUI\custom_nodes\comfyui-prompt-reader-node\nodes.py", line 159, in load_image
raise ValueError(MESSAGE["format_error"][1])

Reproduction steps

No response

Image file

No response

[BUG] - SD Prompt Saver multiplying by batch number

Description

Single images work fine, increasing batch size results in multiplying results, 2x2, 3x3, etc. So a with a batch size set to 4 you get 16 images being processed in SD Prompt Saver, there's also a problem with filename output sanitation, error related:

Error occurred when executing StringFunction|pysssss:

'list' object has no attribute 'replace'

File "D:\AI\ComfyUI_windows_portable\ComfyUI\execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\AI\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 "D:\AI\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 "D:\AI\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Custom-Scripts\py\string_function.py", line 43, in exec
out = text_a.replace(text_b, text_c)
^^^^^^^^^^^^^^

Similar issue seems to occur with SD Prompt Merge when using null strings that I already posted about.

Reproduction steps

image

Image file

Workflow image:
ComfyUI_34305983516218_2023-12-04_51

[FEATURE REQUEST] - Add "Notes" field to the SD Parameter Generator node

Summary

Very often, I find myself in need of adding a note to the image generation I'm about to queue. It could be a reason why I am doing a certain test, or the purpose of the image, or just to indicate how what was the tool that generated that image.
Accordingly, I manually add a Multiline Text node next to the SD Parameter Generator node, and then push output that text to both the debug section of my workflow and to the Extra Info input of the SD Prompt Saver node (see screenshot below).

It works perfectly fine, but it's a lot of extra nodes and wires that we could probably avoid if this field would be part of the SD Parameter Generator node.

Basic Example

Screenshot 2023-12-05 at 10 13 23

I propose the creation of this field as the very last input box (if possible), and the very last output pin, in the node.

I think it's still within the scope of this node and it would be a QoL improvement.

Thank you for considering it.

Reference Issues.

No response

[FEATURE REQUEST] - Save LoRA information in civitAI compatible format from the CivitAI nodes.

Summary

Save Checkpoint and LoRA information in civitAI compatible format from the CivitAI nodes.

This is just about the only feature I feel like I'm missing now, at the moment I'm forced to use cute-comfy to save full civitAI compatible metadata including all checkpoints and loras used. However cute-comfy has it's own limitations because it's not a node but listener so it has no ability to tell it exactly which metadata to record if using unsupported nodes.

Basic Example

The civitAI nodes can be populated with AIR codes that are civitAI compatible for linking resources.

Reference Issues.

No response

[FEATURE REQUEST] - SD Prompt Saver outputs the generated filename

Summary

I don't remember if we previously discussed this feature in another issue and I was told that due to the limitations of the engine, it's impossible to achieve. I'll just create its own issue here for consideration and documentation.

The problem is that, for logging and debugging purposes, I would like to export (via print or save to file) the full filename generated by SD Prompt Saver node, according to the configuration decided in the node.

If an export wouldn't be possible, at least, I wish the node would print the generated filename in the terminal on its own. It's not ideal, but it's better than nothing.

Basic Example

Let's say that the SD Prompt Saver is configured as follows:

Screenshot 2023-11-03 at 09 11 31

I would want to see an exported line (or a line printed in the terminal) that says:

Saved file: 465801832038646_2023-10-25_143039_base.png

Reference Issues.

No response

[FEATURE REQUEST] - Explicit pixels dimensions in aspect_ratio drop down for Parameter Generator

Summary

I know we already discussed this, and I tested the current approach extensively in these weeks since you released the new version of Parameter Generator.

My conclusion is that it's really difficult to remember what each ratio means in terms of pixels from the current drop down:
Screenshot 2023-10-25 at 18 26 54

And since the node shows the exact pixels only after queuing a generation, it's a game of guesses, or googling the answer before using ComfyUI, or bookmarking posts like this one. At least, that's what I do now.

It would be really super useful if the node would show each pixel pairing next to each ratio (and according to the selected SD family).

Basic Example

  1. The user selects SDXL 1024 from the model_version drop down.
  2. The user sees thinks like "16:9 - 1344x768px" in the aspect_ratio drop down.

Reference Issues.

No response

[FEATURE REQUEST] - Support for new LCM sampler

Description

I just released AP Workflow 6.0 with the SD Parameter Generator. Everything works fine, except when I try to test the new LCM sampler with the LCM models:

Screenshot 2023-11-15 at 15 06 52

This configuration generates the following error:

Error occurred when executing SDParameterGenerator:

'model.diffusion_model.input_blocks.0.0.weight'

File "xyz/ComfyUI/execution.py", line 153, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xyz/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 "xyz/ComfyUI/execution.py", line 76, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xyz/ComfyUI/custom_nodes/comfyui-prompt-reader-node/nodes.py", line 603, in generate_parameter
checkpoint = comfy.sd.load_checkpoint_guess_config(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xyz/ComfyUI/comfy/sd.py", line 431, in load_checkpoint_guess_config
model_config = model_detection.model_config_from_unet(sd, "model.diffusion_model.", unet_dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xyz/ComfyUI/comfy/model_detection.py", line 141, in model_config_from_unet
unet_config = detect_unet_config(state_dict, unet_key_prefix, dtype)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "xyz/ComfyUI/comfy/model_detection.py", line 49, in detect_unet_config
model_channels = state_dict['{}input_blocks.0.0.weight'.format(key_prefix)].shape[0]

From what I read, LCM is fully compatible with Apple MPS, I wonder if it's an issue with the node itself.

Reproduction steps

No response

Image file

No response

Version

1.0.0

[BUG] - Model output impairs LoRA application

Description

First: it took me countless hours over an entire week to pinpoint this behavior. Yet, I am not sure this is a bug. It might be that I don't understand well enough the intricacies of ComfyUI. With that in mind, here's the problem:

When the Model output of an SD Parameter Generator node is passed to an Efficient KSampler node, whatever LoRA has been defined in a Efficient Loader node gets ignored.

Reproduction steps

Recreate the following situation:

Screenshot 2023-12-03 at 09 12 14

As you can see in this example, the Cartoon_SDXL_V2 LoRA is completely ignored by the Efficient KSampler node if I use the Model output generated by the SD Parameter Generator node.

However, if I use the Model output coming straight from an Efficient Loader node, the LoRA is correctly applied:

Screenshot 2023-12-03 at 09 13 27

In both cases, notice this is an img2img workflow simply VAE Encoding a source image.

If this is not a bug, but the expected behaviour, it makes impossible for me to use this portion of the SD Parameter Generator node in the AP Workflow, so I really hope it's a bug.

Thank you!

Image file

Output when the Model comes from SD Parameter Generator:

Efficient_LoRA_Test_00007_

Output when the Model comes from Efficient Loader:

Efficient_LoRA_Test_00008_

[BUG] - Older A1111 png cause error in SD Prompt Reader comfyui node

Description

Example image: https://pasteboard.co/FfcxUpdd5JTB.png

Image settings: "Steps: 40, Sampler: DDIM, CFG scale: 7, Seed: 610501910, Size: 768x768, Model hash: 2c02b20a"

The model parameter is missing which I think is the cause of the issue.

Error from console:

ERROR:root:!!! Exception during processing !!!
ERROR:root:Traceback (most recent call last):
File "/mnt/nvme2tb/github/ComfyUI/execution.py", line 154, in recursive_execute
output_data, output_ui = get_output_data(obj, input_data_all)
File "/mnt/nvme2tb/github/ComfyUI/execution.py", line 84, in get_output_data
return_values = map_node_over_list(obj, input_data_all, obj.FUNCTION, allow_interrupt=True)
File "/mnt/nvme2tb/github/ComfyUI/execution.py", line 77, in map_node_over_list
results.append(getattr(obj, func)(**slice_dict(input_data_all, i)))
File "/mnt/nvme2tb/github/ComfyUI/custom_nodes/comfyui-prompt-reader-node/nodes.py", line 173, in load_image
self.param_parser(image_data.parameter.get("model"), parameter_index)
File "/mnt/nvme2tb/github/ComfyUI/custom_nodes/comfyui-prompt-reader-node/nodes.py", line 207, in param_parser
data_list = data.strip("()").split(",")
AttributeError: 'NoneType' object has no attribute 'strip'

Reproduction steps

  1. SD Prompt Reader node
  2. Add the example image to the SD Prompt Reader node
  3. Press ctrl+enter

Image file

No response

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

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

[BUG] - More precise REFINER_START

Summary

In SD Parameter Generator, the refiner_start parameter always rounds to the tens.

Basic Example

0.3 = 30%
0.2 = 20%
0.25 = 30%

If a want to generate with 100 total steps, and start the refiner at 25, right now it's not possible (it rounds to 30).

Reference Issues.

No response

[FEATURE REQUEST] - Extractor for most additional options and new nodes

Summary

Extractor for most additional options and new nodes:
Name String: Sampler
Name String: VAE
Int: Clip skip
Boolean: Pad conds

Basic Example

I would like to thank you for your work, and I have a few suggestions for additions.
Extractor for Additional Options:

  • Name String: Sampler
    • Example from the prompt reader: "Sampler: DPM++ 2M SDE Heun Karras"
    • In this case: "DPM++ 2M SDE Heun Karras"
  • Name String: VAE
    • Example from the prompt reader: "VAE: kl-f8-anime2.ckpt"
    • In this case: "kl-f8-anime2.ckpt"
  • Int: Clip skip
    • Example from the prompt reader: "Clip skip: 2"
    • In this case: "2" (If this option isn't in the prompt reader, return "1")
  • Boolean: Pad conds
    • Example from the prompt reader: "Pad conds: True"
    • In this case: "True" (If this option isn't in the prompt reader, return "False")

Of course, the names of VAEs and models can sometimes be unhelpful if they are, for example, in folders. Therefore, I would suggest creating a new node that searches the folders with the given name and, if found, automatically returns the entire path to that model, for example, "Anime/anime_v10.safetensor" and pass to Checkpoint Selector.
Similarly, for the names of samplers, there should be an additional node that extracts the sampler_name from the string and pass to Sampler Selector as well as the scheduler and pass to Scheduler Selector.

If you think that dealing with names and their additional node converters would be too much work, I would mainly request the output for Clip skip and Pad conds.

Reference Issues.

No response

[FEATURE REQUEST] - Image input pipeline

Summary

Image input pipeline to allow reading and analysis of an image created in the same workflow. Same with the parameter generator.
SDpromptsuggestion

Basic Example

Create image with metadata > parse metadata > perform other tasks

Reference Issues.

No response

[BUG] - Image not analyzed after load

Description

I updated all custom nodes and installed SD-Prompt Reader Node and then restarted ComfyUI.
I cleared the workspace and added the SD Prompt Reader Node and then selected a jpeg file dowloaded from Civitai. Loading that file in the stand alone app or on the ComfyUI workspace shows the prompts and metadata of the image.
However, uploading it into the SD Prompt Reader Node, displays the image at the bottom of the node, but doesn't fill the prompt boxes nor does it activate any of the outputs.

Reproduction steps

  • Click the Clear button in the ComfyUI menu
  • Add a SD Prompt Reader Node on the workspace
  • Click the upload field in the node
  • Select an image file
  • The image is displayed at the bottom of the node but nothing else happens: no prompt added to the prompt boxes, no output made active. This happens with files that show information when loaded into the stand-alone SD Prompt Reader app

Image file

workflow

Version

1.0.0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.