thedyze / save-image-extended-comfyui

Extended Save node for ComfyUI
66 stars 6 forks source link

Error: "float" object has no attribute "endswitch" #11

Open TimyTom opened 7 months ago

TimyTom commented 7 months ago

I'm getting this error. Can you please help? Képernyőkép 2023-12-12 015624 Képernyőkép 2023-12-12 015638

And I have one more question: I'm testing several samplers with an XY node. How can I save the actually used sampler into the filename? The label "sampler_name" won't work, 'cause Ksampler is always showing the same sampler_name, even though the XY node is changing the sampler it uses. I think I would have to get the used sampler_name out of the XY node, but I don't know how.

Képernyőkép 2023-12-12 023511

thedyze commented 7 months ago

Hi, it seems to be related to a lora, are you using a lora that is not a safetensors file? Or have some custom setup using loras. I'll need more information about your workspace to be able to debug this. Regarding your second question, it's currently not supported. Might be able to add support for this.

TimyTom commented 7 months ago

Thank you so much for your prompt reply :) Atm I'm just testing samplers, so not using anything extra. No Lora, no controller...nothing. Screenshot of workflow:

Képernyőkép 2023-12-12 090443

thedyze commented 7 months ago

If you remove 'models' from save_job_data, does it work then?

TimyTom commented 7 months ago

If you remove 'models' from save_job_data, does it work then?

yes 👍👍

thedyze commented 7 months ago

Ok hmm.. must be something with the nodes in your workspace. Could you post an image generated with that setup (excluding 'models' ofc), with save_metadata on? That way i might be able to debug the error. Can't promise I'll fix it insta tho.

TimyTom commented 7 months ago

Sure thing. Probably I'm not the only one having this prob. Btw.: saving XY plot settings would be a huge benefit. I presume many ppl are doing testing before going into content creation.

Alina_30_5.0_002.json Alina_30_5 0_002

cjps-br commented 7 months ago

I also have this error. I looked at the node code and thought that this error might be occurring due to this line of code:

function: find_parameter_values line 119 and 120: if re.match(r'lora(name)?(\d+)?', key): if value.endswith('.safetensors'):

In this line, if there is a parameter in the prompt such as: lora1_model_strength, or lora1_clip_strength, the error will occur because only parameters like lora1_name should be evaluated to see if the end of the value ends with "safetensors".

Maybe if the regular expression evaluation on line 119 was changed to if re.match(r'lora(name)(\d+)?', key):

the error did not occur. I temporarily modified the line to test and it worked without any problems.

cjps-br commented 7 months ago

I also have this error. I looked at the node code and thought that this error might be occurring due to this line of code:

function: find_parameter_values line 119 and 120: if re.match(r'lora(name)(\d+)?', key): if value.endswith('.safetensors'):

In this line, if there is a parameter in the prompt such as: lora1_model_strength, or lora1_clip_strength, the error will occur because only parameters like lora1_name should be evaluated to see if the end of the value ends with "safetensors".

Maybe if the regular expression evaluation on line 119 was changed to if re.match(r'lora(name)(\d+)?', key):

the error did not occur. I temporarily modified the line to test and it worked without any problems.

It is important to note that some nodes, such as the TinyTerraNodes pipe Loader (https://github.com/tinyterra/ComfyUI_tinyterraNodes), place parameters such as lora1_model_strength and lora1_clip_strength at the prompt, even if no lora is being used.

thedyze commented 6 months ago

I also have this error. I looked at the node code and thought that this error might be occurring due to this line of code:

function: find_parameter_values line 119 and 120: if re.match(r'lora(name)?(\d+)?', key): if value.endswith('.safetensors'):

In this line, if there is a parameter in the prompt such as: lora1_model_strength, or lora1_clip_strength, the error will occur because only parameters like lora1_name should be evaluated to see if the end of the value ends with "safetensors".

Maybe if the regular expression evaluation on line 119 was changed to if re.match(r'lora(name)(\d+)?', key):

the error did not occur. I temporarily modified the line to test and it worked without any problems.

Sorry for not getting back earlier ..will look into this. Regarding your last comment, I now understand that keeping this node compatible with all other custom nodes is a close to impossible task. :)

audioscavenger commented 2 months ago

i think that it is fixed here: the value.endwith() was placed before the isinstance(value, str) in the recursive method. noobs mistake, fixed.