Spaces:
Running
Running
Commit
·
f25f3c0
1
Parent(s):
86ed914
Load into Block (#7)
Browse files- Load into Block (6b1b6ea2d9bdbdcc25aa7bf1a2ac326ce3af53f7)
Co-authored-by: Merve Noyan <[email protected]>
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
import os
|
3 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
4 |
|
5 |
-
img_to_text = gr.
|
6 |
stable_diffusion = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion")
|
7 |
|
8 |
def get_images(prompt):
|
@@ -11,7 +11,7 @@ def get_images(prompt):
|
|
11 |
return sd_output, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
12 |
|
13 |
def get_prompts(uploaded_image):
|
14 |
-
return img_to_text(uploaded_image)
|
15 |
|
16 |
css = '''
|
17 |
.animate-spin {
|
@@ -72,7 +72,7 @@ with gr.Blocks(css=css) as demo:
|
|
72 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
73 |
share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
|
74 |
|
75 |
-
see_prompts.click(
|
76 |
inputs = input_img,
|
77 |
outputs = [
|
78 |
img2text_output
|
|
|
2 |
import os
|
3 |
from share_btn import community_icon_html, loading_icon_html, share_js
|
4 |
|
5 |
+
img_to_text = gr.Blocks.load(name="spaces/pharma/CLIP-Interrogator")
|
6 |
stable_diffusion = gr.Blocks.load(name="spaces/stabilityai/stable-diffusion")
|
7 |
|
8 |
def get_images(prompt):
|
|
|
11 |
return sd_output, gr.update(visible=True), gr.update(visible=True), gr.update(visible=True)
|
12 |
|
13 |
def get_prompts(uploaded_image):
|
14 |
+
return img_to_text(uploaded_image, fn_index=1)
|
15 |
|
16 |
css = '''
|
17 |
.animate-spin {
|
|
|
72 |
loading_icon = gr.HTML(loading_icon_html, visible=False)
|
73 |
share_button = gr.Button("Share to community", elem_id="share-btn", visible=False)
|
74 |
|
75 |
+
see_prompts.click(get_prompts,
|
76 |
inputs = input_img,
|
77 |
outputs = [
|
78 |
img2text_output
|