Spaces:
Running
Running
added prompt log
Browse files
frontend/webui/hf_demo.py
CHANGED
@@ -9,6 +9,7 @@ import base64
|
|
9 |
from backend.device import get_device_name
|
10 |
from constants import APP_VERSION
|
11 |
from backend.device import is_openvino_device
|
|
|
12 |
|
13 |
lcm_text_to_image = LCMTextToImage()
|
14 |
lcm_lora = LCMLora(
|
@@ -41,7 +42,7 @@ def predict(
|
|
41 |
use_lora=False,
|
42 |
lcm_lora=lcm_lora,
|
43 |
)
|
44 |
-
|
45 |
lcm_diffusion_setting = LCMDiffusionSetting()
|
46 |
lcm_diffusion_setting.prompt = prompt
|
47 |
lcm_diffusion_setting.guidance_scale = 1.0
|
@@ -55,7 +56,7 @@ def predict(
|
|
55 |
images = lcm_text_to_image.generate(lcm_diffusion_setting)
|
56 |
latency = perf_counter() - start
|
57 |
print(f"Latency: {latency:.2f} seconds")
|
58 |
-
return images[0]
|
59 |
|
60 |
|
61 |
css = """
|
|
|
9 |
from backend.device import get_device_name
|
10 |
from constants import APP_VERSION
|
11 |
from backend.device import is_openvino_device
|
12 |
+
import PIL
|
13 |
|
14 |
lcm_text_to_image = LCMTextToImage()
|
15 |
lcm_lora = LCMLora(
|
|
|
42 |
use_lora=False,
|
43 |
lcm_lora=lcm_lora,
|
44 |
)
|
45 |
+
print(f"prompt - {prompt}")
|
46 |
lcm_diffusion_setting = LCMDiffusionSetting()
|
47 |
lcm_diffusion_setting.prompt = prompt
|
48 |
lcm_diffusion_setting.guidance_scale = 1.0
|
|
|
56 |
images = lcm_text_to_image.generate(lcm_diffusion_setting)
|
57 |
latency = perf_counter() - start
|
58 |
print(f"Latency: {latency:.2f} seconds")
|
59 |
+
return images[0].resize([512, 512], PIL.Image.ANTIALIAS)
|
60 |
|
61 |
|
62 |
css = """
|