This is a set of nodes to interact with llama-cpp-python
Llama for ComfyUI is a tool that allows you to run language learning models (LLMs) within ComfyUI. Sort of a glue to take a cool AI tool from one place and let us use it somewhere else.
Currently let's you easily load GGUF models in a consistent fashion with other ComfyUI models and can use them to generate strings of output text with seemingly correct seeding and temperature.
Works well with ComfyUI-Custom-Scripts and using the ShowText Node to get output from the LLM.
./ComfyUI/custom_nodes/ComfyUI-Llama/models/*
custom_nodes
folder../ComfyUI/custom_nodes/ComfyUI-Llama/models/*
Either post an issue on github, or ask on Element in Comfy's channel
Download GGUF language learning models, which can be found on HuggingFace. You will need at least 1. Different models produce different results.
Place models in ComfyUI/custom_nodes/ComfyUI-Llama/models
. They can be renamed if you want.
Fire up/Restart ComfyUI and allow it to finish restarting.
Hit Ctrl+F5 to ensure the browser is refreshed.
Check your ComfyUI available nodes and find the LLM menu.
Load LLM Model Basic
This is a simplified call of this: llama-cpp-python's init method
This is a simplified call of this:
llama-cpp-python's call method
Either post an issue on github, or ask on Element in Comfy's channel
Example 1 shows the two most basic nodes in their simplest setup. The call node will output the results as a string. You would have to use a custom node to show text. If you don't have one, I would suggest using ComfyUI-Custom-Script's ShowText node.
Example 2 shows a slightly more advanced configuration that suggests changes to human written python code. This is just one of several workflow tools that I have at my disposal.
See the documentation for llama-cpp-python on that interface
Load Model Advanced's kwargs, and chathandler are disabled
Call Advanced's stream, logprobs, stop, stopping_criteria, logits_processor, logits_bias, grammar are disabled
Create Completion's stream, logprobs, stop, stopping_criteria, logits_processor, logits_bias, grammar are disabled
Create Embedding method is disabled
Generate is disabled
Create Chat Completion is disabled
Llava has not been implemented yet
No known way to loopback output from an LLM model repeatedly.
This may be resolved by using ComfyUI-Custom-Scripts and using the Repeater Node, but it's as of yet a WIP.
Haven't widely tested strange abuses of inputs.
Error handling and logging is still not mature.
We appreciate your interest in Llama for ComfyUI. Feel free to explore and provide feedback or report any issues you encounter. Your contributions and suggestions are valuable to the project.