epochs-demos commited on
Commit
78b2970
1 Parent(s): 680ea05

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -1
app.py CHANGED
@@ -14,5 +14,32 @@ def t2i(text):
14
  image = Image.open('image.png')
15
  return image
16
 
17
- iface = gr.Interface(fn=t2i, inputs="text", outputs=[gr.Image(label="Generated Image")]).launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  iface.launch(share=True)
 
14
  image = Image.open('image.png')
15
  return image
16
 
17
+ # Read the image file and encode it as base64
18
+ with open("./1001epochs.png", "rb") as f:
19
+ image_data = f.read()
20
+ image_base64 = base64.b64encode(image_data).decode("utf-8")
21
+
22
+ allow_flagging = "never"
23
+
24
+ title = f"""
25
+ <h2 style="background-image: linear-gradient(to right, #3A5FCD, #87CEFA); -webkit-background-clip: text;
26
+ -webkit-text-fill-color: transparent; text-align: center;">
27
+ Text to Image Generator
28
+ </h2>
29
+ """
30
+
31
+ description = f"""
32
+ <div style="display: flex; align-items: center; justify-content: center; flex-direction: column;">
33
+ <p style="font-size: 18px; color: #4AAAFF; text-align: center;">
34
+ Turn words into captivating visuals effortlessly within minutes.
35
+ </p>
36
+ <div style="display: flex; align-items: center; margin-bottom: 0px;">
37
+ <img src='data:image/jpeg;base64,{image_base64}' width='50' height='30' style="margin-right: 5px;"/>
38
+ <p style="font-size: 14px; color: #555;">
39
+ Disclaimer: This web app is for demonstration purposes only and not intended for commercial use. Contact: contact@1001epochs.co.uk for full solution.
40
+ </p>
41
+ </div>
42
+ </div>
43
+ """
44
+ iface = gr.Interface(fn=t2i, inputs="text", outputs=[gr.Image(label="Generated Image")], title=title, description=description).launch()
45
  iface.launch(share=True)