diff --git a/py/api/lora_integration.py b/py/api/lora_integration.py index 20d7ee4..6275bfd 100644 --- a/py/api/lora_integration.py +++ b/py/api/lora_integration.py @@ -321,19 +321,22 @@ class LoraIntegrationMixin: self.logger.warning(f"Failed to import LoRA {model_name}: {e}") skipped += 1 - # Progress update every 5 items or at the end - if (i + 1) % 5 == 0 or i == total - 1: - progress = int(5 + (90 * (i + 1) / max(total, 1))) - await send_progress( - { - "type": "progress", - "status": f"Processing: {model_name}", - "progress": progress, - "processed": i + 1, - "imported": imported, - "skipped": skipped, - } - ) + # Progress update for every LoRA + progress = int(5 + (90 * (i + 1) / max(total, 1))) + img_count = len(all_images) + status = f"{model_name}" + if img_count: + status += f" ({img_count} images)" + await send_progress( + { + "type": "progress", + "status": status, + "progress": progress, + "processed": i + 1, + "imported": imported, + "skipped": skipped, + } + ) await send_progress( { diff --git a/py/lora_utils.py b/py/lora_utils.py index 0eb90d9..8c262be 100644 --- a/py/lora_utils.py +++ b/py/lora_utils.py @@ -347,7 +347,7 @@ def download_civitai_images( if api_key: headers["Authorization"] = f"Bearer {api_key}" req = urllib.request.Request(url, headers=headers) - with urllib.request.urlopen(req, timeout=15) as resp: + with urllib.request.urlopen(req, timeout=5) as resp: local_path.write_bytes(resp.read()) downloaded.append(str(local_path.resolve())) except Exception as e: