fffiloni commited on
Commit
18905b7
·
verified ·
1 Parent(s): 4a902da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -1
app.py CHANGED
@@ -14,9 +14,23 @@ def generate_image(prompt):
14
 
15
  # Run the main function
16
  main(args)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  # Return the path to the generated image
19
- return f"{args.save_dir}/{args.task}/{args.model}_{args.prompt}/best_image.png"
20
 
21
  # Create Gradio interface
22
  iface = gr.Interface(
 
14
 
15
  # Run the main function
16
  main(args)
17
+
18
+ settings = (
19
+ f"{args.model}{'_' + args.prompt if args.task == 't2i-compbench' else ''}"
20
+ f"{'_no-optim' if args.no_optim else ''}_{args.seed if args.task != 'geneval' else ''}"
21
+ f"_lr{args.lr}_gc{args.grad_clip}_iter{args.n_iters}"
22
+ f"_reg{args.reg_weight if args.enable_reg else '0'}"
23
+ f"{'_pickscore' + str(args.pickscore_weighting) if args.enable_pickscore else ''}"
24
+ f"{'_clip' + str(args.clip_weighting) if args.enable_clip else ''}"
25
+ f"{'_hps' + str(args.hps_weighting) if args.enable_hps else ''}"
26
+ f"{'_imagereward' + str(args.imagereward_weighting) if args.enable_imagereward else ''}"
27
+ f"{'_aesthetic' + str(args.aesthetic_weighting) if args.enable_aesthetic else ''}"
28
+ )
29
+
30
+ save_dir = f"{args.save_dir}/{args.task}/{settings}/{args.prompt}"
31
 
32
  # Return the path to the generated image
33
+ return f"{save_dir}/best_image.png"
34
 
35
  # Create Gradio interface
36
  iface = gr.Interface(