Spaces:
Runtime error
Runtime error
updated layout
Browse files
app.py
CHANGED
|
@@ -56,19 +56,34 @@ theme = gr.themes.Monochrome(
|
|
| 56 |
neutral_hue="cyan",
|
| 57 |
radius_size="md",
|
| 58 |
spacing_size="sm",)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
with gr.Blocks(theme=theme) as demo:
|
| 60 |
-
|
|
|
|
|
|
|
| 61 |
with gr.Column(scale=4):
|
| 62 |
prompt = gr.Textbox(label='Prompt')
|
| 63 |
neg_prompt = gr.Textbox(label='Negative Prompt')
|
| 64 |
with gr.Column(scale=1):
|
| 65 |
b1 = gr.Button("Generate 'IF' Output").style(full_width=True)
|
| 66 |
-
with gr.Row():
|
| 67 |
with gr.Column():
|
| 68 |
gallery_if = gr.Gallery(label='IF Space outputs', ).style(columns=4, object_fit="contain", preview=True)
|
| 69 |
b2 = gr.Button("Get the best generation using Pick-A-Pic")
|
| 70 |
image_picakapic = gr.Image(label="PickAPic Evaluated Output")
|
| 71 |
-
|
| 72 |
b1.click(get_IF_op,[prompt, neg_prompt], gallery_if)
|
| 73 |
prompt.submit(get_IF_op,[prompt, neg_prompt], gallery_if)
|
| 74 |
b2.click(get_upscale_op,[prompt, gallery_if], image_picakapic)
|
|
|
|
| 56 |
neutral_hue="cyan",
|
| 57 |
radius_size="md",
|
| 58 |
spacing_size="sm",)
|
| 59 |
+
|
| 60 |
+
title = """<h1 align="center">🔥Gradio pipeline to use DeepFloyd IF more effectively!</h1><br>
|
| 61 |
+
<h2 align="center">Demo build using <a href="https://huggingface.co/spaces/DeepFloyd/IF">DeeepFloyd IF</a> and <a href="https://huggingface.co/spaces/yuvalkirstain/PickScore">Pick-A-Pic PickScore</a> models.</h2>
|
| 62 |
+
<h2 align="center">💪💪Gradio-Client library allows you to use gradio demo for these two cutting edge models as API endpoints</h2>"""
|
| 63 |
+
description = """<br><br><h4>Steps to build this pipeline:
|
| 64 |
+
- Duplicate the Deepfloyd IF Space to avoid queue
|
| 65 |
+
- Create a Cient for this duplicated space using gradio python client
|
| 66 |
+
- Generate intial 4-image gallery using the client and a prompt
|
| 67 |
+
- Create a Client for PickScore Space using gradio python client
|
| 68 |
+
- Feed the image Gallery into PickScore client
|
| 69 |
+
- Generate Probabilities for images, choose the image with highest probability value and display it
|
| 70 |
+
</h4>"""
|
| 71 |
+
|
| 72 |
with gr.Blocks(theme=theme) as demo:
|
| 73 |
+
gr.HTML(title)
|
| 74 |
+
gr.HTML('''<center><a href="https://huggingface.co/spaces/ysharma/Effectively_Using_IF?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a>Duplicate the Space to skip the queue and run in a private space</center>''')
|
| 75 |
+
with gr.Row(variant='compact'):
|
| 76 |
with gr.Column(scale=4):
|
| 77 |
prompt = gr.Textbox(label='Prompt')
|
| 78 |
neg_prompt = gr.Textbox(label='Negative Prompt')
|
| 79 |
with gr.Column(scale=1):
|
| 80 |
b1 = gr.Button("Generate 'IF' Output").style(full_width=True)
|
| 81 |
+
with gr.Row(variant='compact'):
|
| 82 |
with gr.Column():
|
| 83 |
gallery_if = gr.Gallery(label='IF Space outputs', ).style(columns=4, object_fit="contain", preview=True)
|
| 84 |
b2 = gr.Button("Get the best generation using Pick-A-Pic")
|
| 85 |
image_picakapic = gr.Image(label="PickAPic Evaluated Output")
|
| 86 |
+
gr.Markdown(description)
|
| 87 |
b1.click(get_IF_op,[prompt, neg_prompt], gallery_if)
|
| 88 |
prompt.submit(get_IF_op,[prompt, neg_prompt], gallery_if)
|
| 89 |
b2.click(get_upscale_op,[prompt, gallery_if], image_picakapic)
|