rupeshs commited on
Commit
1296453
1 Parent(s): df37248

Added seed check box

Browse files
Files changed (1) hide show
  1. frontend/webui/hf_demo.py +11 -5
frontend/webui/hf_demo.py CHANGED
@@ -35,6 +35,7 @@ def predict(
35
  prompt,
36
  steps,
37
  seed,
 
38
  ):
39
  lcm_text_to_image.init(
40
  model_id=LCM_DEFAULT_MODEL_OPENVINO,
@@ -48,9 +49,9 @@ def predict(
48
  lcm_diffusion_setting.guidance_scale = 1.0
49
  lcm_diffusion_setting.inference_steps = steps
50
  lcm_diffusion_setting.seed = seed
51
- lcm_diffusion_setting.use_seed = True
52
- lcm_diffusion_setting.image_width = 384 if is_openvino_device() else 512
53
- lcm_diffusion_setting.image_height = 384 if is_openvino_device() else 512
54
  lcm_diffusion_setting.use_openvino = True if is_openvino_device() else False
55
  start = perf_counter()
56
  images = lcm_text_to_image.generate(lcm_diffusion_setting)
@@ -95,7 +96,7 @@ with gr.Blocks(css=css) as demo:
95
  with gr.Column(elem_id="container"):
96
  use_openvino = "- OpenVINO" if is_openvino_device() else ""
97
  gr.Markdown(
98
- f"""# FastSD CPU {use_openvino}
99
  **Device : {DEVICE.upper()} , {get_device_name()}**
100
  """,
101
  elem_id="intro",
@@ -120,7 +121,7 @@ with gr.Blocks(css=css) as demo:
120
  label="Steps",
121
  value=3 if is_openvino_device() else 3,
122
  minimum=1,
123
- maximum=6,
124
  step=1,
125
  )
126
  seed = gr.Slider(
@@ -130,6 +131,11 @@ with gr.Blocks(css=css) as demo:
130
  label="Seed",
131
  step=1,
132
  )
 
 
 
 
 
133
  gr.HTML(_get_footer_message())
134
 
135
  inputs = [prompt, steps, seed]
 
35
  prompt,
36
  steps,
37
  seed,
38
+ use_seed,
39
  ):
40
  lcm_text_to_image.init(
41
  model_id=LCM_DEFAULT_MODEL_OPENVINO,
 
49
  lcm_diffusion_setting.guidance_scale = 1.0
50
  lcm_diffusion_setting.inference_steps = steps
51
  lcm_diffusion_setting.seed = seed
52
+ lcm_diffusion_setting.use_seed = use_seed
53
+ lcm_diffusion_setting.image_width = 320 if is_openvino_device() else 512
54
+ lcm_diffusion_setting.image_height = 320 if is_openvino_device() else 512
55
  lcm_diffusion_setting.use_openvino = True if is_openvino_device() else False
56
  start = perf_counter()
57
  images = lcm_text_to_image.generate(lcm_diffusion_setting)
 
96
  with gr.Column(elem_id="container"):
97
  use_openvino = "- OpenVINO" if is_openvino_device() else ""
98
  gr.Markdown(
99
+ f"""# FastSD CPU demo {use_openvino}
100
  **Device : {DEVICE.upper()} , {get_device_name()}**
101
  """,
102
  elem_id="intro",
 
121
  label="Steps",
122
  value=3 if is_openvino_device() else 3,
123
  minimum=1,
124
+ maximum=4,
125
  step=1,
126
  )
127
  seed = gr.Slider(
 
131
  label="Seed",
132
  step=1,
133
  )
134
+ seed_checkbox = gr.Checkbox(
135
+ label="Use seed",
136
+ value=False,
137
+ interactive=True,
138
+ )
139
  gr.HTML(_get_footer_message())
140
 
141
  inputs = [prompt, steps, seed]