Kvikontent commited on
Commit
15367d5
β€’
1 Parent(s): 1d65919

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -34
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
- css_styles = {
24
- 'body': {
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
- input_prompt = gr.Textbox(label="Enter Prompt πŸ“", placeholder="E.g. 'A peaceful garden with a small cottage'")
48
- output_generated_image = gr.Image(label="Generated Image")
49
-
50
- gr.Interface(
51
- fn=generate_image_from_prompt,
52
- inputs=input_prompt,
53
- outputs=output_generated_image,
54
- title=title,
55
- description=description,
56
- #examples=examples
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)