Skip to content

Commit 5ab5975

Browse files
authored
Add files via upload
1 parent f373f60 commit 5ab5975

12 files changed

+429
-267
lines changed

IFChatPromptNode.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,9 @@ async def process_chat(
777777
else:
778778
image_tensor, default_mask_tensor = process_images_for_comfy(
779779
retrieved_image,
780-
self.placeholder_image_path
780+
self.placeholder_image_path,
781+
response_key=None,
782+
field_name=None
781783
)
782784
mask_tensor = default_mask_tensor
783785

IFDisplayTextWildcardNode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self):
1919
self.wildcard_lock = threading.Lock()
2020

2121
# Initialize paths
22-
self.base_path = folder_paths.base_path
22+
#self.base_path = folder_paths.base_path
2323
self.presets_dir = os.path.join(folder_paths.base_path, "custom_nodes", "ComfyUI-IF_AI_tools", "IF_AI", "presets")
2424
self.wildcards_dir = os.path.join(self.presets_dir, "wildcards")
2525

IFImagePromptNode.py

Lines changed: 219 additions & 95 deletions
Large diffs are not rendered by default.

IFStepCounterNode.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# IFStepCounterNode.py
12
class IFCounter:
23
def __init__(self):
34
self.counters = {}

IF_AI/presets/neg_prompts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"None": "",
33
"AI_Fill": "lowres, lowquality, bad,",
4-
"SD3x_q1": "deformed and malformed with worst qualities. distortions and artifacts, low quality, bad ratings ☆☆☆☆☆, 0/10 review, 0/5 review ↓",
4+
"SD3x_q1": "deformed and malformed with worst qualities. distortions and artifacts, low quality, bad ratings, 0/10 review, 0/5 review ↓",
55
"AtomeaseNoWaifus": "(3D, Adorable, Anime, CGI, Cartoon, Cartoonish, Childish, Computer Generated, Manga, Rendered)",
66
"BadChill": "ng_deepnegative_v1_75t, bad-picture-chill-75v, bad_prompt, bad anatomy",
77
"BadChill2": "bad-picture-chill-75v, ng_deepnegative_v1_75t, easynegative, verybadimagenegative_v1.3, negative_hand-neg",

IF_AI/rag/settings.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ base_ip: localhost
44
port: '11434'
55
llm_provider: openai
66
llm_model: gpt-4o-mini
7-
temperature: 1.2000000000000002
8-
max_tokens: 2048
7+
temperature: 0.0
8+
max_tokens: 2061
99
stop: null
1010
keep_alive: false
1111
top_k: 40
1212
top_p: 0.9
1313
repeat_penalty: 1.2
14-
seed: 558413258089916
15-
rag_folder_name: safiro1
16-
query_type: local
14+
seed: 197464410746652
15+
rag_folder_name: Safiro2
16+
query_type: global
1717
community_level: 2
1818
preset: Default
1919
external_llm_api_key: ''

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
ComfyUI-IF_AI_tools is a set of custom nodes to Run Local and API LLMs and LMMs, Features OCR-RAG (Bialdy), nanoGraphRAG, Supervision Object Detection, supports Ollama, LlamaCPP LMstudio, Koboldcpp, TextGen, Transformers or via APIs Anthropic, Groq, OpenAI, Google Gemini, Mistral, xAI and create your own charcters assistants (SystemPrompts) with custom presets and muchmore
66

7+
################# ATENTION ####################
78

9+
*COPY THE IF_AI FOLDER TO YOUR USER FOLDER*
10+
11+
###############################################
812
# Prerequisite Installation (Poppler)
913

1014
To ensure compatibility and functionality with all tools, you may need `poppler` for PDF-related operations. Use `scoop` to install `poppler` on Windows:

__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
current_dir = os.path.dirname(os.path.abspath(__file__))
2626
if current_dir not in sys.path:
2727
sys.path.insert(0, current_dir)
28-
#print(f"Current directory: {current_dir}")
29-
#print(f"Files in current directory: {os.listdir(current_dir)}")
28+
3029
try:
3130
from .omost import omost_function
3231
print("Successfully imported omost_function from omost.py in the current directory")

openai_api.py

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,25 @@ async def generate_image(
208208

209209
async with aiohttp.ClientSession() as session:
210210
async with session.post(api_url, headers=headers, json=payload) as response:
211-
response.raise_for_status()
211+
if response.status != 200:
212+
error_text = await response.text()
213+
logger.error(f"OpenAI generate_image error {response.status}: {error_text}")
214+
response.raise_for_status()
212215
data = await response.json()
213-
images = [item["b64_json"] for item in data.get("data", [])]
214-
return images
216+
217+
# Handle different response structures
218+
if "data" in data and isinstance(data["data"], list):
219+
images = []
220+
for item in data["data"]:
221+
if "b64_json" in item:
222+
images.append(item["b64_json"])
223+
elif "url" in item:
224+
# If response_format was changed or API returned URLs
225+
images.append(item["url"])
226+
return images
227+
else:
228+
logger.error("Unexpected response format in generate_image")
229+
raise ValueError("Unexpected response format")
215230

216231
async def edit_image(
217232
image_base64: str,

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "comfyui-if_ai_tools"
33
description = "Run Local and API LLMs, Features OCR-RAG (Bialdy), nanoGraphRAG, Supervision Object Detection, Conditioning manipulation via Omost, supports Ollama, LlamaCPP LMstudio, Koboldcpp, TextGen, Transformers or via APIs Anthropic, Groq, OpenAI, Google Gemini, Mistral, xAI and create your own charcters assistants (SystemPrompts) with custom presets and muchmore"
4-
version = "1.0.7"
4+
version = "1.0.6"
55
license = { file = "LICENSE.txt" }
66
dependencies = ["anthropic",
77
"groq",

0 commit comments

Comments
 (0)