Spaces:
Running
Running
Commit
·
0580dd5
1
Parent(s):
007df00
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 = st.columns([1,1,
|
34 |
c5,c6 = st.columns(2)
|
35 |
|
36 |
with c1:
|
@@ -38,7 +38,9 @@ with c1:
|
|
38 |
with c2:
|
39 |
bu_2 = st.text_input("Steps",'12')
|
40 |
with c3:
|
41 |
-
bu_3 = st.text_input("
|
|
|
|
|
42 |
with c5:
|
43 |
sl_1 = st.slider("Width",128,1024,512,8)
|
44 |
with c6:
|
@@ -48,7 +50,6 @@ st.session_state.generator = torch.Generator("cpu").manual_seed(int(bu_1))
|
|
48 |
|
49 |
create = st.button("Imagine")
|
50 |
|
51 |
-
# bu_3 = 7.5
|
52 |
|
53 |
if create:
|
54 |
model = st.session_state.t2m_mod
|
@@ -57,7 +58,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 |
-
|
61 |
generator=generator).images[0]
|
62 |
st.image(IMG)
|
63 |
|
@@ -66,7 +67,7 @@ if create:
|
|
66 |
|
67 |
IMGS = model(PROMS, width=int(sl_1), height=int(sl_2),
|
68 |
num_inference_steps=int(bu_2),
|
69 |
-
|
70 |
generator=generator).images
|
71 |
|
72 |
st.image(IMGS)
|
|
|
30 |
|
31 |
prom = st.text_input("Prompt",'')
|
32 |
|
33 |
+
c1,c2,c3,c4 = st.columns([1,1,1,2])
|
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("Guidance Scale",'7.5')
|
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 |
|
51 |
create = st.button("Imagine")
|
52 |
|
|
|
53 |
|
54 |
if create:
|
55 |
model = st.session_state.t2m_mod
|
|
|
58 |
if int(bu_3) == 1 :
|
59 |
IMG = model(prom, width=int(sl_1), height=int(sl_2),
|
60 |
num_inference_steps=int(bu_2),
|
61 |
+
guidance_scale = bu_3,
|
62 |
generator=generator).images[0]
|
63 |
st.image(IMG)
|
64 |
|
|
|
67 |
|
68 |
IMGS = model(PROMS, width=int(sl_1), height=int(sl_2),
|
69 |
num_inference_steps=int(bu_2),
|
70 |
+
guidance_scale = bu_3,
|
71 |
generator=generator).images
|
72 |
|
73 |
st.image(IMGS)
|