ComfyUI_Searge_LLM
Custom nodes for ComfyUI that utilize a language model to generate text-to-image prompts
Package profile
- Status
- Verified
- Publisher
- @SeargeDP
- Source
- GitHub
- Stars
- 166
README
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.
Custom node Searge-LLM for ComfyUI
Install the language model
- Create a new folder called
llm_ggufin theComfyUI/modelsdirectory. - Download the file
Mistral-7B-Instruct-v0.3.Q4_K_M.gguf(4.37 GB). from the repositoryMaziyarPanahi/Mistral-7B-Instruct-v0.3-GGUFon HuggingFace. - place
Mistral-7B-Instruct-v0.3.Q4_K_M.ggufin theComfyUI/models/llm_ggufdirectory.
Note
- Currently the node requires the language model as a
gguffile and only works with models that are supported byllama-cpp-python.
Potential problems
(this was only tested this on Windows)
If you get error message about missing llama-cpp, try these manual steps:
- These instruction are assuming that you use the portable version of ComfyUI, otherwise make sure to run these commands in the pything v-env that you're using for ComfyUI.
- Open a command line interface in the directory
ComfyUI_windows_portable/python_embeded. - It's important to run these commands in the
ComfyUI_windows_portable/python_embededdirectory. - Run the following commands:
python -m pip install https://github.com/oobabooga/llama-cpp-python-cuBLAS-wheels/releases/download/cpu/llama_cpp_python-0.2.89+cpuavx2-cp311-cp311-win_amd64.whl
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.
- 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
- "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:
text: The input text for the language model to process.model: The directory name of the model withinmodels/llm_ggufyou wish to use.max_tokens: Maximum number of tokens for the generated text, adjustable according to your needs.apply_instructions:instructions: The instructions for the language model to generate a prompt. It supports the placeholder{prompt}to insert the prompt from thetextinput. Example:Generate a prompt from "{prompt}"
Advanced Options Node
The Searge_AdvOptionsNode offers a range of configurable parameters allowing for precise control over the text
generation process and model behavior.
The default values on this node are also the defaults that Searge_LLM_Node
uses when no Searge_AdvOptionsNode is connected to it.
Below is a detailed overview of these parameters:
- Temperature (
temperature): Controls the randomness in the text generation process. Lower values make the model more confident in its predictions, leading to less variability in output. Higher values increase diversity but can also introduce more randomness. Default:1.0. - Top-p (
top_p): Also known as nucleus sampling, this parameter controls the cumulative probability distribution cutoff. The model wi
Nodes in this pack
3 nodes
Nodes in this pack
3 nodes- Searge_AdvOptionsNode
- Searge_LLM_Node
- Searge_Output_Node
Related resources
5 connections
Related resources
5 connectionsSources
3 sources
Sources
3 sourcesVerified Oct 4
Verified Oct 4
Source excerpts
1 excerpt
Source excerpts
1 excerptSource context: Repo SeargeDP/ComfyUI_Searge_LLM
