yupeng.zhou commited on
Commit
67b37b2
1 Parent(s): bb17730
Files changed (1) hide show
  1. app.py +16 -3
app.py CHANGED
@@ -502,15 +502,15 @@ def change_visiale_by_model_type(_model_type):
502
 
503
 
504
  ######### Image Generation ##############
505
- @spaces.GPU(duration=90)
506
  def process_generation(_sd_type,_model_type,_upload_images, _num_steps,style_name, _Ip_Adapter_Strength ,_style_strength_ratio, guidance_scale, seed_, sa32_, sa64_, id_length_, general_prompt, negative_prompt,prompt_array,G_height,G_width,_comic_type):
507
  _model_type = "Photomaker" if _model_type == "Using Ref Images" else "original"
508
  if _model_type == "Photomaker" and "img" not in general_prompt:
509
  raise gr.Error("Please add the triger word \" img \" behind the class word you want to customize, such as: man img or woman img")
510
  if _upload_images is None and _model_type != "original":
511
  raise gr.Error(f"Cannot find any input face image!")
512
- if len(prompt_array.splitlines()) > 6:
513
- raise gr.Error(f"No more than 6 prompts in huggface demo for Speed! But found {len(prompt_array.splitlines()) > 6} prompts!")
514
  global sa32, sa64,id_length,total_length,attn_procs,unet,cur_model_type,device
515
  global num_steps
516
  global write
@@ -736,6 +736,19 @@ with gr.Blocks(css=css) as demo:
736
 
737
  gr.Examples(
738
  examples=[
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  [1,0.5,0.5,3,"a woman img, wearing a white T-shirt, blue loose hair",
740
  "bad anatomy, bad hands, missing fingers, extra fingers, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, three crus, fused feet, fused thigh, extra crus, ugly fingers, horn, cartoon, cg, 3d, unreal, animate, amputation, disconnected limbs",
741
  array2string(["wake up in the bed",
 
502
 
503
 
504
  ######### Image Generation ##############
505
+ @spaces.GPU(duration=120)
506
  def process_generation(_sd_type,_model_type,_upload_images, _num_steps,style_name, _Ip_Adapter_Strength ,_style_strength_ratio, guidance_scale, seed_, sa32_, sa64_, id_length_, general_prompt, negative_prompt,prompt_array,G_height,G_width,_comic_type):
507
  _model_type = "Photomaker" if _model_type == "Using Ref Images" else "original"
508
  if _model_type == "Photomaker" and "img" not in general_prompt:
509
  raise gr.Error("Please add the triger word \" img \" behind the class word you want to customize, such as: man img or woman img")
510
  if _upload_images is None and _model_type != "original":
511
  raise gr.Error(f"Cannot find any input face image!")
512
+ if len(prompt_array.splitlines()) > 10:
513
+ raise gr.Error(f"No more than 10 prompts in huggface demo for Speed! But found {len(prompt_array.splitlines())} prompts!")
514
  global sa32, sa64,id_length,total_length,attn_procs,unet,cur_model_type,device
515
  global num_steps
516
  global write
 
736
 
737
  gr.Examples(
738
  examples=[
739
+ [0,0.5,0.5,2,"a man, wearing black suit",
740
+ "bad anatomy, bad hands, missing fingers, extra fingers, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, three crus, fused feet, fused thigh, extra crus, ugly fingers, horn, cartoon, cg, 3d, unreal, animate, amputation, disconnected limbs",
741
+ array2string(["at home, read new paper #at home, The newspaper says there is a treasure house in the forest.",
742
+ "on the road, near the forest",
743
+ "[NC] The car on the road, near the forest #He drives to the forest in search of treasure.",
744
+ "[NC]A tiger appeared in the forest, at night ",
745
+ "very frightened, open mouth, in the forest, at night ",
746
+ "running very fast, in the forest, at night "
747
+ "[NC] A house in the forest, at night #Suddenly, he discovers the treasure house!",
748
+ "in the house filled with treasure, laughing, at night #He is overjoyed inside the house."
749
+ ]),
750
+ "Comic book","Only Using Textual Description",get_image_path_list('./examples/taylor'),768,768
751
+ ],
752
  [1,0.5,0.5,3,"a woman img, wearing a white T-shirt, blue loose hair",
753
  "bad anatomy, bad hands, missing fingers, extra fingers, three hands, three legs, bad arms, missing legs, missing arms, poorly drawn face, bad face, fused face, cloned face, three crus, fused feet, fused thigh, extra crus, ugly fingers, horn, cartoon, cg, 3d, unreal, animate, amputation, disconnected limbs",
754
  array2string(["wake up in the bed",