File size: 2,098 Bytes
9660427
2c71197
f39b623
e29f9a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8471888
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
e29f9a0
 
8471888
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import sys
sys.path.append("pixray/text2image")
 
from os import path
from PIL import Image
from PIL import ImageFont
from PIL import Image
from PIL import ImageFont
from PIL import Image
from PIL import ImageFont
from PIL import Image
from PIL import ImageDraw
from PIL import ImageFont
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageDraw
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageFont
from PIL import ImageDraw
from PIL import ImageFont
import os
import replicate 
import st
## make a catch 404 statement if there is a bug
import streamlit.components.v1 as components
## now make a streamalit app gui for pixray text2image
import streamlit as st
import numpy as np
import PIL
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
import PIL.ImageOps
def main():
  import replicate
model = replicate.models.get("pixray/text2image")
model.predict(prompts=input("Enter text: "))
## make a streamlit app
 
 ## fix import replicate

## make a streamlit app gui for pixray text2image
import streamlit as st
import numpy as np
import PIL
import PIL.Image
import PIL.ImageDraw
import streamlit.components.v1 as components
## now make a streamalit app gui for pixray text2image
import streamlit as st
import numpy as np
import PIL
import PIL.Image
import PIL.ImageDraw
import PIL.ImageFont
import PIL.ImageOps
def main():
    st.title("Pixray Text2Image")
    st.markdown("""
    This app converts text to images.
    """)
    st.markdown("""
    **How to use:**
    1. Enter text in the text box below.
    2. Click the button to convert text to an image.
    3. Click the button to save the image.
    """)
    text = st.text_area("Enter text here:", "")
    if st.button("Convert text to image"):
        image = model.predict(prompts=text)
        st.image(image, use_column_width=True)
    if st.button("Save image"):
        st.write("Saving image...")
        image.save("image.png")
        st.success("Image saved.")

        ## v0.1x INFDEV [HALTMANN AGI]