3 Commits
4 changed files with 37 additions and 24 deletions
+1
View File
@@ -158,3 +158,4 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
/pip/cache/
+11 -1
View File
@@ -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:
+24 -11
View File
@@ -47,7 +47,7 @@ class Searge_LLM_Node:
}
}
CATEGORY = "Searge-LLM"
CATEGORY = "Searge/LLM"
FUNCTION = "main"
RETURN_TYPES = ("STRING", "STRING",)
RETURN_NAMES = ("generated", "original",)
@@ -186,16 +186,29 @@ class Searge_Output_Node:
return {
"required": {
"text": (anytype, {}),
}
},
"hidden": {
"unique_id": "UNIQUE_ID", "extra_pnginfo": "EXTRA_PNGINFO",
},
}
CATEGORY = "Searge-LLM"
CATEGORY = "Searge/LLM"
FUNCTION = "main"
RETURN_TYPES = ()
RETURN_NAMES = ()
OUTPUT_NODE = True
def main(self, text):
return {"ui": {"text": (text,)}}
def main(self, text, unique_id=None, extra_pnginfo=None):
if unique_id is not None and extra_pnginfo is not None and len(extra_pnginfo) > 0:
workflow = None
if "workflow" in extra_pnginfo:
workflow = extra_pnginfo["workflow"]
node = None
if workflow and "nodes" in workflow:
node = next((x for x in workflow["nodes"] if str(x["id"]) == unique_id), None)
if node:
node["widgets_values"] = [str(text)]
return {"ui": {"text": (str(text),)}}
class Searge_AdvOptionsNode:
@@ -203,14 +216,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 +241,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",
}
+1 -12
View File
@@ -1,15 +1,4 @@
transformers>=4.0.0
torch>=1.7.1
accelerate
# llama-cpp-python (CPU only, AVX2)
https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/cpu/llama_cpp_python-0.2.89+cpuavx2-cp311-cp311-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64" and python_version == "3.11"
https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/cpu/llama_cpp_python-0.2.89+cpuavx2-cp310-cp310-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64" and python_version == "3.10"
https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/cpu/llama_cpp_python-0.2.89+cpuavx2-cp311-cp311-win_amd64.whl; platform_system == "Windows" and python_version == "3.11"
https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/cpu/llama_cpp_python-0.2.89+cpuavx2-cp310-cp310-win_amd64.whl; platform_system == "Windows" and python_version == "3.10"
# llama-cpp-python (CUDA, no tensor cores)
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; platform_system == "Windows" and python_version == "3.11"
https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/textgen-webui/llama_cpp_python_cuda-0.2.89+cu121-cp310-cp310-win_amd64.whl; platform_system == "Windows" and python_version == "3.10"
https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/textgen-webui/llama_cpp_python_cuda-0.2.89+cu121-cp311-cp311-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64" and python_version == "3.11"
https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/textgen-webui/llama_cpp_python_cuda-0.2.89+cu121-cp310-cp310-linux_x86_64.whl; platform_system == "Linux" and platform_machine == "x86_64" and python_version == "3.10"
llama-cpp-python