randydev commited on
Commit
0c29c4f
·
verified ·
1 Parent(s): b753a99

Update fluxai.py

Browse files
Files changed (1) hide show
  1. fluxai.py +2 -2
fluxai.py CHANGED
@@ -75,7 +75,7 @@ def deduct_tokens_gpt(user_id, amount):
75
  else:
76
  return False
77
 
78
- UPLOAD_DIRECTORY = "uploads"
79
 
80
  @router.get("/uploads/{filename}")
81
  async def get_upload(filename: str):
@@ -121,7 +121,7 @@ async def fluxai_image(payload: FluxAI):
121
  image.save(enhanced_image_bytes, format="JPEG", quality=95)
122
  enhanced_image_bytes.seek(0)
123
  unique_filename = f"{uuid.uuid4().hex}.jpg"
124
- file_path = os.path.join("uploads", unique_filename)
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())
 
75
  else:
76
  return False
77
 
78
+ UPLOAD_DIRECTORY = "./uploads"
79
 
80
  @router.get("/uploads/{filename}")
81
  async def get_upload(filename: str):
 
121
  image.save(enhanced_image_bytes, format="JPEG", quality=95)
122
  enhanced_image_bytes.seek(0)
123
  unique_filename = f"{uuid.uuid4().hex}.jpg"
124
+ file_path = os.path.join(UPLOAD_DIRECTORY, unique_filename)
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())