ysharma HF staff commited on
Commit
3de8dde
1 Parent(s): 3548cd4

updated random seeding for synth edit

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -44,7 +44,7 @@ def synthetic_image_edit(prompt, task_name): #, progress=gr.Progress(track_tqdm=
44
  #img_name = f"./input_image_{seed}.png"
45
  #img_label = f"./input_image_{seed}"
46
  # Run the script file
47
- subprocess.run(["python", "src/edit_synthetic.py", "--prompt_str", prompt,
48
  "--task", task_name, "--results_folder", "output/synth_editing"])
49
  return f"output/synth_editing/reconstruction{seed}.png", f"output/synth_editing/edit{seed}.png"
50
 
@@ -72,8 +72,8 @@ with gr.Blocks() as demo:
72
  </div>
73
  <p style="margin-bottom: 10px; font-size: 94%">
74
  This is an unofficial demo for <a href="https://pix2pixzero.github.io/" target="_blank">Pix2PixZero</a>.
75
- Please visit their website and <a href="https://github.com/pix2pixzero/pix2pix-zero" target="_blank">github repo</a> for more details.
76
- </p></div>""")
77
  gr.HTML("""<a href="https://huggingface.co/spaces/ysharma/pix2pix-zero-01?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate this Space and upgrade to a GPU for fast Inference & no queue<br>""")
78
 
79
  direction_html = gr.HTML(value="<h4>👇Upload a Dog or a Cat image here to get started👇</h4>", visible=True)
@@ -135,5 +135,5 @@ with gr.Blocks() as demo:
135
  image_in.change(set_visible_true, [], blip_prompt)
136
  image_in.change(set_visible_true, [], inversion_file)
137
 
138
- demo.queue(concurrency_count=3)
139
  demo.launch(debug=True)
 
44
  #img_name = f"./input_image_{seed}.png"
45
  #img_label = f"./input_image_{seed}"
46
  # Run the script file
47
+ subprocess.run(["python", "src/edit_synthetic.py", "--prompt_str", prompt, "--seed", str(seed),
48
  "--task", task_name, "--results_folder", "output/synth_editing"])
49
  return f"output/synth_editing/reconstruction{seed}.png", f"output/synth_editing/edit{seed}.png"
50
 
 
72
  </div>
73
  <p style="margin-bottom: 10px; font-size: 94%">
74
  This is an unofficial demo for <a href="https://pix2pixzero.github.io/" target="_blank">Pix2PixZero</a>.
75
+ Please visit their website and <a href="https://github.com/pix2pixzero/pix2pix-zero" target="_blank">github repo</a> for more details.<br>
76
+ If you encounter an error at any step, it can be due to Cuda Emmory Error as multiple users are trying to access the app at same time. In such cases, it is suggested to start over with same/different image.</p></div>""")
77
  gr.HTML("""<a href="https://huggingface.co/spaces/ysharma/pix2pix-zero-01?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate this Space and upgrade to a GPU for fast Inference & no queue<br>""")
78
 
79
  direction_html = gr.HTML(value="<h4>👇Upload a Dog or a Cat image here to get started👇</h4>", visible=True)
 
135
  image_in.change(set_visible_true, [], blip_prompt)
136
  image_in.change(set_visible_true, [], inversion_file)
137
 
138
+ demo.queue(concurrency_count=8)
139
  demo.launch(debug=True)