tonyassi commited on
Commit
bb5d34d
β€’
1 Parent(s): 2c6fd52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -24,7 +24,7 @@ def squarify_image(img):
24
  return bg
25
 
26
  @spaces.GPU()
27
- def blend(img1, img2, slider):
28
  img1.thumbnail((1024, 1024))
29
  img2.thumbnail((1024, 1024))
30
 
@@ -39,7 +39,7 @@ def blend(img1, img2, slider):
39
 
40
  prior_out = pipe_prior.interpolate(images_texts, weights)
41
 
42
- image = pipe(prompt='', **prior_out, height=1024, width=1024).images[0]
43
 
44
  return image
45
 
@@ -54,6 +54,9 @@ with gr.Blocks() as demo:
54
  img1 = gr.Image(label='Image 0', type='pil')
55
  img2 = gr.Image(label='Image 1',type='pil')
56
  slider = gr.Slider(label='Weight', maximum=1.0, value=0.5)
 
 
 
57
  btn = gr.Button("Blend")
58
  with gr.Column():
59
  output = gr.Image(label='Result')
 
24
  return bg
25
 
26
  @spaces.GPU()
27
+ def blend(img1, img2, slider, prompt, negative_prompt):
28
  img1.thumbnail((1024, 1024))
29
  img2.thumbnail((1024, 1024))
30
 
 
39
 
40
  prior_out = pipe_prior.interpolate(images_texts, weights)
41
 
42
+ image = pipe(prompt=prompt, **prior_out, height=1024, width=1024, negative_prompt=negative_prompt).images[0]
43
 
44
  return image
45
 
 
54
  img1 = gr.Image(label='Image 0', type='pil')
55
  img2 = gr.Image(label='Image 1',type='pil')
56
  slider = gr.Slider(label='Weight', maximum=1.0, value=0.5)
57
+ with gr.Accordion("See Details"):
58
+ prompt = gr.Textbox(label='Prompt')
59
+ negative_prompt = gr.Textbox(label='Negative Prompt')
60
  btn = gr.Button("Blend")
61
  with gr.Column():
62
  output = gr.Image(label='Result')