Skip to content

Commit 531e31b

Browse files
authored
Add files via upload
fixed a bunch of errors
1 parent 267379d commit 531e31b

30 files changed

+5487
-3158
lines changed

IFChatPromptNode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1146,6 +1146,6 @@ def get_api_key_with_fallback(provider, external_api_key):
11461146
)
11471147
FUNCTION = "process_chat_wrapper"
11481148
OUTPUT_NODE = True
1149-
CATEGORY = "ImpactFrames💥🎞️"
1149+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
11501150
DESCRIPTION = "ComfyUI, Support API and Local LLM providers and RAG capabilities. Processes text prompts, handles image inputs, and integrates with different language models and indexing strategies."
11511151

IFDisplayOmniNode.py

+19-20
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
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-
101
class IFDisplayOmni:
112
@classmethod
123
def INPUT_TYPES(s):
@@ -21,7 +12,7 @@ def INPUT_TYPES(s):
2112
INPUT_IS_LIST = True
2213
OUTPUT_NODE = True
2314
FUNCTION = "display_omni"
24-
CATEGORY = "ImpactFrames💥🎞️"
15+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
2516

2617
def display_omni(self, unique_id=None, extra_pnginfo=None, **kwargs):
2718
values = []
@@ -31,21 +22,33 @@ def display_omni(self, unique_id=None, extra_pnginfo=None, **kwargs):
3122
if "omni_input" in kwargs:
3223
for val in kwargs['omni_input']:
3324
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+
3732
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
3934
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+
4141
else:
4242
json_val = json.dumps(val)
4343
values.append(str(json_val))
4444
text_output = str(json_val)
45-
except Exception:
45+
46+
except Exception as e:
47+
print(f"Error processing omni input: {str(e)}")
4648
values.append(str(val))
4749
text_output = str(val)
4850

51+
# Update workflow info if available
4952
if unique_id is not None and extra_pnginfo is not None:
5053
if isinstance(extra_pnginfo, list) and len(extra_pnginfo) > 0:
5154
extra_pnginfo = extra_pnginfo[0]
@@ -55,10 +58,6 @@ def display_omni(self, unique_id=None, extra_pnginfo=None, **kwargs):
5558
node = next((x for x in workflow["nodes"] if str(x["id"]) == unique_id), None)
5659
if node:
5760
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")
6261

6362
return {
6463
"ui": {"text": values},

IFDisplayTextNode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def INPUT_TYPES(cls):
3030
OUTPUT_IS_LIST = (False, True, False, False)
3131
FUNCTION = "display_text"
3232
OUTPUT_NODE = True
33-
CATEGORY = "ImpactFrames💥🎞️"
33+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
3434

3535
def display_text(self, text: Optional[str], select):
3636
if text is None:

IFDisplayTextWildcardNode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def INPUT_TYPES(cls):
6969
OUTPUT_IS_LIST = (False, True, False, False)
7070
FUNCTION = "display_text"
7171
OUTPUT_NODE = True
72-
CATEGORY = "ImpactFrames💥🎞️"
72+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
7373

7474
def load_wildcards(self):
7575
"""Load wildcards from YAML/JSON files in the specified directory"""

IFImagePromptNode.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
validate_models,
2222
save_combo_settings,
2323
load_combo_settings,
24-
create_settings_from_ui_IFImagePromptNode
24+
create_settings_from_ui
2525
)
2626
import base64
2727
import numpy as np
@@ -77,7 +77,7 @@ async def save_combo_settings_endpoint(request):
7777
data = await request.json()
7878

7979
# Convert UI settings to proper format
80-
settings = create_settings_from_ui_IFImagePromptNode(data)
80+
settings = create_settings_from_ui(data)
8181

8282
# Get node instance
8383
node = IFImagePrompt()
@@ -194,7 +194,7 @@ def INPUT_TYPES(cls):
194194

195195
FUNCTION = "process_image_wrapper"
196196
OUTPUT_NODE = True
197-
CATEGORY = "ImpactFrames💥🎞️"
197+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
198198

199199
@classmethod
200200
def IS_CHANGED(cls, **kwargs):

IFJoinTextNode.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def INPUT_TYPES(cls):
3939

4040
RETURN_TYPES = ("STRING",)
4141
FUNCTION = "join_text"
42-
CATEGORY = "ImpactFrames💥🎞️"
42+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
4343

4444
def join_text(self, separator=" ", text1="", text2="", text3="", text4=""):
4545
# Collect all non-empty text inputs
@@ -61,5 +61,5 @@ def join_text(self, separator=" ", text1="", text2="", text3="", text4=""):
6161
}
6262

