Commit Graph
59 Commits
Author SHA1 Message Date
huchukato 90e9580fe6 Fix sort parameter mapping for huggingface_hub API
- Map frontend sort values to valid huggingface_hub sort values
- Remove invalid 'relevancy' sort (use default ordering)
- Fix 400 Bad Request error for invalid sort parameter
- Support: downloads, likes, created_at, modelId
2026-02-21 08:05:22 +01:00
huchukato c49cc38e0c Fix HfApi method from search_models to list_models
- HfApi doesn't have search_models method
- Use list_models instead with search parameter
- Fix 'HfApi' object has no attribute 'search_models' error
- Update parameter names to match list_models API
2026-02-21 08:02:48 +01:00
huchukato 32f03672f1 Improve model details error handling and fallbacks
- Add try/catch around API info calls
- Try ModelCard first, then API fallback, then minimal info
- Better error messages and logging
- Prevent complete failure when one method fails
- Always return some model info instead of errors
2026-02-21 08:01:51 +01:00
huchukato 46cdfa31c0 Fix import paths - utils.py is directly in server/
- Change from .utils to ..utils for resolve_huggingface_api_key
- utils.py is directly in server/ not in server/utils/
- Fix 'No module named server.routes.utils' error
- Restore button functionality
2026-02-21 07:24:53 +01:00
huchukato eb70af7f88 Fix import paths for resolve_huggingface_api_key
- Change from ..utils to .utils for resolve_huggingface_api_key
- Fix import errors that were breaking extension
- All routes now import from correct location
- Restore button functionality
2026-02-21 07:22:41 +01:00
huchukato 5ed4907983 Remove fallback imports that were causing errors
- Remove try/except imports that were failing
- Keep only relative imports that work
- Fix 'No module named api' error
- Simplify import structure
2026-02-21 07:20:54 +01:00
huchukato 089085cce7 Fix relative imports in utils.py
- Add try/except for relative imports
- Fallback to absolute imports for testing
- Fix import errors that were breaking the extension
- Restore button functionality
2026-02-21 07:17:07 +01:00
huchukato 221e172a65 Add missing fields to download_info
- Add api_key, known_size, huggingface_version_info
- Add huggingface_primary_file, thumbnail, model_version_id
- Add custom_filename, huggingface_model_name
- Prevent manager warnings for missing fields
- Better download manager integration
2026-02-21 07:15:21 +01:00
huchukato 00d90b6b45 Enable NSFW by default in search
- Set nsfw=True as default value
- Users don't need to enable it every time
- Can still be disabled by setting nsfw=false
- Better user experience for model discovery
2026-02-21 07:14:23 +01:00
huchukato 3a1e0f8674 Rewrite SearchModels to use huggingface_hub
- Remove Meilisearch API calls
- Use huggingface_hub HfApi.search_models()
- Simplify search logic and parameters
- Better integration with huggingface_hub
- Fix syntax errors in f-strings
2026-02-21 07:13:47 +01:00
huchukato 24b3f5598a Rewrite GetModelDetails to use HuggingFace model cards
- Remove complex Civitai-style logic
- Use huggingface_hub ModelCard to read model cards
- Extract base_model, tags, license from YAML frontmatter
- Get description from model card text
- Much cleaner and more accurate for HuggingFace models
2026-02-21 07:11:40 +01:00
huchukato 7b52d41ad1 Add dynamic base model detection
- Use HuggingFace API to get popular base models
- Add common base models like SDXL, SD1.5, FLUX
- Keep hardcoded list as fallback
- Better base model filtering for search
2026-02-21 07:10:07 +01:00
huchukato 362d23575f Fix download_url for None target_filename
- Don't construct URL when target_filename is None
- Let huggingface_hub handle repo downloads
- Prevent 404 errors with resolve/main/None
- Better handling for repo vs file downloads
2026-02-21 07:08:38 +01:00
huchukato ce94275957 Fix None target_filename handling
- Add proper handling for target_filename = None
- Use model name as folder name for repo downloads
- Prevent TypeError when os.path.basename(None)
- Better logic for repo vs file downloads
2026-02-21 07:05:35 +01:00
huchukato 38fcd86a8b Simplify approach: API only for token, huggingface_hub for everything
- Skip API calls for public repos entirely
- Use API only for private repos to get model info
- Always use huggingface_hub for downloads
- Let huggingface_hub auto-detect files
- Much cleaner and more reliable approach
2026-02-21 06:34:18 +01:00
huchukato b4ad945162 Add fallback model name extraction for HF models
- When HF API fails to find model info, use parsed name from model_id
- Added debug output for fallback path
- This handles cases where HF models don't have proper model cards
- Ensures model name is always available even for obscure models
2026-02-21 04:08:36 +01:00
huchukato 5ba91fc75e Fix all routes to use /api/ prefix
- Updated all HuggingFace routes to use /api/huggingface/ prefix
- This fixes 405 Method Not Allowed errors for all endpoints
- Frontend and backend paths now match consistently
- All API calls should work correctly now
2026-02-21 04:07:15 +01:00
huchukato e072f140e7 Fix get_model_details route to use /api/ prefix
- Changed route from /huggingface/get_model_details to /api/huggingface/get_model_details
- This fixes the 405 Method Not Allowed error
- Frontend was calling /api/ but route was registered without /api/
- Now frontend and backend paths match
2026-02-21 04:05:27 +01:00
huchukato 567f60c6fa Add debug for direct download model name extraction
- Added debug output for direct download path
- Shows when model name is extracted from model_id
- Helps identify why model name might not be set correctly
- More comprehensive debugging for direct download scenario
2026-02-21 03:56:18 +01:00
huchukato c6c9723362 Add debug for response huggingface_model_name
- Added debug output for response data huggingface_model_name
- Will show what name is being sent to frontend
- Helps identify if frontend receives the correct model name
- More comprehensive debugging for model name issue
2026-02-21 03:52:07 +01:00
huchukato 605a3b4e3d Fix model_info JSON parsing issue
- Added JSON parsing for model_info when it's a string
- Backend was sending model_info as JSON string instead of dict
- Now correctly extracts 'name' field from parsed JSON
- This should fix the model name display issue
2026-02-21 03:49:00 +01:00
huchukato d696d247bd Add debug for response model name
- Added debug output for response data model_name
- Will show what name is being sent to frontend
- Helps identify if parsing works but frontend doesn't display it
- More comprehensive debugging for model name issue
2026-02-21 03:27:33 +01:00
huchukato 142eb98cff Add debug logging for model name parsing
- Added detailed debug output for model_info and target_model_id
- Shows which path is taken for name extraction
- Will help identify why model name parsing fails
- Debug output will show the final model_display_name
2026-02-21 03:17:53 +01:00
huchukato 5eba7395c0 Fix placeholder paths and model name extraction
1. Fixed placeholder image paths to be relative to JS file location
2. Enhanced model name extraction from model_id when API fails
3. Now shows 'wan2.2-2-Remix' instead of 'Unknown Model'
4. All paths now work correctly for ComfyUI serving

