Spaces:
Sleeping
Sleeping
Update core/image_generator.py
Browse files- core/image_generator.py +11 -7
core/image_generator.py
CHANGED
|
@@ -120,6 +120,13 @@
|
|
| 120 |
# ---------------- CACHE & MODEL DIRECTORIES (FIXED) ----------------
|
| 121 |
import os
|
| 122 |
from pathlib import Path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 123 |
|
| 124 |
# Force all Hugging Face caches to /tmp/hf_cache
|
| 125 |
HF_CACHE_DIR = Path("/tmp/hf_cache")
|
|
@@ -139,14 +146,11 @@ os.environ["HF_MODULES_CACHE"] = str(HF_CACHE_DIR)
|
|
| 139 |
|
| 140 |
print("[DEBUG] Hugging Face cache directory set to:", HF_CACHE_DIR)
|
| 141 |
print("[DEBUG] Model directory set to:", MODEL_DIR)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 142 |
|
| 143 |
-
import torch
|
| 144 |
-
from diffusers import StableDiffusionXLPipeline
|
| 145 |
-
from huggingface_hub import hf_hub_download
|
| 146 |
-
from typing import List
|
| 147 |
-
from io import BytesIO
|
| 148 |
-
import base64
|
| 149 |
-
from PIL import Image
|
| 150 |
|
| 151 |
|
| 152 |
# ---------------- MODEL DOWNLOAD ----------------
|
|
|
|
| 120 |
# ---------------- CACHE & MODEL DIRECTORIES (FIXED) ----------------
|
| 121 |
import os
|
| 122 |
from pathlib import Path
|
| 123 |
+
import torch
|
| 124 |
+
from diffusers import StableDiffusionXLPipeline
|
| 125 |
+
from huggingface_hub import hf_hub_download
|
| 126 |
+
from typing import List
|
| 127 |
+
from io import BytesIO
|
| 128 |
+
import base64
|
| 129 |
+
from PIL import Image
|
| 130 |
|
| 131 |
# Force all Hugging Face caches to /tmp/hf_cache
|
| 132 |
HF_CACHE_DIR = Path("/tmp/hf_cache")
|
|
|
|
| 146 |
|
| 147 |
print("[DEBUG] Hugging Face cache directory set to:", HF_CACHE_DIR)
|
| 148 |
print("[DEBUG] Model directory set to:", MODEL_DIR)
|
| 149 |
+
# ---------------- MODEL CONFIG ----------------
|
| 150 |
+
MODEL_REPO = "SG161222/RealVisXL_V4.0"
|
| 151 |
+
MODEL_FILENAME = "RealVisXL_V4.0.safetensors"
|
| 152 |
+
|
| 153 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
|
| 156 |
# ---------------- MODEL DOWNLOAD ----------------
|