listen2you linoyts HF Staff commited on
Commit
89a0b55
verified
1 Parent(s): 2d5a2f2

add examples (#3)

Browse files

- Upload 8 files (9b6844a2a61f8eedf7509d8fa2077501fb7352ea)
- Update app.py (abd3b00d363f6c8f7cda2c601e658f3e49466db7)


Co-authored-by: Linoy Tsaban <[email protected]>

.gitattributes CHANGED
@@ -33,3 +33,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ examples[[:space:]]2/celeb_meme.jpg filter=lfs diff=lfs merge=lfs -text
37
+ examples[[:space:]]2/cookie.png filter=lfs diff=lfs merge=lfs -text
38
+ examples[[:space:]]2/leather.jpg filter=lfs diff=lfs merge=lfs -text
39
+ examples[[:space:]]2/no_cookie.png filter=lfs diff=lfs merge=lfs -text
40
+ examples[[:space:]]2/poster_orig.jpg filter=lfs diff=lfs merge=lfs -text
app.py CHANGED
@@ -26,6 +26,17 @@ from modules.model_edit import Step1XParams, Step1XEdit
26
 
27
  print("TORCH_CUDA", torch.cuda.is_available())
28
 
 
 
 
 
 
 
 
 
 
 
 
29
  def load_state_dict(model, ckpt_path, device="cuda", strict=False, assign=True):
30
  if Path(ckpt_path).suffix == ".safetensors":
31
  state_dict = load_file(ckpt_path, device)
@@ -444,7 +455,7 @@ with gr.Blocks() as demo:
444
  with gr.Row():
445
  with gr.Column():
446
  prompt = gr.Textbox(
447
- label="缂栬緫鎸囦护",
448
  value='Remove the person from the image.',
449
  )
450
  init_image = gr.Image(label="Input Image", type='pil')
@@ -470,4 +481,12 @@ with gr.Blocks() as demo:
470
  outputs=[output_image, output_random_seed],
471
  )
472
 
 
 
 
 
 
 
 
 
473
  demo.launch()
 
26
 
27
  print("TORCH_CUDA", torch.cuda.is_available())
28
 
29
+ examples = [
30
+ ["examples 2/meme.jpg", "turn into an illustration in studio ghibli style",("examples 2/meme.jpg","examples 2/ghibli_meme.jpg"),],
31
+ ["examples 2/celeb_meme.jpg", "replace the gray blazer with a leather jacket",("examples 2/celeb_meme.jpg","examples 2/leather.jpg")],
32
+ ["examples 2/cookie.png", "remove the cookie",("examples 2/cookie.png","examples 2/no_cookie.png")],
33
+ ["examples 2/poster_orig.jpg", "replace 'lambs' with 'llamas'",("examples 2/poster_orig.jpg","examples 2/poster.jpg")],
34
+ ]
35
+
36
+ def generate_examples(init_image, output_image, prompt):
37
+ return init_image, output_image, prompt
38
+
39
+
40
  def load_state_dict(model, ckpt_path, device="cuda", strict=False, assign=True):
41
  if Path(ckpt_path).suffix == ".safetensors":
42
  state_dict = load_file(ckpt_path, device)
 
455
  with gr.Row():
456
  with gr.Column():
457
  prompt = gr.Textbox(
458
+ label="缂栬緫鎸囦护 prompt",
459
  value='Remove the person from the image.',
460
  )
461
  init_image = gr.Image(label="Input Image", type='pil')
 
481
  outputs=[output_image, output_random_seed],
482
  )
483
 
484
+ gr.Examples(
485
+ examples,
486
+ inputs=[init_image, prompt, output_image],
487
+ outputs=[init_image, prompt, output_image],
488
+ fn=generate_examples,
489
+ cache_examples=False
490
+ )
491
+
492
  demo.launch()
examples 2/celeb_meme.jpg ADDED

Git LFS Details

  • SHA256: 4fb2ccab4218dba753781d65e8f5933f8ab7613543b59a7b4512a6654fe55a4f
  • Pointer size: 131 Bytes
  • Size of remote file: 267 kB
examples 2/cookie.png ADDED

Git LFS Details

  • SHA256: 328bf4f4779cd6235016a217eaf5dc1ef7a8f1cb95e8fbd7ee538ac6824e75b0
  • Pointer size: 131 Bytes
  • Size of remote file: 543 kB
examples 2/ghibli_meme.jpg ADDED
examples 2/leather.jpg ADDED

Git LFS Details

  • SHA256: efa1eab6d7fa83b2bb39631b194012cf01cca24356b624f32e0fd05346af3ec2
  • Pointer size: 131 Bytes
  • Size of remote file: 250 kB
examples 2/meme.jpg ADDED
examples 2/no_cookie.png ADDED

Git LFS Details

  • SHA256: 4ee90a1e41774e2dae54ca436874341e750f2c7a6196b8360aee1952e98066f8
  • Pointer size: 131 Bytes
  • Size of remote file: 162 kB
examples 2/poster.jpg ADDED
examples 2/poster_orig.jpg ADDED

Git LFS Details

  • SHA256: 92a4178a56e7fefd7dfd418c675c1ab6b6b2e00e17b45a778a1100ab62f9bfba
  • Pointer size: 131 Bytes
  • Size of remote file: 458 kB