Spaces:
Running
Running
Update fluxai.py
Browse files
fluxai.py
CHANGED
@@ -77,7 +77,7 @@ def deduct_tokens_gpt(user_id, amount):
|
|
77 |
|
78 |
UPLOAD_DIRECTORY = "uploads"
|
79 |
|
80 |
-
@
|
81 |
async def get_upload(filename: str):
|
82 |
file_path = os.path.join(UPLOAD_DIRECTORY, filename)
|
83 |
if os.path.exists(file_path):
|
@@ -125,7 +125,7 @@ async def fluxai_image(payload: FluxAI):
|
|
125 |
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
126 |
with open(file_path, "wb") as f:
|
127 |
f.write(enhanced_image_bytes.getvalue())
|
128 |
-
example_test = "
|
129 |
x = GeminiLatest(api_keys=GOOGLE_API_KEY)
|
130 |
response = x.get_response_image(example_test, file_path)
|
131 |
url = f"https://randydev-ryuzaki-api.hf.space/{file_path}"
|
|
|
77 |
|
78 |
UPLOAD_DIRECTORY = "uploads"
|
79 |
|
80 |
+
@router.get("/uploads/{filename}")
|
81 |
async def get_upload(filename: str):
|
82 |
file_path = os.path.join(UPLOAD_DIRECTORY, filename)
|
83 |
if os.path.exists(file_path):
|
|
|
125 |
os.makedirs(os.path.dirname(file_path), exist_ok=True)
|
126 |
with open(file_path, "wb") as f:
|
127 |
f.write(enhanced_image_bytes.getvalue())
|
128 |
+
example_test = "Explain how this picture looks like."
|
129 |
x = GeminiLatest(api_keys=GOOGLE_API_KEY)
|
130 |
response = x.get_response_image(example_test, file_path)
|
131 |
url = f"https://randydev-ryuzaki-api.hf.space/{file_path}"
|