Silence1412 commited on
Commit
67148f6
·
1 Parent(s): adbd187

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -30,20 +30,24 @@ st.session_state.t2m_mod = create_model(loc=the_type)
30
 
31
  prom = st.text_input("Prompt",'')
32
 
33
- c1,c2,c3 = st.columns([2,2,2])
34
- c5,c6 = st.columns(2)
 
35
 
36
  with c1:
37
- bu_1 = st.text_input("Seed",'999')
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:
45
  sl_2 = st.slider("hight",128,1024,512,8)
46
 
 
 
 
47
  st.session_state.generator = torch.Generator("cpu").manual_seed(int(bu_1))
48
 
49
  create = st.button("Imagine")
@@ -56,6 +60,7 @@ if create:
56
  if int(bu_3) == 1 :
57
  IMG = model(prom, width=int(sl_1), height=int(sl_2),
58
  num_inference_steps=int(bu_2),
 
59
  generator=generator).images[0]
60
  st.image(IMG)
61
 
@@ -64,6 +69,7 @@ if create:
64
 
65
  IMGS = model(PROMS, width=int(sl_1), height=int(sl_2),
66
  num_inference_steps=int(bu_2),
 
67
  generator=generator).images
68
 
69
  st.image(IMGS)
 
30
 
31
  prom = st.text_input("Prompt",'')
32
 
33
+ c1,c2,c3 = st.columns([1,1,3])
34
+ c4,c5 = st.columns(2)
35
+ c6 = st.columns(1)
36
 
37
  with c1:
38
+ bu_1 = st.text_input("Seed",'666')
39
  with c2:
40
  bu_2 = st.text_input("Steps",'12')
41
  with c3:
42
  bu_3 = st.text_input("Number of Images",'1')
43
+ with c4:
44
  sl_1 = st.slider("Width",128,1024,512,8)
45
+ with c5:
46
  sl_2 = st.slider("hight",128,1024,512,8)
47
 
48
+ with c6:
49
+ bu_6 = st.text_input("Guidance Scale",'7.5')
50
+
51
  st.session_state.generator = torch.Generator("cpu").manual_seed(int(bu_1))
52
 
53
  create = st.button("Imagine")
 
60
  if int(bu_3) == 1 :
61
  IMG = model(prom, width=int(sl_1), height=int(sl_2),
62
  num_inference_steps=int(bu_2),
63
+ guidance_scale = bu_6,
64
  generator=generator).images[0]
65
  st.image(IMG)
66
 
 
69
 
70
  IMGS = model(PROMS, width=int(sl_1), height=int(sl_2),
71
  num_inference_steps=int(bu_2),
72
+ guidance_scale = bu_6,
73
  generator=generator).images
74
 
75
  st.image(IMGS)