salomonsky commited on
Commit
a6d77f2
verified
1 Parent(s): 69bca20

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -9
app.py CHANGED
@@ -16,16 +16,20 @@ DATA_PATH.mkdir(exist_ok=True)
16
  PREDEFINED_SEED = random.randint(0, MAX_SEED)
17
 
18
  # Configuraci贸n de autenticaci贸n
19
- names = ["Admin"]
20
- usernames = ["admin"]
21
- passwords = ["flux33"]
 
 
 
 
 
22
 
23
- hashed_passwords = stauth.Hasher(passwords).generate()
 
 
24
 
25
- authenticator = stauth.Authenticate(
26
- names=names, usernames=usernames, passwords=hashed_passwords,
27
- cookie_name="image_gen", key="abcdef", cookie_expiry_days=1
28
- )
29
 
30
  async def generate_image(prompt, width, height, seed):
31
  try:
@@ -50,7 +54,7 @@ def save_prompt(prompt_text, seed):
50
  return None
51
 
52
  async def gen(prompt, width, height):
53
- combined_prompt = prompt
54
 
55
  seed = PREDEFINED_SEED
56
  progress_bar = st.progress(0)
 
16
  PREDEFINED_SEED = random.randint(0, MAX_SEED)
17
 
18
  # Configuraci贸n de autenticaci贸n
19
+ credentials = {
20
+ "usernames": {
21
+ "admin": {
22
+ "name": "Admin",
23
+ "password": stauth.Hasher(["flux33"]).generate()[0]
24
+ }
25
+ }
26
+ }
27
 
28
+ cookie_name = "image_gen"
29
+ key = "abcdef"
30
+ cookie_expiry_days = 1
31
 
32
+ authenticator = stauth.Authenticate(credentials, cookie_name, key, cookie_expiry_days)
 
 
 
33
 
34
  async def generate_image(prompt, width, height, seed):
35
  try:
 
54
  return None
55
 
56
  async def gen(prompt, width, height):
57
+ combined_prompt = prompt
58
 
59
  seed = PREDEFINED_SEED
60
  progress_bar = st.progress(0)