adaface-neurips commited on
Commit
62cfb53
1 Parent(s): f4d87fd

gen_init_images() uses a larger adaface_id_cfg_scale to generate more authentic faces

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -76,9 +76,11 @@ def gen_init_images(uploaded_image_paths, prompt, adaface_id_cfg_scale, out_imag
76
  # [('/tmp/gradio/249981e66a7c665aaaf1c7eaeb24949af4366c88/jensen huang.jpg', None)]
77
  # Extract the file paths.
78
  uploaded_image_paths = [path[0] for path in uploaded_image_paths]
 
 
79
  adaface_subj_embs = \
80
  adaface.generate_adaface_embeddings(image_folder=None, image_paths=uploaded_image_paths,
81
- out_id_embs_scale=adaface_id_cfg_scale, update_text_encoder=True)
82
 
83
  if adaface_subj_embs is None:
84
  raise gr.Error(f"Failed to detect any faces! Please try with other images")
@@ -300,7 +302,7 @@ with gr.Blocks(css=css) as demo:
300
  filterable=False,
301
  choices=[
302
  "woman ((best quality)), ((masterpiece)), ((realistic)), long highlighted hair, futuristic silver armor suit, confident stance, high-resolution, living room, smiling, head tilted, perfect smooth skin",
303
- "woman walking on the beach, sunset, orange sky, bright lighting, ocean waves seagulls, rippling water, serene atmosphere, eye level shot",
304
  "woman in a white apron and chef hat, garnishing a gourmet dish, full body view, long shot",
305
  "woman dancing pose among folks in a park, waving hands",
306
  "woman in iron man costume flying pose, the sky ablaze with hues of orange and purple, full body view, long shot",
 
76
  # [('/tmp/gradio/249981e66a7c665aaaf1c7eaeb24949af4366c88/jensen huang.jpg', None)]
77
  # Extract the file paths.
78
  uploaded_image_paths = [path[0] for path in uploaded_image_paths]
79
+ # gen_init_images() uses a larger adaface_id_cfg_scale to generate more authentic faces.
80
+ adaface_id_cfg_scale_ = max(6, adaface_id_cfg_scale * 2)
81
  adaface_subj_embs = \
82
  adaface.generate_adaface_embeddings(image_folder=None, image_paths=uploaded_image_paths,
83
+ out_id_embs_scale=adaface_id_cfg_scale_, update_text_encoder=True)
84
 
85
  if adaface_subj_embs is None:
86
  raise gr.Error(f"Failed to detect any faces! Please try with other images")
 
302
  filterable=False,
303
  choices=[
304
  "woman ((best quality)), ((masterpiece)), ((realistic)), long highlighted hair, futuristic silver armor suit, confident stance, high-resolution, living room, smiling, head tilted, perfect smooth skin",
305
+ "woman walking on the beach, sunset, orange sky, eye level shot",
306
  "woman in a white apron and chef hat, garnishing a gourmet dish, full body view, long shot",
307
  "woman dancing pose among folks in a park, waving hands",
308
  "woman in iron man costume flying pose, the sky ablaze with hues of orange and purple, full body view, long shot",