RamAnanth1 commited on
Commit
bfb8280
1 Parent(s): 253797e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -12,7 +12,9 @@ def infer(prompt):
12
  gen = torch.Generator(device=device)
13
 
14
  gen.manual_seed(21)
15
- out = pipe(prompt=prompt, generator=gen, num_images_per_prompt=1, guidance_scale=7,
 
 
16
  editing_prompt=['male person', # Concepts to apply
17
  'female person'],
18
  reverse_editing_direction=[True, False], # Direction of guidance i.e. decrease the first and increase the second concept
@@ -23,9 +25,9 @@ def infer(prompt):
23
  edit_mom_beta=0.6, # Momentum beta
24
  edit_weights=[1,1] # Weights of the individual concepts against each other
25
  )
26
- image = out.images[0]
27
 
28
- return [image]
29
 
30
 
31
  css = """
 
12
  gen = torch.Generator(device=device)
13
 
14
  gen.manual_seed(21)
15
+ out = pipe(prompt=prompt, generator=gen, num_images_per_prompt=1, guidance_scale=7)
16
+ images = out.images[0]
17
+ out_edit = pipe(prompt=prompt, generator=gen, num_images_per_prompt=1, guidance_scale=7,
18
  editing_prompt=['male person', # Concepts to apply
19
  'female person'],
20
  reverse_editing_direction=[True, False], # Direction of guidance i.e. decrease the first and increase the second concept
 
25
  edit_mom_beta=0.6, # Momentum beta
26
  edit_weights=[1,1] # Weights of the individual concepts against each other
27
  )
28
+ images_edited = out_edit.images[0]
29
 
30
+ return [images, images_edited]
31
 
32
 
33
  css = """