Kosinkadink / ComfyUI-VideoHelperSuite

Nodes related to video workflows
GNU General Public License v3.0
513 stars 90 forks source link

When converting video path to input on VHS_LoadVideoPath error: Prompt outputs failed validation #104

Closed RenderRift closed 8 months ago

RenderRift commented 8 months ago

When I try to convert the video path to an input on the VHS_LoadVideoPath node I get the following error:

ERROR:root:Failed to validate prompt for output 15: ERROR:root:* VHS_LoadVideoPath 13: ERROR:root: - Exception when validating inner node: 'NoneType' object has no attribute 'split' ERROR:root:Output will be ignored invalid prompt: {'type': 'prompt_outputs_failed_validation', 'message': 'Prompt outputs failed validation', 'details': '', 'extra_info': {}}

Any help would be appreciated.

Attached a simple workflow to demonstrate example (1).json

AustinMroz commented 8 months ago

Thanks for the report and demonstration workflow. I have a reproduction and will start digging into the code. First impression is that simple string seems to leaves the widget value unchanged. Both it and the built-in primitive string can be use to set a the filename of a video combine with converted filename_prefix, but after executing and converting the filename_prefix back a widget, the primitive string will have set the widget value and simple string has not.

AustinMroz commented 8 months ago

I believe I've got the issue identified. Type validation is less strict when an input comes from clientside js code, but is strictly enforced when it comes from python code. Thus, correct conversion to an input requires that the type initially be a STRING. Unfortunately, having custom draw and onclick events for the widget itself requires that the widget have a custom type after loading on the js side. This should still be doable, but will be a bit more than a one line fix.

EDIT: Additionally, IS_CHANGED and VALIDATE_INPUTS can not contain information on a file path before workflow execution if that information is generated during execution by a node with python code, so a full solution seems to require these methods be updated to trust a None input and validation likely needs to be done again in the actual node execution.