Final fixes for complete functionality!
2026-02-21 03:09:13 +01:00
huchukato dd961386c7 Fix placeholder paths and model name parsing
1. Changed placeholder paths to relative './' instead of absolute
2. Enhanced model name parsing to use model_info['name'] when available
3. Fallback to model_id parsing for better display names
4. Should show 'wan2.2-Remix' instead of 'Unknown Model' when possible
2026-02-21 03:07:14 +01:00
huchukato 962dc56f78 Improve HF download experience
1. Force single connection for HF downloads (like Civitai)
2. Placeholder image already configured correctly
3. Extract model name from model_id (e.g. 'wan2.2-Remix' from 'FX-FeiHou/wan2.2-Remix')
4. Better display names in status and UI

More reliable and user-friendly downloads!
2026-02-21 03:02:15 +01:00
huchukato a32ec41975 Correct terminology: API Key -> HF token
- Updated all references to use 'HF token' instead of 'API Key'
- Clarified that token is only for private repositories
- Updated environment variable name to HUGGINGFACE_TOKEN
- More accurate documentation of token purpose
2026-02-21 02:53:21 +01:00
huchukato e90c5a638a Fix missing method and URL field for downloads
- Added get_model_version_info() method for compatibility
- Added 'url' field to download_info for ChunkDownloader
- This should fix both the AttributeError and 'Invalid URL None' errors
- Downloads should now work properly with huggingface_hub fallback
2026-02-21 02:49:51 +01:00
huchukato b8cd5107a8 Fix download status to show in queue properly
- Changed response status from 'started' to 'queued'
- Frontend expects 'queued' to show download in status tab
- This ensures downloads appear in the queue visualization
- Auto-open status tab should now work correctly
2026-02-21 02:40:32 +01:00
huchukato 8428e21330 Fix direct download URL path handling
- Use parsed_filename instead of hardcoded 'model.safetensors'
- This ensures the full path from URL is used
- Fixes 'Invalid URL None' error
- Direct downloads should now work with proper file paths
2026-02-21 02:36:43 +01:00
huchukato 997e9c6573 Fix missing output_path in download_info
- Added output_path field to download_info dict
- ChunkDownloader requires output_path parameter
- This was causing TypeError: NoneType error
- Download should now work properly
2026-02-21 02:34:20 +01:00
huchukato 218135e5f7 Fix method name from start_download to add_to_queue
- DownloadManager uses add_to_queue() not start_download()
- This was causing AttributeError
- Download should now start properly
- Fixed method call to match actual DownloadManager API
2026-02-21 02:30:26 +01:00
huchukato 7489235cfd Fix direct download without API calls
- Skip model info/file listing for direct URLs
- Fallback to direct download when API fails
- Handle models that don't support tree endpoint
- This should fix the 404 errors for Wan 2.2 models
- Direct downloads should now work without API dependencies
2026-02-21 02:27:15 +01:00
huchukato ce1d9b3980 Fix remaining Civitai references causing button disappearance
- Replaced CIVITAI_API_KEY with HUGGINGFACE_API_KEY
- Removed select_primary_file import (not implemented for HF)
- Added simple file selection logic for HF
- Fixed utils.py imports and function calls
- Updated JavaScript references

