Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,7 +10,7 @@ import sys
|
|
| 10 |
from diffusers.utils import load_image
|
| 11 |
from diffusers import EulerDiscreteScheduler, T2IAdapter
|
| 12 |
|
| 13 |
-
from huggingface_hub import hf_hub_download, login
|
| 14 |
import gradio as gr
|
| 15 |
|
| 16 |
from pipeline_t2i_adapter import PhotoMakerStableDiffusionXLAdapterPipeline
|
|
@@ -23,8 +23,17 @@ from aspect_ratio_template import aspect_ratios
|
|
| 23 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
| 24 |
login(HF_TOKEN)
|
| 25 |
# global variable
|
| 26 |
-
|
| 27 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
face_detector = FaceAnalysis2(providers=['CPUExecutionProvider', 'CUDAExecutionProvider'], allowed_modules=['detection', 'recognition'])
|
| 29 |
face_detector.prepare(ctx_id=0, det_size=(640, 640))
|
| 30 |
|
|
@@ -375,7 +384,7 @@ with gr.Blocks(css=css) as demo:
|
|
| 375 |
num_outputs = gr.Slider(
|
| 376 |
label="Number of output images",
|
| 377 |
minimum=1,
|
| 378 |
-
maximum=
|
| 379 |
step=1,
|
| 380 |
value=2,
|
| 381 |
)
|
|
|
|
| 10 |
from diffusers.utils import load_image
|
| 11 |
from diffusers import EulerDiscreteScheduler, T2IAdapter
|
| 12 |
|
| 13 |
+
from huggingface_hub import snapshot_download, hf_hub_download, login
|
| 14 |
import gradio as gr
|
| 15 |
|
| 16 |
from pipeline_t2i_adapter import PhotoMakerStableDiffusionXLAdapterPipeline
|
|
|
|
| 23 |
HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
| 24 |
login(HF_TOKEN)
|
| 25 |
# global variable
|
| 26 |
+
|
| 27 |
+
# model_id = 'SG161222/RealVisXL_V5.0'
|
| 28 |
+
# model_id = 'Lykon/dreamshaper-xl-lightning'
|
| 29 |
+
# model_id = 'SG161222/RealVisXL_V5.0_Lightning'
|
| 30 |
+
model_id = 'RunDiffusion/Juggernaut-XI-v11'
|
| 31 |
+
base_model_path = Path(model_id)
|
| 32 |
+
os.makedirs(base_model_path, exist_ok=True)
|
| 33 |
+
snapshot_download(repo_id=model_id, local_dir=base_model_path)
|
| 34 |
+
|
| 35 |
+
# base_model_path =
|
| 36 |
+
# base_model_path =
|
| 37 |
face_detector = FaceAnalysis2(providers=['CPUExecutionProvider', 'CUDAExecutionProvider'], allowed_modules=['detection', 'recognition'])
|
| 38 |
face_detector.prepare(ctx_id=0, det_size=(640, 640))
|
| 39 |
|
|
|
|
| 384 |
num_outputs = gr.Slider(
|
| 385 |
label="Number of output images",
|
| 386 |
minimum=1,
|
| 387 |
+
maximum=18,
|
| 388 |
step=1,
|
| 389 |
value=2,
|
| 390 |
)
|