Spaces:
Running
Running
Removed controls
Browse files
frontend/webui/text_to_image_ui.py
CHANGED
@@ -22,11 +22,8 @@ previous_num_of_images = 0
|
|
22 |
|
23 |
def generate_text_to_image(
|
24 |
prompt,
|
25 |
-
image_height,
|
26 |
-
image_width,
|
27 |
inference_steps,
|
28 |
guidance_scale,
|
29 |
-
num_images,
|
30 |
seed,
|
31 |
use_openvino,
|
32 |
use_safety_checker,
|
@@ -41,11 +38,11 @@ def generate_text_to_image(
|
|
41 |
lcm_diffusion_settings = LCMDiffusionSetting(
|
42 |
lcm_model_id=model_id,
|
43 |
prompt=prompt,
|
44 |
-
image_height=
|
45 |
-
image_width=
|
46 |
inference_steps=inference_steps,
|
47 |
guidance_scale=guidance_scale,
|
48 |
-
number_of_images=
|
49 |
seed=seed,
|
50 |
use_openvino=use_openvino,
|
51 |
use_safety_checker=use_safety_checker,
|
@@ -58,23 +55,23 @@ def generate_text_to_image(
|
|
58 |
if use_openvino:
|
59 |
reshape = is_reshape_required(
|
60 |
previous_width,
|
61 |
-
|
62 |
previous_height,
|
63 |
-
|
64 |
previous_model_id,
|
65 |
model_id,
|
66 |
previous_num_of_images,
|
67 |
-
|
68 |
)
|
69 |
images = context.generate_text_to_image(
|
70 |
settings,
|
71 |
reshape,
|
72 |
DEVICE,
|
73 |
)
|
74 |
-
previous_width =
|
75 |
-
previous_height =
|
76 |
previous_model_id = model_id
|
77 |
-
previous_num_of_images =
|
78 |
|
79 |
return images
|
80 |
|
@@ -138,27 +135,24 @@ def get_text_to_image_ui(app_settings: AppSettings) -> None:
|
|
138 |
num_inference_steps = gr.Slider(
|
139 |
1, 8, value=4, step=1, label="Inference Steps"
|
140 |
)
|
141 |
-
image_height = gr.Slider(
|
142 |
-
|
143 |
-
)
|
144 |
-
image_width = gr.Slider(
|
145 |
-
|
146 |
-
)
|
147 |
-
num_images = gr.Slider(
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
)
|
154 |
|
155 |
input_params = [
|
156 |
prompt,
|
157 |
-
image_height,
|
158 |
-
image_width,
|
159 |
num_inference_steps,
|
160 |
guidance_scale,
|
161 |
-
num_images,
|
162 |
seed,
|
163 |
openvino_checkbox,
|
164 |
safety_checker_checkbox,
|
|
|
22 |
|
23 |
def generate_text_to_image(
|
24 |
prompt,
|
|
|
|
|
25 |
inference_steps,
|
26 |
guidance_scale,
|
|
|
27 |
seed,
|
28 |
use_openvino,
|
29 |
use_safety_checker,
|
|
|
38 |
lcm_diffusion_settings = LCMDiffusionSetting(
|
39 |
lcm_model_id=model_id,
|
40 |
prompt=prompt,
|
41 |
+
image_height=384,
|
42 |
+
image_width=384,
|
43 |
inference_steps=inference_steps,
|
44 |
guidance_scale=guidance_scale,
|
45 |
+
number_of_images=1,
|
46 |
seed=seed,
|
47 |
use_openvino=use_openvino,
|
48 |
use_safety_checker=use_safety_checker,
|
|
|
55 |
if use_openvino:
|
56 |
reshape = is_reshape_required(
|
57 |
previous_width,
|
58 |
+
384,
|
59 |
previous_height,
|
60 |
+
384,
|
61 |
previous_model_id,
|
62 |
model_id,
|
63 |
previous_num_of_images,
|
64 |
+
1,
|
65 |
)
|
66 |
images = context.generate_text_to_image(
|
67 |
settings,
|
68 |
reshape,
|
69 |
DEVICE,
|
70 |
)
|
71 |
+
previous_width = 384
|
72 |
+
previous_height = 384
|
73 |
previous_model_id = model_id
|
74 |
+
previous_num_of_images = 1
|
75 |
|
76 |
return images
|
77 |
|
|
|
135 |
num_inference_steps = gr.Slider(
|
136 |
1, 8, value=4, step=1, label="Inference Steps"
|
137 |
)
|
138 |
+
# image_height = gr.Slider(
|
139 |
+
# 256, 768, value=384, step=64, label="Image Height",interactive=Fa
|
140 |
+
# )
|
141 |
+
# image_width = gr.Slider(
|
142 |
+
# 256, 768, value=384, step=64, label="Image Width"
|
143 |
+
# )
|
144 |
+
# num_images = gr.Slider(
|
145 |
+
# 1,
|
146 |
+
# 50,
|
147 |
+
# value=1,
|
148 |
+
# step=1,
|
149 |
+
# label="Number of images to generate",
|
150 |
+
# )
|
151 |
|
152 |
input_params = [
|
153 |
prompt,
|
|
|
|
|
154 |
num_inference_steps,
|
155 |
guidance_scale,
|
|
|
156 |
seed,
|
157 |
openvino_checkbox,
|
158 |
safety_checker_checkbox,
|