This should restore the HuggingFace button in ComfyUI
2026-02-21 02:16:21 +01:00
huchukato 1981bdfded Fix HuggingFace URL parsing and download logic
- Rewrote parse_huggingface_input() for HF URLs
- Support direct download URLs with /resolve/main/
- Simplified DownloadModel.py for HF API
- Proper model ID extraction (username/repo format)
- File selection logic for .safetensors or largest file
- Fixed API calls to use correct HF endpoints

Should now handle URLs like:
https://huggingface.co/FX-FeiHou/wan2.2-Remix/resolve/main/NSFW/file.safetensors
2026-02-21 02:14:25 +01:00
huchukato 9135268139 Fix remaining Civitai references causing import errors
- Renamed CIVITAI_API_TYPE_MAP to HUGGINGFACE_API_TYPE_MAP
- Updated all Python imports
- Fixed config.py variable name
- This should resolve the missing button issue by fixing imports

Extension should now load correctly in ComfyUI
2026-02-21 02:08:08 +01:00
huchukato 808fcff157 Fix placeholder image extension from .jpeg to .jpg
- Updated all file references from placeholder.jpeg to placeholder.jpg
- Fixed JavaScript files
- Fixed Python files
- Fixed config.py
- Image now loads correctly in UI

This should fix missing placeholder images in the interface
2026-02-21 02:05:54 +01:00
huchukato 43861995ab Complete HuggingFace rebranding for UI
- Replaced all remaining 'Civicomfy' references with 'HuggingFace'
- Updated JavaScript extension name and button text
- Fixed all UI component references
- Updated console logs and error messages
- Changed extension registration name
- Updated CSS and image paths

This should fix the missing button issue in ComfyUI
2026-02-21 02:03:08 +01:00
huchukato 66e00264a0 Initial HuggingFace API implementation
- Converted CivitaiAPI to HuggingFaceAPI
- Updated all references from civitai to huggingface
- Renamed web files (CSS/JS)
- Implemented core HF API methods:
  * search_models()
  * get_model_info()
  * get_model_files()
  * download_file()
- Clean API structure for HuggingFace integration

Next: Update server routes and helpers for HF endpoints
2026-02-21 01:52:05 +01:00
MoonGoblin 7c0791ed9c feat: support env API key and global model root paths 2026-02-14 12:32:29 +07:00
MoonGoblin 524a1e2e99 model dir fix 2025-09-11 17:40:55 +08:00
MoonGoblin d03355ad05 folder dir revamp 2025-09-11 17:31:49 +08:00
MoonGoblin 4050c69c07 blur r rated image on all tabs 2025-09-11 16:10:21 +08:00
MoonGoblin 401c0a0787 Refactor 2025-08-09 16:22:20 +08:00
MoonGoblin 9ccde2083b refactor 2025-08-09 15:11:02 +08:00
MoonGoblin e5e167013b Play video thumbnail & fix placeholder 2025-04-08 17:28:59 +08:00
MoonGoblin 6ec577396d Fix model metadata 2025-04-08 10:18:04 +08:00
MoonGoblin 29dd6ec744 History kinda broken 2025-04-06 17:43:36 +07:00
MoonGoblin f27d4e49e0 saving download history 2025-04-06 14:41:27 +07:00
MoonGoblin 60cb588ce3 cleanup some debug 2025-04-06 11:14:41 +07:00