Spaces:
Running on Zero
Running on Zero
Upload app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,15 @@ from PIL import Image
|
|
| 10 |
from huggingface_hub import hf_hub_download, snapshot_download
|
| 11 |
from insightface.app import FaceAnalysis
|
| 12 |
from diffusers import ControlNetModel
|
| 13 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
# ==============================================================================
|
| 16 |
# 1. SETUP E INIZIALIZZAZIONE GLOBALE
|
|
|
|
| 10 |
from huggingface_hub import hf_hub_download, snapshot_download
|
| 11 |
from insightface.app import FaceAnalysis
|
| 12 |
from diffusers import ControlNetModel
|
| 13 |
+
|
| 14 |
+
import urllib.request
|
| 15 |
+
# Scarichiamo la pipeline custom di InstantID direttamente dal repository ufficiale di diffusers
|
| 16 |
+
pipeline_url = "https://raw.githubusercontent.com/huggingface/diffusers/main/examples/community/pipeline_stable_diffusion_xl_instantid.py"
|
| 17 |
+
if not os.path.exists("pipeline_stable_diffusion_xl_instantid.py"):
|
| 18 |
+
print("Scaricamento pipeline InstantID custom...")
|
| 19 |
+
urllib.request.urlretrieve(pipeline_url, "pipeline_stable_diffusion_xl_instantid.py")
|
| 20 |
+
|
| 21 |
+
from pipeline_stable_diffusion_xl_instantid import StableDiffusionXLInstantIDPipeline
|
| 22 |
|
| 23 |
# ==============================================================================
|
| 24 |
# 1. SETUP E INIZIALIZZAZIONE GLOBALE
|