akameswa commited on
Commit
f5abddf
1 Parent(s): 19847b6

Rename run.py to app.py

Browse files
Files changed (1) hide show
  1. run.py → app.py +23 -23
run.py → app.py RENAMED
@@ -100,7 +100,7 @@ with gr.Blocks() as demo:
100
 
101
  with gr.TabItem("Denoising"):
102
  gr.Markdown("Observe the intermediate images during denoising.")
103
- gr.HTML(read_html("DiffusionDemo/html/denoising.html"))
104
 
105
  with gr.Row():
106
  with gr.Column():
@@ -162,7 +162,7 @@ with gr.Blocks() as demo:
162
  gr.Markdown(
163
  "Understand how different starting points in latent space can lead to different images."
164
  )
165
- gr.HTML(read_html("DiffusionDemo/html/seeds.html"))
166
 
167
  with gr.Row():
168
  with gr.Column():
@@ -195,7 +195,7 @@ with gr.Blocks() as demo:
195
 
196
  with gr.TabItem("Perturbations"):
197
  gr.Markdown("Explore different perturbations from a point in latent space.")
198
- gr.HTML(read_html("DiffusionDemo/html/perturbations.html"))
199
 
200
  with gr.Row():
201
  with gr.Column():
@@ -259,7 +259,7 @@ with gr.Blocks() as demo:
259
  gr.Markdown(
260
  "Generate a circular path in latent space and observe how the images vary along the path."
261
  )
262
- gr.HTML(read_html("DiffusionDemo/html/circular.html"))
263
 
264
  with gr.Row():
265
  with gr.Column():
@@ -339,7 +339,7 @@ with gr.Blocks() as demo:
339
 
340
  with gr.TabItem("Poke"):
341
  gr.Markdown("Perturb a region in the image and observe the effect.")
342
- gr.HTML(read_html("DiffusionDemo/html/poke.html"))
343
 
344
  with gr.Row():
345
  with gr.Column():
@@ -489,7 +489,7 @@ with gr.Blocks() as demo:
489
 
490
  with gr.TabItem("Guidance"):
491
  gr.Markdown("Observe the effect of different guidance scales.")
492
- gr.HTML(read_html("DiffusionDemo/html/guidance.html"))
493
 
494
  with gr.Row():
495
  with gr.Column():
@@ -541,7 +541,7 @@ with gr.Blocks() as demo:
541
 
542
  with gr.TabItem("Inpainting"):
543
  gr.Markdown("Inpaint the image based on the prompt.")
544
- gr.HTML(read_html("DiffusionDemo/html/inpainting.html"))
545
 
546
  with gr.Row():
547
  with gr.Column():
@@ -593,13 +593,13 @@ with gr.Blocks() as demo:
593
  gr.Markdown(
594
  "Visualize text embedding space in 3D with input texts and output images based on the chosen axis."
595
  )
596
- gr.HTML(read_html("DiffusionDemo/html/embeddings.html"))
597
 
598
  with gr.Row():
599
  output = gr.HTML(
600
  f"""
601
  <iframe id="html" src="{dash_tunnel}" style="width:100%; height:700px;"></iframe>
602
- """
603
  )
604
  with gr.Row():
605
  word2add_rem = gr.Textbox(lines=1, label="Add/Remove word")
@@ -873,7 +873,7 @@ with gr.Blocks() as demo:
873
  gr.Markdown(
874
  "Interpolate between the first and the second prompt, and observe how the output changes."
875
  )
876
- gr.HTML(read_html("DiffusionDemo/html/interpolate.html"))
877
 
878
  with gr.Row():
879
  with gr.Column():
@@ -942,7 +942,7 @@ with gr.Blocks() as demo:
942
 
943
  with gr.TabItem("Negative"):
944
  gr.Markdown("Observe the effect of negative prompts.")
945
- gr.HTML(read_html("DiffusionDemo/html/negative.html"))
946
 
947
  with gr.Row():
948
  with gr.Column():
