ComfyUI Extension: ComfyUI LLM SDXL Adapter

Authored by NeuroSenko

Created

Updated

20 stars

A comprehensive set of ComfyUI nodes for using Large Language Models (LLM) as text encoders for SDXL image generation through a trained adapter.

Custom Nodes (0)

    README

    ComfyUI LLM SDXL Adapter

    Version License Python ComfyUI

    A comprehensive set of ComfyUI nodes for using Large Language Models (LLM) as text encoders for SDXL image generation through a trained adapter.

    <img width="1803" height="904" alt="image" src="https://github.com/user-attachments/assets/e8e5f047-37e7-4f8b-9bbd-78d70e2a7d80" />

    Image with workflow

    šŸŽÆ Available Adapters

    RouWei-Gemma Adapter

    Trained adapter for using Gemma-3-1b as text encoder for Rouwei v0.8 (vpred or epsilon or base).

    Download Links:

    šŸ“¦ Installation

    Requirements

    • Python 3.8+
    • ComfyUI
    • Latest transformers library (tested on 4.53.1)

    Install Dependencies

    pip install transformers>=4.53.1 safetensors einops torch
    

    Install Nodes

    1. Clone the repository to ComfyUI/custom_nodes/:
    cd ComfyUI/custom_nodes/
    git clone https://github.com/NeuroSenko/ComfyUI_LLM_SDXL_Adapter.git
    
    1. Restart ComfyUI

    Setup RouWei-Gemma Adapter

    1. Download the adapter:

      • Download from CivitAI or HuggingFace
      • Place the adapter file in ComfyUI/models/llm_adapters/
    2. Download Gemma-3-1b-it model:

      • Download gemma-3-1b-it (non-gated mirror)
      • Place in ComfyUI/models/llm/gemma-3-1b-it/
      • Note: You need ALL files from the original model for proper functionality (not just .safetensors)
    3. Download Rouwei checkpoint:

      • Get Rouwei v0.8 (vpred, epsilon, or base) if you don't have it
      • Place in your regular ComfyUI checkpoints folder

    šŸ“ File Structure Example

    ComfyUI/models/
    ā”œā”€ā”€ llm/gemma-3-1b-it/
    │   ā”œā”€ā”€ added_tokens.json
    │   ā”œā”€ā”€ config.json
    │   ā”œā”€ā”€ generation_config.json
    │   ā”œā”€ā”€ model.safetensors
    │   ā”œā”€ā”€ special_tokens_map.json
    │   ā”œā”€ā”€ tokenizer.json
    │   ā”œā”€ā”€ tokenizer.model
    │   └── tokenizer_config.json
    ā”œā”€ā”€ llm_adapters/
    │   └── rouweiGemma_g31b27k.safetensors
    └── checkpoints/
        └── rouwei_v0.8_vpred.safetensors
    

    šŸ” Debugging

    To enable detailed logging, edit __init__.py:

    # Change from:
    logger.setLevel(logging.WARN)
    # To:
    logger.setLevel(logging.INFO)