randydev commited on
Commit
ffb6fc3
·
verified ·
1 Parent(s): 7373e8c

Update fluxai.py

Browse files
Files changed (1) hide show
  1. fluxai.py +5 -4
fluxai.py CHANGED
@@ -111,15 +111,16 @@ async def fluxai_image(payload: FluxAI):
111
  image = enhancer.enhance(1.2)
112
  enhancer = ImageEnhance.Color(image)
113
  image = enhancer.enhance(1.1)
114
-
115
- enhanced_image_bytes = BytesIO()
116
  image.save(enhanced_image_bytes, format="JPEG", quality=95)
117
  enhanced_image_bytes.seek(0)
118
- encoded_string = base64.b64encode(enhanced_image_bytes.getvalue()).decode("utf-8")
 
119
 
120
  example_test = "Explain how this picture looks like."
121
  x = GeminiLatest(api_keys=GOOGLE_API_KEY)
122
- response = x.get_response_image(example_test, encoded_string)
123
 
124
  return SuccessResponse(
125
  status="True",
 
111
  image = enhancer.enhance(1.2)
112
  enhancer = ImageEnhance.Color(image)
113
  image = enhancer.enhance(1.1)
114
+
115
+ enhanced_image_bytes = "akeno.jpg"
116
  image.save(enhanced_image_bytes, format="JPEG", quality=95)
117
  enhanced_image_bytes.seek(0)
118
+ with open(enhanced_image_bytes, "rb") as image_file:
119
+ encoded_string = base64.b64encode(image_file.read()).decode("utf-8")
120
 
121
  example_test = "Explain how this picture looks like."
122
  x = GeminiLatest(api_keys=GOOGLE_API_KEY)
123
+ response = x.get_response_image(example_test, enhanced_image_bytes)
124
 
125
  return SuccessResponse(
126
  status="True",