Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -20,7 +20,7 @@ from style_template import styles
|
|
20 |
from aspect_ratio_template import aspect_ratios
|
21 |
|
22 |
# global variable
|
23 |
-
base_model_path = 'SG161222/RealVisXL_V5.
|
24 |
face_detector = FaceAnalysis2(providers=['CPUExecutionProvider', 'CUDAExecutionProvider'], allowed_modules=['detection', 'recognition'])
|
25 |
face_detector.prepare(ctx_id=0, det_size=(640, 640))
|
26 |
|
@@ -80,13 +80,14 @@ pipe.load_photomaker_adapter(
|
|
80 |
pipe.id_encoder.to(device)
|
81 |
|
82 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
83 |
-
|
84 |
pipe.fuse_lora()
|
85 |
pipe.to(device)
|
86 |
|
87 |
|
88 |
pipe.enable_vae_slicing()
|
89 |
pipe.enable_vae_tiling()
|
|
|
90 |
@spaces.GPU(duration=120)
|
91 |
def generate_image(
|
92 |
upload_images,
|
|
|
20 |
from aspect_ratio_template import aspect_ratios
|
21 |
|
22 |
# global variable
|
23 |
+
base_model_path = 'SG161222/RealVisXL_V5.0_Lightning'
|
24 |
face_detector = FaceAnalysis2(providers=['CPUExecutionProvider', 'CUDAExecutionProvider'], allowed_modules=['detection', 'recognition'])
|
25 |
face_detector.prepare(ctx_id=0, det_size=(640, 640))
|
26 |
|
|
|
80 |
pipe.id_encoder.to(device)
|
81 |
|
82 |
pipe.scheduler = EulerDiscreteScheduler.from_config(pipe.scheduler.config)
|
83 |
+
pipe.set_adapters(["photomaker"], adapter_weights=[1.0])
|
84 |
pipe.fuse_lora()
|
85 |
pipe.to(device)
|
86 |
|
87 |
|
88 |
pipe.enable_vae_slicing()
|
89 |
pipe.enable_vae_tiling()
|
90 |
+
pipe.enable_xformers_memory_efficient_attention()
|
91 |
@spaces.GPU(duration=120)
|
92 |
def generate_image(
|
93 |
upload_images,
|