ysharma HF staff commited on
Commit
eb96bac
1 Parent(s): b896206

updated the synth translation code

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -76,11 +76,13 @@ with gr.Blocks() as demo:
76
  with gr.Column():
77
  task_name_radio = gr.Radio(choices = ["cat2dog", "dog2cat",], type="value", visible=False, label="Select a task that you want to accomplish") #, value="cat2dog"),
78
  btn_imageedit = gr.Button(value="Edit the image!",visible=False)
79
- prompt_synth = gr.Textbox(visible=False)
80
- btn_synth_image = gr.Button(value="Generate & Translate SD image",visible=False)
81
- with gr.Row():
82
- image_synth = gr.Image(visible=False, label="Synthetic image generated by Stable Diffusion on the fly")
83
- image_synth_translated = gr.Image(visible=False, label="Translated synthetic image")
 
 
84
 
85
  btn_inversion.click(inversion,[image_in],[inversion_file, blip_prompt])
86
  btn_inversion.click(set_visible_true, [], task_name_radio) #inversion_file, blip_prompt,
@@ -90,6 +92,7 @@ with gr.Blocks() as demo:
90
 
91
  task_name_radio.change(set_visible_true, [], btn_imageedit)
92
  task_name_radio.change(set_visible_true, [], image_out)
 
93
 
94
  btn_imageedit.click(image_edit,[task_name_radio],[image_out])
95
  btn_imageedit.click(set_visible_False, [], btn_imageedit)
 
76
  with gr.Column():
77
  task_name_radio = gr.Radio(choices = ["cat2dog", "dog2cat",], type="value", visible=False, label="Select a task that you want to accomplish") #, value="cat2dog"),
78
  btn_imageedit = gr.Button(value="Edit the image!",visible=False)
79
+ html_tag = gr.HTML(value="""<h3 style="font-weight: 900; margin-bottom: 7px; margin-top: 5px;">
80
+ Generate synthetic images using Stable Diffusion and Translate them on the fly using Pix2Pix-Zero</h3>""", visible=False)
81
+ prompt_synth = gr.Textbox(visible=False, label="Type in a prompt to generate an Image using SD")
82
+ btn_synth_image = gr.Button(value="Generate & Translate the SD image",visible=False)
83
+ with gr.Row():
84
+ image_synth = gr.Image(visible=False, label="Synthetic image generated by Stable Diffusion on the fly")
85
+ image_synth_translated = gr.Image(visible=False, label="Translated synthetic image")
86
 
87
  btn_inversion.click(inversion,[image_in],[inversion_file, blip_prompt])
88
  btn_inversion.click(set_visible_true, [], task_name_radio) #inversion_file, blip_prompt,
 
92
 
93
  task_name_radio.change(set_visible_true, [], btn_imageedit)
94
  task_name_radio.change(set_visible_true, [], image_out)
95
+ task_name_radio.change(set_visible_true, [], html_tag)
96
 
97
  btn_imageedit.click(image_edit,[task_name_radio],[image_out])
98
  btn_imageedit.click(set_visible_False, [], btn_imageedit)