1
- import json
2
-
3
- class AlwaysEqualProxy :
4
- def __init__ (self , value ):
5
- self .value = value
6
-
7
- def __eq__ (self , text ):
8
- return True
9
-
10
1
class IFDisplayOmni :
11
2
@classmethod
12
3
def INPUT_TYPES (s ):
@@ -21,7 +12,7 @@ def INPUT_TYPES(s):
21
12
INPUT_IS_LIST = True
22
13
OUTPUT_NODE = True
23
14
FUNCTION = "display_omni"
24
- CATEGORY = "ImpactFrames💥🎞️"
15
+ CATEGORY = "ImpactFrames💥🎞️/IF_tools "
25
16
26
17
def display_omni (self , unique_id = None , extra_pnginfo = None , ** kwargs ):
27
18
values = []
@@ -31,21 +22,33 @@ def display_omni(self, unique_id=None, extra_pnginfo=None, **kwargs):
31
22
if "omni_input" in kwargs :
32
23
for val in kwargs ['omni_input' ]:
33
24
try :
34
- if isinstance (val , str ):
35
- values .append (val )
36
- text_output = val
25
+ if isinstance (val , dict ) and "conditionings" in val :
26
+ # Handle batched canvas conditionings
27
+ canvas_conditioning = val ["conditionings" ]
28
+ # The responses will come from IF_DisplayText
29
+ text_output = val .get ("error" , "" )
30
+ values .append (text_output )
31
+
37
32
elif isinstance (val , list ) and all (isinstance (item , dict ) for item in val ):
38
- # This is likely the canvas conditioning
33
+ # Direct canvas conditioning list
39
34
canvas_conditioning = val
40
- values .append (json .dumps (val ))
35
+ values .append (str (val ))
36
+
37
+ elif isinstance (val , str ):
38
+ values .append (val )
39
+ text_output = val
40
+
41
41
else :
42
42
json_val = json .dumps (val )
43
43
values .append (str (json_val ))
44
44
text_output = str (json_val )
45
- except Exception :
45
+
46
+ except Exception as e :
47
+ print (f"Error processing omni input: { str (e )} " )
46
48
values .append (str (val ))
47
49
text_output = str (val )
48
50
51
+ # Update workflow info if available
49
52
if unique_id is not None and extra_pnginfo is not None :
50
53
if isinstance (extra_pnginfo , list ) and len (extra_pnginfo ) > 0 :
51
54
extra_pnginfo = extra_pnginfo [0 ]
@@ -55,10 +58,6 @@ def display_omni(self, unique_id=None, extra_pnginfo=None, **kwargs):
55
58
node = next ((x for x in workflow ["nodes" ] if str (x ["id" ]) == unique_id ), None )
56
59
if node :
57
60
node ["widgets_values" ] = [values ]
58
- else :
59
- print ("Error: extra_pnginfo is not in the expected format" )
60
- else :
61
- print ("Error: unique_id or extra_pnginfo is None" )
62
61
63
62
return {
64
63
"ui" : {"text" : values },
0 commit comments