Spaces:
Running
Running
Update fluxai.py
Browse files
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 =
|
116 |
image.save(enhanced_image_bytes, format="JPEG", quality=95)
|
117 |
enhanced_image_bytes.seek(0)
|
118 |
-
|
|
|
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,
|
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",
|