mirror of
https://git.datalinker.icu/kijai/ComfyUI-KJNodes.git
synced 2025-12-09 04:44:30 +08:00
Update nodes.py
This commit is contained in:
parent
01a770df51
commit
85724229f4
7
nodes.py
7
nodes.py
@ -4777,6 +4777,7 @@ class MaskOrImageToWeight:
|
||||
[
|
||||
'list',
|
||||
'list of lists',
|
||||
'pandas series',
|
||||
],
|
||||
{
|
||||
"default": 'list'
|
||||
@ -4813,6 +4814,12 @@ and returns it as a float value.
|
||||
return mean_values,
|
||||
elif output_type == 'list of lists':
|
||||
return [[value] for value in mean_values],
|
||||
elif output_type == 'pandas series':
|
||||
try:
|
||||
import pandas as pd
|
||||
except:
|
||||
raise Exception("MaskOrImageToWeight: pandas is not installed. Please install pandas to use this output_type")
|
||||
return pd.Series(mean_values),
|
||||
else:
|
||||
raise ValueError(f"Unsupported output_type: {output_type}")
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user