Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -42,14 +42,39 @@ description = """
|
|
42 |
- Item 1
|
43 |
- Item 2
|
44 |
"""
|
45 |
-
interface = gr.Interface(
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
interface.launch(debug=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
- Item 1
|
43 |
- Item 2
|
44 |
"""
|
45 |
+
# interface = gr.Interface(
|
46 |
|
47 |
+
# fn=predict,
|
48 |
+
# description=description,
|
49 |
+
# inputs = input,
|
50 |
+
# theme="grass",
|
51 |
+
# outputs=output,
|
52 |
+
# examples=examples,
|
53 |
+
# title=title,
|
54 |
+
# )
|
55 |
+
# interface.launch(debug=True)
|
56 |
+
|
57 |
+
with gr.Blocks() as demo:
|
58 |
+
|
59 |
+
gr.HTML(
|
60 |
+
"""
|
61 |
+
<div style="text-align: center; max-width: 1200px; margin: 20px auto;">
|
62 |
+
<h1 style="font-weight: 900; font-size: 3rem; margin: 0rem">
|
63 |
+
TextDiffuser: Diffusion Models as Text Painters
|
64 |
+
</h1>
|
65 |
+
<h3 style="font-weight: 450; font-size: 1rem; margin: 0rem">
|
66 |
+
[<a href="https://arxiv.org/abs/2305.10855" style="color:blue;">arXiv</a>]
|
67 |
+
[<a href="https://github.com/microsoft/unilm/tree/master/textdiffuser" style="color:blue;">Code</a>]
|
68 |
+
[<a href="https://jingyechen.github.io/textdiffuser/" style="color:blue;">ProjectPage</a>]
|
69 |
+
</h3>
|
70 |
+
<h2 style="text-align: left; font-weight: 450; font-size: 1rem; margin-top: 0.5rem; margin-bottom: 0.5rem">
|
71 |
+
We propose <b>TextDiffuser</b>, a flexible and controllable framework to generate images with visually appealing text that is coherent with backgrounds.
|
72 |
+
Main features include: (a) <b><font color="#A52A2A">Text-to-Image</font></b>: The user provides a prompt and encloses the keywords with single quotes (e.g., a text image of ‘hello’). The model first determines the layout of the keywords and then draws the image based on the layout and prompt. (b) <b><font color="#A52A2A">Text-to-Image with Templates</font></b>: The user provides a prompt and a template image containing text, which can be a printed, handwritten, or scene text image. These template images can be used to determine the layout of the characters. (c) <b><font color="#A52A2A">Text Inpainting</font></b>: The user provides an image and specifies the region to be modified along with the desired text content. The model is able to modify the original text or add text to areas without text.
|
73 |
+
</h2>
|
74 |
+
<img src="file/images/huggingface_blank.jpg" alt="textdiffuser">
|
75 |
+
</div>
|
76 |
+
""")
|
77 |
+
gr.inputs.Image(label="Upload any Image", type = 'pil', optional=True)
|
78 |
+
gr.outputs.Textbox(type="text",label="Captions")
|
79 |
+
|
80 |
+
demo.launch()
|