Update app.py
Browse files
app.py
CHANGED
@@ -20,24 +20,25 @@ create = st.button("Create The Model")
|
|
20 |
if create:
|
21 |
st.title("Text2Image")
|
22 |
t2m_mod = create_model(loc=the_type)
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
|
|
|
20 |
if create:
|
21 |
st.title("Text2Image")
|
22 |
t2m_mod = create_model(loc=the_type)
|
23 |
+
|
24 |
+
|
25 |
+
prom = st.text_input("# Prompt",'')
|
26 |
+
|
27 |
+
c1,c2,c3 = st.columns([1,1,3])
|
28 |
+
c4,c5 = st.columns(2)
|
29 |
+
with c1:
|
30 |
+
bu_1 = st.text_input("Seed",'999')
|
31 |
+
with c2:
|
32 |
+
bu_2 = st.text_input("Steps",'12')
|
33 |
+
with c3:
|
34 |
+
bu_3 = st.text_input("Number of Images",'1')
|
35 |
+
with c4:
|
36 |
+
sl_1 = st.slider("Width",256,1024,128)
|
37 |
+
with c5:
|
38 |
+
sl_2 = st.slider("hight",256,1024,128)
|
39 |
+
|
40 |
+
create = st.button("Imagine")
|
41 |
+
if create:
|
42 |
+
generator = torch.Generator("cpu").manual_seed(int(bu_1))
|
43 |
+
img = t2m_mod(prom, width=int(sl_1), height=int(sl_2), num_inference_steps=int(bu_2), generator=generator).images[0]
|
44 |
+
st.image(img)
|