killwithabass commited on
Commit
8621dcd
·
verified ·
1 Parent(s): e0386b6

Update requirements.txt (#6)

Browse files

- Update requirements.txt (7deb5a71046ed726b9ad025752b5eb54e298a26e)
- Update app.py (ec3c99bf24b1ec7ccf5185f7fa2977d30bff7684)

Files changed (2) hide show
  1. app.py +10 -0
  2. requirements.txt +2 -1
app.py CHANGED
@@ -10,10 +10,16 @@ from datetime import datetime
10
  from transformers.utils.hub import move_cache
11
  import json
12
  from gradio_client import Client
 
13
 
14
  # Move cache
15
  move_cache()
16
 
 
 
 
 
 
17
  # Initialize GSheet Connexion
18
  #Authorization
19
  gc = pygsheets.authorize(service_account_env_var='GSHEET_AUTH')
@@ -92,6 +98,10 @@ def run_lora(prompt, cfg_scale, steps, randomize_seed, seed, width, height, lora
92
 
93
  image.save(image_path, pnginfo=metadata)
94
 
 
 
 
 
95
 
96
  # Construct the URL to access the image
97
  space_url = "https://killwithabass-flux-1-dev-lora-androflux.hf.space" # Replace with your actual space URL
 
10
  from transformers.utils.hub import move_cache
11
  import json
12
  from gradio_client import Client
13
+ from supabase import create_client, Client
14
 
15
  # Move cache
16
  move_cache()
17
 
18
+ # Initialize supabase
19
+ url: str = os.environ.get("SUPABASE_URL")
20
+ key: str = os.environ.get("SUPABASE_KEY")
21
+ supabase: Client = create_client(url, key)
22
+
23
  # Initialize GSheet Connexion
24
  #Authorization
25
  gc = pygsheets.authorize(service_account_env_var='GSHEET_AUTH')
 
98
 
99
  image.save(image_path, pnginfo=metadata)
100
 
101
+ #Save image in supabase
102
+ response = supabase.storage.from_('generated_images').upload(image_path, file)
103
+
104
+
105
 
106
  # Construct the URL to access the image
107
  space_url = "https://killwithabass-flux-1-dev-lora-androflux.hf.space" # Replace with your actual space URL
requirements.txt CHANGED
@@ -7,4 +7,5 @@ sentencepiece
7
  pillow
8
  climage
9
  pygsheets
10
- gradio_client
 
 
7
  pillow
8
  climage
9
  pygsheets
10
+ gradio_client
11
+ supabase