Update app.py
Browse files
app.py
CHANGED
|
@@ -6,6 +6,7 @@ import gradio as gr
|
|
| 6 |
|
| 7 |
from diffusers import AutoPipelineForText2Image
|
| 8 |
from PIL import PngImagePlugin
|
|
|
|
| 9 |
|
| 10 |
BASE_MODEL_ID = "stabilityai/stable-diffusion-xl-base-1.0"
|
| 11 |
|
|
@@ -19,6 +20,19 @@ LORA_HOURGLASS_REPO = "Muapi/hourglass-body-shape-sd1.5-sdxl-pony-flux-olaz"
|
|
| 19 |
LORA_HOURGLASS_FILE = "hourglass-body-shape-sd1.5-sdxl-pony-flux-olaz.safetensors"
|
| 20 |
LORA_HOURGLASS_ADAPTER = "hourglass_body"
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# LoRA amélioration de visages
|
| 23 |
#LORA_FACE_REPO = "ostris/face-helper-sdxl-lora"
|
| 24 |
LORA_FACE_REPO = "akash-guptag/Detailers_By_Stable_Yogi"
|
|
@@ -43,12 +57,11 @@ pipe.set_progress_bar_config(disable=True)
|
|
| 43 |
#)
|
| 44 |
print("Chargement LoRA hourglass body...")
|
| 45 |
pipe.load_lora_weights(
|
| 46 |
-
|
| 47 |
-
weight_name=
|
| 48 |
adapter_name=LORA_HOURGLASS_ADAPTER,
|
| 49 |
)
|
| 50 |
|
| 51 |
-
|
| 52 |
print("Chargement LoRA face-helper...")
|
| 53 |
pipe.load_lora_weights(
|
| 54 |
LORA_FACE_REPO,
|
|
|
|
| 6 |
|
| 7 |
from diffusers import AutoPipelineForText2Image
|
| 8 |
from PIL import PngImagePlugin
|
| 9 |
+
from huggingface_hub import hf_hub_download
|
| 10 |
|
| 11 |
BASE_MODEL_ID = "stabilityai/stable-diffusion-xl-base-1.0"
|
| 12 |
|
|
|
|
| 20 |
LORA_HOURGLASS_FILE = "hourglass-body-shape-sd1.5-sdxl-pony-flux-olaz.safetensors"
|
| 21 |
LORA_HOURGLASS_ADAPTER = "hourglass_body"
|
| 22 |
|
| 23 |
+
|
| 24 |
+
# Teste le téléchargement
|
| 25 |
+
try:
|
| 26 |
+
local_path = hf_hub_download(
|
| 27 |
+
repo_id=LORA_HOURGLASS_REPO,
|
| 28 |
+
filename=LORA_HOURGLASS_FILE,
|
| 29 |
+
local_dir="./lora_cache"
|
| 30 |
+
)
|
| 31 |
+
print(f"Fichier OK : {local_path}")
|
| 32 |
+
except Exception as e:
|
| 33 |
+
print(f"Erreur repo/fichier : {e}")
|
| 34 |
+
|
| 35 |
+
|
| 36 |
# LoRA amélioration de visages
|
| 37 |
#LORA_FACE_REPO = "ostris/face-helper-sdxl-lora"
|
| 38 |
LORA_FACE_REPO = "akash-guptag/Detailers_By_Stable_Yogi"
|
|
|
|
| 57 |
#)
|
| 58 |
print("Chargement LoRA hourglass body...")
|
| 59 |
pipe.load_lora_weights(
|
| 60 |
+
"Muapi/hourglass-body-shape-sd1.5-sdxl-pony-flux-olaz", # repo
|
| 61 |
+
weight_name="hourglass-body-shape-sd1.5-sdxl-pony-flux-olaz.safetensors", # fichier précis
|
| 62 |
adapter_name=LORA_HOURGLASS_ADAPTER,
|
| 63 |
)
|
| 64 |
|
|
|
|
| 65 |
print("Chargement LoRA face-helper...")
|
| 66 |
pipe.load_lora_weights(
|
| 67 |
LORA_FACE_REPO,
|