multimodalart HF staff commited on
Commit
b777a65
1 Parent(s): 74f1b98

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -6
app.py CHANGED
@@ -54,7 +54,8 @@ def generate(concept_1, concept_2, scale, prompt, seed, recalc_directions, itera
54
  avg_diff_x,
55
  img2img_type = None, img = None,
56
  controlnet_scale= None, ip_adapter_scale=None,
57
- total_images=[]
 
58
  ):
59
  slider_x = [concept_1, concept_2]
60
  # check if avg diff for directions need to be re-calculated
@@ -95,7 +96,7 @@ def generate(concept_1, concept_2, scale, prompt, seed, recalc_directions, itera
95
  def update_scales(x,prompt,seed, steps, interm_steps, guidance_scale,
96
  avg_diff_x,
97
  img2img_type = None, img = None,
98
- controlnet_scale= None, ip_adapter_scale=None, total_images=[]):
99
  print("Hola", x)
100
  avg_diff = avg_diff_x.cuda()
101
 
@@ -140,7 +141,7 @@ def update_pre_generated_images(slider_value, total_images):
140
  def reset_recalc_directions():
141
  return True
142
 
143
- css = '''
144
  #group {
145
  position: relative;
146
  width: 600px; /* Increased width */
@@ -186,7 +187,10 @@ intro = """
186
  <img style="margin-top: -1em;margin-bottom: 0em;position: absolute;" src="https://bit.ly/3CWLGkA" alt="Duplicate Space"></a>
187
  </p>
188
  """
189
- with gr.Blocks() as demo:
 
 
 
190
 
191
  gr.HTML(intro)
192
 
@@ -219,10 +223,10 @@ with gr.Blocks() as demo:
219
  #y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
220
  with gr.Row():
221
  with gr.Column(scale=4, min_width=50):
222
- image_seq = gr.Image(label="Strip")
223
 
224
  with gr.Column(scale=2, min_width=50):
225
- output_image = gr.Image(elem_id="image_out", label="Gif")
226
  # with gr.Row():
227
  # generate_butt = gr.Button("generate")
228
 
 
54
  avg_diff_x,
55
  img2img_type = None, img = None,
56
  controlnet_scale= None, ip_adapter_scale=None,
57
+ total_images=[],
58
+ progress=gr.Progress(track_tqdm=True)
59
  ):
60
  slider_x = [concept_1, concept_2]
61
  # check if avg diff for directions need to be re-calculated
 
96
  def update_scales(x,prompt,seed, steps, interm_steps, guidance_scale,
97
  avg_diff_x,
98
  img2img_type = None, img = None,
99
+ controlnet_scale= None, ip_adapter_scale=None, total_images=[], progress=gr.Progress(track_tqdm=True)):
100
  print("Hola", x)
101
  avg_diff = avg_diff_x.cuda()
102
 
 
141
  def reset_recalc_directions():
142
  return True
143
 
144
+ css_old = '''
145
  #group {
146
  position: relative;
147
  width: 600px; /* Increased width */
 
187
  <img style="margin-top: -1em;margin-bottom: 0em;position: absolute;" src="https://bit.ly/3CWLGkA" alt="Duplicate Space"></a>
188
  </p>
189
  """
190
+ css='''
191
+ #strip, #gif{min-height: 50px}
192
+ '''
193
+ with gr.Blocks(css=css) as demo:
194
 
195
  gr.HTML(intro)
196
 
 
223
  #y = gr.Slider(minimum=-10, value=0, maximum=10, elem_id="y", interactive=False)
224
  with gr.Row():
225
  with gr.Column(scale=4, min_width=50):
226
+ image_seq = gr.Image(label="Strip", elem_id="strip")
227
 
228
  with gr.Column(scale=2, min_width=50):
229
+ output_image = gr.Image(elem_id="image_out", label="Gif", elem_id="gif")
230
  # with gr.Row():
231
  # generate_butt = gr.Button("generate")
232