Spaces:
Runtime error
Runtime error
Kvikontent
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -20,38 +20,16 @@ def generate_image_from_prompt(prompt_text):
|
|
20 |
title = "KVIImager 2.0 Demo 🎨"
|
21 |
description = "This app uses Hugging Face AI model to generate an image based on the provided text prompt 🖼️."
|
22 |
|
23 |
-
|
24 |
-
|
25 |
-
'background-color': '#f4f4f4',
|
26 |
-
'font-family': 'Arial, sans-serif'
|
27 |
-
},
|
28 |
-
'title': {
|
29 |
-
'color': 'navy',
|
30 |
-
'font-size': '36px',
|
31 |
-
'text-align': 'center',
|
32 |
-
'margin-bottom': '20px'
|
33 |
-
},
|
34 |
-
'textbox': {
|
35 |
-
'border': '2px solid #008CBA',
|
36 |
-
'border-radius': '5px',
|
37 |
-
'padding': '10px',
|
38 |
-
'margin-bottom': '20px',
|
39 |
-
'width': '300px',
|
40 |
-
'font-size': '16px'
|
41 |
-
},
|
42 |
-
'output_image': {
|
43 |
-
'box-shadow': '2px 2px 5px #888888'
|
44 |
-
}
|
45 |
-
}
|
46 |
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
).launch(inline=True, css=css_styles)
|
|
|
20 |
title = "KVIImager 2.0 Demo 🎨"
|
21 |
description = "This app uses Hugging Face AI model to generate an image based on the provided text prompt 🖼️."
|
22 |
|
23 |
+
input_prompt = gr.inputs.Textbox(label="Enter Prompt 📝", placeholder="E.g. 'A peaceful garden with a small cottage'")
|
24 |
+
output_generated_image = gr.outputs.Image(label="Generated Image")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
+
with gr.Blocks(theme=gr.theme.Soft()) as app:
|
27 |
+
caption = "Generate Image"
|
28 |
+
iface = gr.Interface(
|
29 |
+
generate_image_from_prompt,
|
30 |
+
inputs=input_prompt,
|
31 |
+
outputs=output_generated_image,
|
32 |
+
title=title,
|
33 |
+
description=description
|
34 |
+
)
|
35 |
+
iface.launch(share=True, inline=True)
|
|