6363
NODE_DISPLAY_NAME_MAPPINGS = {
64-
"IF_JoinText": "IF Join Text 📝"
64+
"IF_JoinText": "IF Join Text📝"
6565
}

IFPromptMkrNode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def INPUT_TYPES(cls):
160160

161161
FUNCTION = "process_image_wrapper"
162162
OUTPUT_NODE = True
163-
CATEGORY = "ImpactFrames💥🎞️"
163+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
164164

165165
def get_models(self, engine, base_ip, port, api_key=None):
166166
return get_models(engine, base_ip, port, api_key)

IFSaveTextNode.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def INPUT_TYPES(cls):
2929
RETURN_NAMES = ("Question", "Response", "Negative", "Turn",)
3030
FUNCTION = "process_text"
3131
OUTPUT_NODE = True
32-
CATEGORY = "ImpactFrames💥🎞️"
32+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
3333

3434
def process_text(self, question_input, negative_input, response_input, save_file=False, file_format="txt", save_mode="create"):
3535
turn_id = str(uuid.uuid4())
@@ -78,5 +78,5 @@ def IS_CHANGED(cls, turn_id, question_input, negative_input, response_input, tur
7878
turn = f"ID: {turn_id}\nQuestion: {question_input}\nResponse: {response_input}\nNegative: {negative_input}"
7979
return {"ui": {"string": [turn]}, "result": (turn,)}"""
8080

81-
NODE_CLASS_MAPPINGS = {"IF_saveText": IFSaveText}
82-
NODE_DISPLAY_NAME_MAPPINGS = {"IF_saveText": "IF Save Text📝"}
81+
NODE_CLASS_MAPPINGS = {"IF_SaveText": IFSaveText}
82+
NODE_DISPLAY_NAME_MAPPINGS = {"IF_SaveText": "IF Save Text📝"}

IFStepCounterNode.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def IS_CHANGED(cls, **kwargs):
2929
RETURN_NAMES = ("number", "float", "int", "string")
3030
FUNCTION = "increment_number"
3131

32-
CATEGORY = "ImpactFrames💥🎞️"
32+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
3333

3434
def increment_number(self, number_type, mode, start, stop, step, unique_id, reset_bool=0):
3535
# Initialize counter
@@ -67,4 +67,4 @@ def increment_number(self, number_type, mode, start, stop, step, unique_id, rese
6767
return (result, float(counter), int(counter), string_result)
6868

6969
NODE_CLASS_MAPPINGS = {"IF_StepCounter": IFCounter}
70-
NODE_DISPLAY_NAME_MAPPINGS = {"IF_StepCounter": "IF Step Counter 🔢"}
70+
NODE_DISPLAY_NAME_MAPPINGS = {"IF_StepCounter": "IF Step Counter🔢"}

IFTextTyperNode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def INPUT_TYPES(s):
1010
RETURN_TYPES = ("STRING",)
1111
FUNCTION = "output_text"
1212
OUTPUT_NODE = True
13-
CATEGORY = "ImpactFrames💥🎞️"
13+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
1414

1515
def output_text(self, text):
1616
return (text,)

IFVisualizeGraphNode.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def INPUT_TYPES(cls):
1616

1717
RETURN_TYPES = ()
1818
FUNCTION = "visualize_graph"
19-
CATEGORY = "ImpactFrames💥🎞️"
19+
CATEGORY = "ImpactFrames💥🎞️/IF_tools"
2020
OUTPUT_NODE = True
2121

2222
def visualize_graph(self, graph_data, layout="spring"):
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
aspect_ratio: '1:1'
2+
attention: sdpa
3+
auto_combo: false
4+
base_ip: localhost
5+
batch_count: 2
6+
clear_history: false
7+
external_api_key: ''
8+
history_steps: 10
9+
keep_alive: false
10+
llm_model: gpt-4o-mini
11+
llm_provider: openai
12+
max_tokens: 2112
13+
port: '11434'
14+
precision: fp16
15+
prime_directives: Analyze images and generate single-line prompts focusing on the
16+
most visually striking elements. Weight elements by visual impact and arrange in
17+
descending order of importance.
18+
profile: IF_AutoCombo
19+
random: false
20+
repeat_penalty: 1.2
21+
seed: 171
22+
stop_string: null
23+
strategy: normal
24+
temperature: 0.7
25+
top_k: 40
26+
top_p: 0.9
27+
user_prompt: ''

0 commit comments

Comments
 (0)