Implement early access handling and UI enhancements for LoRA downloads

- Added error handling for early access restrictions in the API routes, returning appropriate status codes and messages.
- Enhanced the Civitai client to log unauthorized access attempts and provide user-friendly error messages.
- Updated the download manager to check for early access requirements and log warnings accordingly.
- Introduced UI elements to indicate early access status for LoRAs, including badges and warning messages in the import manager.
- Improved toast notifications to inform users about early access download failures and provide relevant information.
This commit is contained in:
Will Miao
2025-03-23 14:45:11 +08:00
parent 93329abe8b
commit c402f53258
12 changed files with 448 additions and 27 deletions

View File

@@ -1,4 +1,5 @@
import os
import time
import logging
from aiohttp import web
from typing import Dict
@@ -13,7 +14,7 @@ from ..services.recipe_scanner import RecipeScanner
from ..services.lora_scanner import LoraScanner
from ..config import config
from ..workflow.parser import WorkflowParser
import time # Add this import at the top
from ..utils.utils import download_twitter_image
logger = logging.getLogger(__name__)
@@ -234,7 +235,6 @@ class RecipeRoutes:
}, status=400)
# Download image from URL
from ..utils.utils import download_twitter_image
temp_path = download_twitter_image(url)
if not temp_path: