ComfyUI Extension: Ninode Utils

Authored by iGavroche

Created

Updated

0 stars

Utility nodes for ComfyUI including OpenAI Compatible Chat - Works with any OpenAI-compatible API endpoint including Lemonade, Ollama, OpenAI API, and LM Studio

Custom Nodes (0)

    README

    ComfyUI-Ninode-Utils

    Version License Python ComfyUI

    A collection of utility nodes for ComfyUI, featuring OpenAI Compatible Chat functionality and more.

    ๐Ÿš€ Features

    OpenAI Compatible Chat Node

    A flexible chat node that works with any OpenAI-compatible API endpoint, providing complete compatibility with the original ChatGPT node while supporting:

    • Local servers like Lemonade Server (http://127.0.0.1:8000/api/v1/chat/completions)
    • Ollama (http://localhost:11434/v1/chat/completions)
    • OpenAI API (https://api.openai.com/v1/chat/completions)
    • LM Studio (http://localhost:1234/v1/chat/completions)
    • Any other OpenAI-compatible service

    โœจ Key Features

    • ๐Ÿ”„ Complete Input Compatibility - All inputs from the original ChatGPT node are supported
    • ๐Ÿ’ฌ Multi-turn Conversations - Context persistence for ongoing conversations
    • ๐Ÿ–ผ๏ธ Image Support - Vision model support with image inputs
    • ๐Ÿ“„ File Support - Document analysis with file inputs
    • โš™๏ธ Advanced Options - Fine-tuned control with advanced configuration
    • ๐ŸŒ Flexible API Configuration - Custom URLs and API keys
    • ๐Ÿค– System Message Support - Set assistant behavior and personality
    • ๐ŸŽ›๏ธ Configurable Parameters - Temperature, top_p, max_tokens, and more
    • ๐Ÿ›ก๏ธ Robust Error Handling - Graceful handling of various edge cases

    VibeVoice Voice Design Node

    A drop-in replacement for Minimax Voice Design node that generates custom voices from text descriptions using VibeVoice TTS. Perfect for the full-loop-Sora2-ComfyUI workflow!

    Features:

    • ๐ŸŽ™๏ธ Voice Generation from Text Descriptions - Create custom voices based on detailed prompts
    • ๐Ÿ”„ Drop-in Compatibility - Same inputs/outputs as Minimax Voice Design node
    • ๐ŸŽต Voice Cloning Support - Optional reference audio for voice cloning
    • ๐Ÿš€ Local Processing - No API keys required, runs entirely locally
    • โšก High Quality - Uses VibeVoice's advanced TTS technology

    โœจ Key Features

    • ๐Ÿ”„ Complete Input Compatibility - Same interface as Minimax Voice Design node
    • ๐ŸŽฏ Text-to-Voice Generation - Generate voices from detailed text descriptions
    • ๐ŸŽต Reference Audio Support - Optional voice cloning with reference audio
    • โš™๏ธ Advanced Generation Controls - CFG scale, inference steps, temperature, top-p
    • ๐Ÿ”ง Model Selection - Choose from available VibeVoice models
    • ๐Ÿ’พ Audio Output - Saves generated audio as WAV files
    • ๐ŸŽ›๏ธ Memory Management - Optional model offloading for memory efficiency

    ๐Ÿ“ฆ Installation

    Method 1: Git Clone (Recommended)

    cd ComfyUI/custom_nodes
    git clone https://github.com/iGavroche/ComfyUI-Ninode-Utils.git
    cd ComfyUI-Ninode-Utils
    pip install -r requirements.txt
    

    Method 2: Manual Installation

    1. Download or clone this repository
    2. Place the ComfyUI-Ninode-Utils folder in your ComfyUI custom_nodes directory
    3. Install dependencies:
      pip install aiohttp torch Pillow numpy
      
    4. Restart ComfyUI

    ๐ŸŽฏ Usage

    OpenAI Compatible Chat Node

    The node appears in the "ComfyUI-Ninode-Utils" category and can be used as a drop-in replacement for the original ChatGPT node.

    Required Parameters

    • API URL: Your OpenAI-compatible endpoint (e.g., http://127.0.0.1:35841/v1/chat/completions)
    • Model: Model name (e.g., gpt-4o-mini, llama3.2, etc.)
    • API Key: Authentication key (leave empty for local servers)
    • Prompt: Your text input
    • Persist Context: Enable multi-turn conversations

    Optional Parameters

    • Images: Image inputs for vision models
    • Files: File inputs for document analysis
    • Advanced Options: Advanced configuration from OpenAI Chat Advanced Options node
    • Max Tokens: Response length limit
    • Temperature: Creativity control (0.0-2.0)
    • Top P: Diversity control (0.0-1.0)
    • System Message: Assistant behavior setting

    ๐Ÿ”ง Configuration Examples

    Lemonade Server

    API URL: http://127.0.0.1:35841/v1/chat/completions
    Model: gpt-4o-mini
    API Key: (leave empty)
    

    Ollama

    API URL: http://localhost:11434/v1/chat/completions
    Model: llama3.2
    API Key: (leave empty)
    

    OpenAI API

    API URL: https://api.openai.com/v1/chat/completions
    Model: gpt-4o
    API Key: your-openai-api-key
    

    LM Studio

    API URL: http://localhost:1234/v1/chat/completions
    Model: codellama-7b-instruct
    API Key: (leave empty)
    

    ๐Ÿงช Testing

    The package includes comprehensive tests to ensure reliability:

    cd ComfyUI-Ninode-Utils
    python test_node.py                    # Basic functionality tests
    python test_new_inputs.py             # Input compatibility tests
    python test_advanced_options.py       # Advanced options handling tests
    python test_tensor_handling.py        # Image tensor processing tests
    

    ๐Ÿ“‹ Requirements

    • ComfyUI (latest version)
    • Python 3.9+
    • Dependencies:
      • aiohttp>=3.8.0
      • torch>=2.0.0
      • Pillow>=9.0.0
      • numpy>=1.25.0

    ๐Ÿ› ๏ธ Development

    Project Structure

    ComfyUI-Ninode-Utils/
    โ”œโ”€โ”€ __init__.py                    # Package initialization
    โ”œโ”€โ”€ nodes.py                       # Main node implementations
    โ”œโ”€โ”€ pyproject.toml                 # Project configuration
    โ”œโ”€โ”€ requirements.txt               # Dependencies
    โ”œโ”€โ”€ README.md                      # This file
    โ”œโ”€โ”€ test_node.py                   # Basic tests
    โ”œโ”€โ”€ test_new_inputs.py             # Input compatibility tests
    โ”œโ”€โ”€ test_advanced_options.py       # Advanced options tests
    โ”œโ”€โ”€ test_tensor_handling.py        # Tensor processing tests
    โ””โ”€โ”€ IMPLEMENTATION_SUMMARY.md      # Technical documentation
    

    Adding New Nodes

    1. Add your node class to nodes.py
    2. Update NODE_CLASS_MAPPINGS and NODE_DISPLAY_NAME_MAPPINGS
    3. Add tests for your node
    4. Update documentation

    ๐Ÿค Contributing

    Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

    1. Fork the repository
    2. Create your feature branch (git checkout -b feature/AmazingFeature)
    3. Commit your changes (git commit -m 'Add some AmazingFeature')
    4. Push to the branch (git push origin feature/AmazingFeature)
    5. Open a Pull Request

    ๐Ÿ“„ License

    This project is licensed under the MIT License - see the LICENSE file for details.

    ๐Ÿ‘จโ€๐Ÿ’ป Author

    ๐Ÿ™ Acknowledgments

    • ComfyUI community for the amazing framework
    • OpenAI for the API specification
    • All contributors and testers

    ๐Ÿ“ˆ Changelog

    v0.9.0 (Current)

    • Initial release
    • OpenAI Compatible Chat Node with full input compatibility
    • Support for multiple API endpoints (Lemonade, Ollama, OpenAI, LM Studio)
    • Comprehensive test suite
    • Robust error handling and edge case management

    ๐Ÿ› Bug Reports

    If you encounter any issues, please:

    1. Check the Issues page
    2. Create a new issue with:
      • ComfyUI version
      • Python version
      • Error message and traceback
      • Steps to reproduce

    ๐Ÿ“ž Support

    For support, please open an issue on GitHub or contact iGavroche.


    Made with โค๏ธ for the ComfyUI community