Run ComfyUI Easily with InstaSD

Skip the complex setup and run ComfyUI online. InstaSD helps creative professionals build workflows and deploy them to the world:

  • One-click deployment
  • Any model, any node
  • Powerful GPUs for rapid iteration
Get Started

Documentation

ComfyUI Ollama Custom Nodes

Overview

This repository offers custom nodes for ComfyUI to facilitate interactions with Ollama using the ollama python client. It enables the integration of Large Language Models (LLMs) into ComfyUI workflows, allowing users to leverage the power of LLMs for generating and processing text and images easily.

Installation

To install the ComfyUI Ollama custom nodes, follow these steps:

  1. Install Ollama server on your desired host. You can find installation options for different operating systems:

    • Download for macOS
    • Download for Windows
    • Install on Linux:
      curl -fsSL https://ollama.com/install.sh | sh
      
    • For Docker installation:
      • CPU only:
        docker run -d -p 11434:11434 -v ollama:/root/.ollama --name ollama ollama/ollama
        
      • NVIDIA GPU:
        docker run -d -p 11434:11434 --gpus=all -v ollama:/root/.ollama --name ollama ollama/ollama
        
  2. Use the ComfyUI Manager "Custom Node Manager" to search for ollama and select the one by stavsap.

  3. Alternatively, clone the repository or download it as a zip file and unzip its contents into the custom_nodes folder inside your ComfyUI installation. Ensure it's located within custom_nodes/compfyui-ollama.

  4. Run the following command to install the necessary Python dependencies:

    pip install -r requirements.txt
    
  5. Start or restart ComfyUI.

Node Offerings

This repository contains the following nodes:

  1. OllamaVision:

    • Allows querying input images using a model with vision capabilities.
  2. OllamaGenerate:

    • Facilitates querying an LLM with a given prompt.
  3. OllamaGenerateAdvance:

    • Offers enhanced querying with customizable parameters and the ability to preserve context for generating chains.
  4. OllamaGenerateV2:

    • Provides the capability to set system prompts and prompts. Allows saving context locally within the node.
  5. OllamaConnectivityV2:

    • Ensures connectivity to the Ollama server.
  6. OllamaOptionsV2:

    • Offers full control of Ollama API options, including enabling or disabling each option.
  7. OllamaSaveContext:

    • Facilitates saving context for later retrieval.
  8. OllamaLoadContext:

    • Allows for loading previously saved context.

Special Features and Capabilities

  • Modular Workflow: The V2 version of nodes introduces a more modular approach, allowing for easier control and chaining of workflows.
  • Context Handling: Nodes such as OllamaGenerateAdvance and OllamaGenerateV2 support the saving and loading of context, enabling continuous LLM interactions that maintain state.
  • Full API Control: OllamaOptionsV2 provides deep control over API options, allowing for customized inference strategies.

Use in ComfyUI Workflows

The ComfyUI Ollama custom nodes are designed to seamlessly integrate LLM capabilities into ComfyUI workflows. This can be particularly useful for:

  • Automated Content Creation: Generate text based on prompts, allowing for automated writing, summarization, or content expansion.
  • Image and Text Processing: Combine vision capabilities with text processing, useful in applications like caption generation or content enhancement.
  • Interactive Applications: Enable applications that require dynamic and responsive interactions with users, maintaining context over multiple exchanges.
Want to try comfyui-ollama without installing anything? Run ComfyUI online on InstaSD's cloud GPUs — no setup required.