Spaces:
Sleeping
Sleeping
Commit
·
007df00
1
Parent(s):
94088a8
Update app.py
Browse files
app.py
CHANGED
@@ -30,7 +30,7 @@ st.session_state.t2m_mod = create_model(loc=the_type)
|
|
30 |
|
31 |
prom = st.text_input("Prompt",'')
|
32 |
|
33 |
-
c1,c2,c3
|
34 |
c5,c6 = st.columns(2)
|
35 |
|
36 |
with c1:
|
@@ -38,9 +38,7 @@ with c1:
|
|
38 |
with c2:
|
39 |
bu_2 = st.text_input("Steps",'12')
|
40 |
with c3:
|
41 |
-
bu_3 = st.text_input("
|
42 |
-
with c4:
|
43 |
-
bu_4 = st.text_input("Number of Images",'1')
|
44 |
with c5:
|
45 |
sl_1 = st.slider("Width",128,1024,512,8)
|
46 |
with c6:
|
@@ -50,6 +48,8 @@ st.session_state.generator = torch.Generator("cpu").manual_seed(int(bu_1))
|
|
50 |
|
51 |
create = st.button("Imagine")
|
52 |
|
|
|
|
|
53 |
if create:
|
54 |
model = st.session_state.t2m_mod
|
55 |
generator = st.session_state.generator
|
@@ -57,7 +57,7 @@ if create:
|
|
57 |
if int(bu_3) == 1 :
|
58 |
IMG = model(prom, width=int(sl_1), height=int(sl_2),
|
59 |
num_inference_steps=int(bu_2),
|
60 |
-
guidance_scale = bu_3,
|
61 |
generator=generator).images[0]
|
62 |
st.image(IMG)
|
63 |
|
@@ -66,7 +66,7 @@ if create:
|
|
66 |
|
67 |
IMGS = model(PROMS, width=int(sl_1), height=int(sl_2),
|
68 |
num_inference_steps=int(bu_2),
|
69 |
-
guidance_scale = bu_3,
|
70 |
generator=generator).images
|
71 |
|
72 |
st.image(IMGS)
|
|
|
30 |
|
31 |
prom = st.text_input("Prompt",'')
|
32 |
|
33 |
+
c1,c2,c3 = st.columns([1,1,3])
|
34 |
c5,c6 = st.columns(2)
|
35 |
|
36 |
with c1:
|
|
|
38 |
with c2:
|
39 |
bu_2 = st.text_input("Steps",'12')
|
40 |
with c3:
|
41 |
+
bu_3 = st.text_input("Number of Images",'1')
|
|
|
|
|
42 |
with c5:
|
43 |
sl_1 = st.slider("Width",128,1024,512,8)
|
44 |
with c6:
|
|
|
48 |
|
49 |
create = st.button("Imagine")
|
50 |
|
51 |
+
# bu_3 = 7.5
|
52 |
+
|
53 |
if create:
|
54 |
model = st.session_state.t2m_mod
|
55 |
generator = st.session_state.generator
|
|
|
57 |
if int(bu_3) == 1 :
|
58 |
IMG = model(prom, width=int(sl_1), height=int(sl_2),
|
59 |
num_inference_steps=int(bu_2),
|
60 |
+
#guidance_scale = bu_3,
|
61 |
generator=generator).images[0]
|
62 |
st.image(IMG)
|
63 |
|
|
|
66 |
|
67 |
IMGS = model(PROMS, width=int(sl_1), height=int(sl_2),
|
68 |
num_inference_steps=int(bu_2),
|
69 |
+
#guidance_scale = bu_3,
|
70 |
generator=generator).images
|
71 |
|
72 |
st.image(IMGS)
|