cubiq / ComfyUI_essentials

MIT License
588 stars 72 forks source link

ImageResize+ not working after update (doesn't recognize data from "load image" node) #72

Open eXWoLL opened 2 months ago

eXWoLL commented 2 months ago

I'm getting this error:

_ImageResize+: Failed to validate prompt for output 155: Output will be ignored Failed to validate prompt for output 156: Output will be ignored invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': 'Required input is missing: image', 'extra_info': {}} got prompt Failed to validate prompt for output 157:

  • ImageResize+ 18:
    • Value not in list: method: 'False' not in ['stretch', 'keep proportion', 'fill / crop', 'pad']

Workflow: image

Seems this issue happened before with another node:

The problem seems to be the updated version of ComfyUI Essentials nodes. One of their values changed from bool to str. This affects two nodes: Back To Org Size(if Smaller) and Res Limits. The fix for the first is simple. Just select keep_proportion for the method value.

Lilien86 commented 2 months ago

hey I have the same issue

* ImageResize+ 14:
  - Value not in list: method: 'False' not in ['stretch', 'keep proportion', 'fill / crop', 'pad']
Output will be ignored
Failed to validate prompt for output 38:
Output will be ignored
Failed to validate prompt for output 12:
Output will be ignored
Failed to validate prompt for output 18:
Output will be ignored
invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}
bloollc commented 2 months ago

hello all I have faced this same issue with trying to make this YouTubers workflow work SUPIR Definitive Tutorial for Creative Upscaling SUPIR v2 - Plug&Play Edition

On one machine it was working fine (the false value) and that machine had python --version >> Python 3.12.4

On another machine it was not working fine (the same false value in the model I downloaded) and that machine had python --version >> Python 3.10.12

The exception I was seeing was "startsWith" does not exist for the false value.

Reading the line https://github.com/cubiq/ComfyUI_essentials/blob/3777c5d1ce1f23558ddbcf914ec36a1679a8610d/image.py#L420 I think the false value was reaching

        else:
            width = width if width > 0 else ow
            height = height if height > 0 else oh

so there seems to be a case where an empty string or "false" value string still gets interpreted outside the values in the validation ['stretch', 'keep proportion', 'fill / crop', 'pad'])

So instead of updating my python version I just adjusted https://github.com/cubiq/ComfyUI_essentials/blob/3777c5d1ce1f23558ddbcf914ec36a1679a8610d/image.py#L353

to add an empty string as a valid method value to select

And then went into the interface and selected the empty string (it looked super short in the dropdown, but it was selectable) and then I was able to move on with the workflow and used the test image of the car and it was upscaled. SUPIR!

cubiq commented 2 months ago

I think all you have to do is to delete the node and recreate it. It will work then