Skip to content

huchukato/ComfyUI-HuggingFace

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

166 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ComfyUI-HuggingFace - HuggingFace Model Downloader for ComfyUI

Python License ComfyUI HuggingFace Italian

buy-me-coffees

ComfyUI-HuggingFace integra perfettamente l'enorme repository di modelli HuggingFace direttamente in ComfyUI, permettendoti di cercare, scaricare e organizzare modelli AI senza lasciare il tuo workflow.

ComfyUI-HuggingFace

โœจ Features

๐Ÿ” Advanced Search & Discovery

  • Full HuggingFace Integration: Search HuggingFace's entire model library directly from ComfyUI
  • Smart Filtering: Filter by model types (LoRA, Checkpoints, Diffusers, etc.)
  • Base Model Filtering: Filter by SD 1.5, SDXL, Pony, and other base models
  • Multiple Sort Options: Sort by downloads, likes, newest, or relevancy
  • NSFW Support: NSFW content enabled by default (can be disabled)
  • Real-time Results: Instant search results with model previews

๐Ÿ“ฅ Intelligent Download System

  • Dual Download Modes:
    • Single Files: Download specific model files with hf_hub_download
    • Full Repos: Download entire repositories with snapshot_download (perfect for Diffusers)
  • Automatic Type Detection: Smart categorization of models (checkpoints, LoRAs, etc.)
  • Metadata Preservation: Downloads include model cards, descriptions, and statistics
  • Resume Support: Resume interrupted downloads
  • Multi-connection Downloads: Faster downloads with parallel connections

๐ŸŽฏ Model Management

  • Automatic Organization: Models saved to correct ComfyUI directories
  • Custom Filename Support: Rename models during download
  • Preview Images: Download and display model thumbnails
  • Version Control: Track model versions and updates
  • Download History: View and manage download history

๐Ÿ›  Technical Features

  • Pure huggingface_hub: Uses official huggingface_hub library exclusively
  • No REST API Dependencies: Eliminates unreliable API calls
  • Robust Error Handling: Graceful fallbacks for missing information
  • Private Repository Support: Access private models with API tokens
  • Clean Error Messages: User-friendly notifications without scary errors

๐Ÿš€ Installation

Automatic Installation (Recommended)

  1. Open ComfyUI Manager
  2. Search for "ComfyUI-HuggingFace"
  3. Click Install

Manual Installation

cd ComfyUI/custom_nodes
git clone https://github.com/huchukato/ComfyUI-HuggingFace.git

๐Ÿ“– Usage

  1. Start ComfyUI with ComfyUI-HuggingFace installed
  2. Access the Panel: Click the HuggingFace button in the top-right area
  3. Search Models: Use the search bar with filters and sorting options
  4. Preview Models: Click on any model to see details and preview
  5. Download: Click the download button to save models locally
  6. Use in ComfyUI: Models appear automatically in ComfyUI nodes

โš™๏ธ Configuration

HuggingFace API Token (Optional but Recommended)

  • Environment Variable: HUGGINGFACE_API_KEY
  • In-App Settings: Enter token in ComfyUI-HuggingFace settings
  • Benefits: Higher rate limits, access to private models

Global Download Root (Optional)

  • Setting: Custom download directory
  • Format: <global_root>/<model_type>
  • Example: /runpod-volume/ComfyUI/checkpoints
  • Default: Uses standard ComfyUI paths when empty

๐Ÿ“ Supported Model Types

Type Description Directory
Checkpoints Main model files (.safetensors, .bin) checkpoints/
LoRAs Low-Rank Adaptation models loras/
Diffusers Complete diffusion pipelines diffusers/
Text Encoders CLIP and encoder models text_encoders/
VAEs Variational Autoencoders vae/
Embeddings Text embedding models embeddings/
ControlNet Control models controlnet/
IP-Adapters Image adapter models ip_adapters/
Custom Any model type from HuggingFace User-defined

๐Ÿ”ง Technical Implementation

Core Technologies

  • huggingface_hub: Official HuggingFace Python library
  • snapshot_download: For complete repository downloads
  • hf_hub_download: For single file downloads
  • ModelCard: For reading model metadata and descriptions
  • HfApi: For searching and listing models

API Endpoints

  • POST /api/huggingface/search - Model search with filters
  • POST /api/huggingface/get_model_details - Model information
  • POST /api/huggingface/download - Initiate downloads
  • GET /api/huggingface/base_models - Available base models
  • POST /api/huggingface/cancel - Cancel downloads
  • GET /api/huggingface/download_status - Download progress
  • GET /api/huggingface/history - Download history
  • GET /api/huggingface/model_dirs - Available model directories

Error Handling Strategy

  1. Primary: Use huggingface_hub functions directly
  2. Fallback 1: Try API calls for additional metadata
  3. Fallback 2: Return minimal information without errors
  4. UI: Show user-friendly messages instead of scary errors

๐Ÿ”„ Migration from Civicomfy

This is a complete rewrite of Civicomfy with HuggingFace integration:

What Changed

  • โœ… Replaced Civitai API with HuggingFace API
  • โœ… Updated URL parsing for HF model structure
  • โœ… Maintained clean UI/UX from original
  • โœ… Added HF-specific features (repo downloads, model cards)
  • โœ… Improved error handling and user experience
  • โœ… Removed REST API dependencies for reliability

What's Better

  • ๐Ÿš€ More Reliable: Official huggingface_hub library
  • ๐ŸŽฏ More Models: Access to entire HuggingFace repository
  • ๐Ÿ“ Smart Downloads: Repo vs single file detection
  • ๐Ÿ›ก๏ธ Better Security: No more direct URL construction
  • ๐ŸŽจ Cleaner UI: No scary error messages

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Areas for Contribution

  • Additional Model Types: Support for new model formats
  • UI/UX Improvements: Better user interface and experience
  • Performance Optimizations: Faster downloads and search
  • Bug Fixes: Testing and issue resolution
  • Documentation: Improving guides and examples

Development Setup

git clone https://github.com/huchukato/ComfyUI-HuggingFace.git
cd ComfyUI-HuggingFace
# Install dependencies
pip install -r requirements.txt
# Test with ComfyUI

๐Ÿ“‹ Requirements

System Requirements

  • ComfyUI: Latest version recommended
  • Python: 3.8+
  • Memory: 4GB+ RAM recommended
  • Storage: Sufficient space for model downloads

Python Dependencies

  • huggingface_hub>=0.20.0 - HuggingFace integration
  • requests>=2.25.0 - HTTP requests
  • aiohttp - Async web server (ComfyUI)

Optional Dependencies

  • HUGGINGFACE_API_KEY - For higher rate limits
  • Custom model directories - For organization

๐Ÿ“„ License

This project follows the same license as the original Civicomfy project.

๐Ÿ™ Acknowledgments

๐Ÿ“ž Support

  • Issues: Report bugs via GitHub Issues
  • Features: Request features via GitHub Discussions
  • Discord: Join the ComfyUI community
  • Updates: Follow the repository for latest features

โญ If you find this useful, please give it a star on GitHub!

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


๐Ÿ‡ฎ๐Ÿ‡น Italian Documentation - Read the docs in Italian

About

HuggingFace model downloader for ComfyUI - Search, browse, and download models directly from HuggingFace repository without leaving ComfyUI interface

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 57.9%
  • JavaScript 35.0%
  • CSS 7.1%