4.5 KiB
ComfyUI-BasicOllama LLM Coded
A simplified node for ComfyUI that provides access to local Ollama models. This node allows you to send prompts and images to your local Ollama instance and receive text-based responses.
This project is a stripped-down version of the original Ollama node from ComfyUI-OllamaGemini by @al-swaiti. All credit for the original implementation goes to them.
🚀 Features
- Direct Ollama Integration: Seamlessly connect to your local Ollama instance.
- Text and Image Support: Send both text prompts and images to multimodal Ollama models.
- Multiple Image Inputs: Input up to five images for analysis.
- Structured Output: Get cleaned, structured output from the Ollama model.
- Easy Configuration: Quickly set up your Ollama URL.
📦 Installation
-
Clone the Repository: Navigate to your
ComfyUI/custom_nodesdirectory and clone this repository:git clone https://github.com/BobRandomNumber/ComfyUI-BasicOllama -
Install Dependencies: Navigate to the newly cloned directory and install the required packages:
cd ComfyUI-BasicOllama pip install -r requirements.txt -
Restart ComfyUI: Restart your ComfyUI instance to load the new custom node.
✨ Usage
The BasicOllama node can be found under the Ollama category in the ComfyUI menu.
Inputs
| Name | Type | Description |
|---|---|---|
prompt |
STRING |
The text prompt to send to the Ollama model. |
input_type |
COMBO (text, image) |
The type of input to send to the model. text for text-only prompts, and image to include images. |
ollama_model |
COMBO |
A list of available Ollama models on your local instance. |
keep_alive |
INT |
The duration (in minutes) that the Ollama model should remain loaded in memory after the request is complete. |
structure_output |
BOOLEAN |
If True, the output will be cleaned and structured. |
prompt_structure |
COMBO |
A selection of prompt templates to structure your prompt for various models. |
structure_format |
STRING |
A custom format for the structured output. |
output_format |
COMBO (raw_text, json) |
The format of the output. raw_text for plain text, and json for a JSON object. |
image1 - image5 |
IMAGE (Optional) |
Up to five optional image inputs for multimodal models. |
Outputs
| Name | Type | Description |
|---|---|---|
text |
STRING |
The text-based response from the Ollama model. |
⚙️ Configuration
By default, the BasicOllama node will attempt to connect to your Ollama instance at http://localhost:11434.
If your Ollama instance is running on a different URL, you can change it by editing the config.json file located in the ComfyUI-BasicOllama directory:
{
"OLLAMA_URL": "http://your-ollama-url:11434"
}
🙏 Attribution
A special thank you to @al-swaiti for creating the original ComfyUI-OllamaGemini which served as the foundation for this. This project is licensed under the MIT License.