From 75116958a2ae28b2d546d4dc2edaffa0da3455a0 Mon Sep 17 00:00:00 2001 From: Searge Date: Wed, 28 Aug 2024 15:36:04 +0200 Subject: [PATCH] Minor cleanup in the code and added a FAQ section to the readme file --- README.md | 12 +++++++++++- Searge_LLM_Node.py | 19 ++++++++++--------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 83ca16a..44b6fb1 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Searge-LLM for ComfyUI v1.0 +# Searge-LLM for ComfyUI A prompt-generator or prompt-improvement node for ComfyUI, utilizing the power of a language model to turn a provided text-to-image prompt into a more detailed and improved prompt. @@ -31,6 +31,16 @@ python -m pip install https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheel python -m pip install https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/textgen-webui/llama_cpp_python_cuda-0.2.89+cu121-cp311-cp311-win_amd64.whl ``` +### FAQ +- "I still get errors related to llama-cpp, what should I do?" + - You can try manually installing llama-cpp in the python environment that you use to run ComfyUI. To do that first + uninstall any package including the name llama cpp from your python environment. After that you can install the + llama-cpp package with the command `python -m pip install llama-cpp-python`. If the problem persist after these + steps, please report it in the Github issue tracker of this project. +- "Can you add [FEATURE] to this node?" + - Maybe. Maybe not. You can always post your idea in the issue tracker on Github as a feature request and if I like + the idea and find the time for it, I may implement it in a future update. + ## Searge LLM Node Configure the `Searge_LLM_Node` with the necessary parameters within your ComfyUI project to utilize its capabilities fully: diff --git a/Searge_LLM_Node.py b/Searge_LLM_Node.py index 915b844..f7fa0dd 100644 --- a/Searge_LLM_Node.py +++ b/Searge_LLM_Node.py @@ -47,7 +47,7 @@ class Searge_LLM_Node: } } - CATEGORY = "Searge-LLM" + CATEGORY = "Searge/LLM" FUNCTION = "main" RETURN_TYPES = ("STRING", "STRING",) RETURN_NAMES = ("generated", "original",) @@ -189,13 +189,14 @@ class Searge_Output_Node: } } - CATEGORY = "Searge-LLM" + CATEGORY = "Searge/LLM" FUNCTION = "main" RETURN_TYPES = () + RETURN_NAMES = () OUTPUT_NODE = True def main(self, text): - return {"ui": {"text": (text,)}} + return {"ui": {"text": (str(text),)}} class Searge_AdvOptionsNode: @@ -203,14 +204,14 @@ class Searge_AdvOptionsNode: def INPUT_TYPES(cls): return { "required": { - "temperature": ("FLOAT", {"default": 1.0, "min": 0.1, "step": 0.1}), - "top_p": ("FLOAT", {"default": 0.9, "min": 0.1, "step": 0.1}), + "temperature": ("FLOAT", {"default": 1.0, "min": 0.1, "step": 0.05}), + "top_p": ("FLOAT", {"default": 0.9, "min": 0.1, "step": 0.05}), "top_k": ("INT", {"default": 50, "min": 0}), - "repetition_penalty": ("FLOAT", {"default": 1.2, "min": 0.1, "step": 0.1}), + "repetition_penalty": ("FLOAT", {"default": 1.2, "min": 0.1, "step": 0.05}), } } - CATEGORY = "Searge-LLM" + CATEGORY = "Searge/LLM" FUNCTION = "main" RETURN_TYPES = ("SRGADVOPTIONSCONFIG",) RETURN_NAMES = ("adv_options_config",) @@ -228,12 +229,12 @@ class Searge_AdvOptionsNode: NODE_CLASS_MAPPINGS = { "Searge_LLM_Node": Searge_LLM_Node, - "Searge_Output_Node": Searge_Output_Node, "Searge_AdvOptionsNode": Searge_AdvOptionsNode, + "Searge_Output_Node": Searge_Output_Node, } NODE_DISPLAY_NAME_MAPPINGS = { "Searge_LLM_Node": "Searge LLM Node", - "Searge_Output_Node": "Searge Output Node", "Searge_AdvOptionsNode": "Searge Advanced Options Node", + "Searge_Output_Node": "Searge Output Node", }