@@ -1013,17 +1013,17 @@ def run_dash():
1013
  app.run(host="127.0.0.1", port="8000")
1014
 
1015
 
1016
- def run_gradio():
1017
- demo.queue()
1018
- _, _, public_url = demo.launch(share=True)
1019
- return public_url
1020
 
1021
 
1022
- # if __name__ == "__main__":
1023
- # thread = Thread(target=run_dash)
1024
- # thread.daemon = True
1025
- # thread.start()
1026
- # try:
1027
- # run_gradio()
1028
- # except KeyboardInterrupt:
1029
- # print("Server closed")
 
100
 
101
  with gr.TabItem("Denoising"):
102
  gr.Markdown("Observe the intermediate images during denoising.")
103
+ gr.HTML(read_html("html/denoising.html"))
104
 
105
  with gr.Row():
106
  with gr.Column():
 
162
  gr.Markdown(
163
  "Understand how different starting points in latent space can lead to different images."
164
  )
165
+ gr.HTML(read_html("html/seeds.html"))
166
 
167
  with gr.Row():
168
  with gr.Column():
 
195
 
196
  with gr.TabItem("Perturbations"):
197
  gr.Markdown("Explore different perturbations from a point in latent space.")
198
+ gr.HTML(read_html("html/perturbations.html"))
199
 
200
  with gr.Row():
201
  with gr.Column():
 
259
  gr.Markdown(
260
  "Generate a circular path in latent space and observe how the images vary along the path."
261
  )
262
+ gr.HTML(read_html("html/circular.html"))
263
 
264
  with gr.Row():
265
  with gr.Column():
 
339
 
340
  with gr.TabItem("Poke"):
341
  gr.Markdown("Perturb a region in the image and observe the effect.")
342
+ gr.HTML(read_html("html/poke.html"))
343
 
344
  with gr.Row():
345
  with gr.Column():
 
489
 
490
  with gr.TabItem("Guidance"):
491
  gr.Markdown("Observe the effect of different guidance scales.")
492
+ gr.HTML(read_html("html/guidance.html"))
493
 
494
  with gr.Row():
495
  with gr.Column():
 
541
 
542
  with gr.TabItem("Inpainting"):
543
  gr.Markdown("Inpaint the image based on the prompt.")
544
+ gr.HTML(read_html("html/inpainting.html"))
545
 
546
  with gr.Row():
547
  with gr.Column():
 
593
  gr.Markdown(
594
  "Visualize text embedding space in 3D with input texts and output images based on the chosen axis."
595
  )
596
+ gr.HTML(read_html("html/embeddings.html"))
597
 
598
  with gr.Row():
599
  output = gr.HTML(
600
  f"""
601
  <iframe id="html" src="{dash_tunnel}" style="width:100%; height:700px;"></iframe>
602
+ """
603
  )
604
  with gr.Row():
605
  word2add_rem = gr.Textbox(lines=1, label="Add/Remove word")
 
873
  gr.Markdown(
874
  "Interpolate between the first and the second prompt, and observe how the output changes."
875
  )
876
+ gr.HTML(read_html("html/interpolate.html"))
877
 
878
  with gr.Row():
879
  with gr.Column():
 
942
 
943
  with gr.TabItem("Negative"):
944
  gr.Markdown("Observe the effect of negative prompts.")
945
+ gr.HTML(read_html("html/negative.html"))
946
 
947
  with gr.Row():
948
  with gr.Column():
 
1013
  app.run(host="127.0.0.1", port="8000")
1014
 
1015
 
1016
+ # def run_gradio():
1017
+ # demo.queue()
1018
+ # _, _, public_url = demo.launch(share=True)
1019
+ # return public_url
1020
 
1021
 
1022
+ if __name__ == "__main__":
1023
+ thread = Thread(target=run_dash)
1024
+ thread.daemon = True
1025
+ thread.start()
1026
+ try:
1027
+ demo.queue().launch(share=True)
1028
+ except KeyboardInterrupt:
1029
+ print("Server closed")