Spaces:
Running
Running
Update fluxai.py
Browse files
fluxai.py
CHANGED
@@ -148,13 +148,13 @@ async def fluxai_image(payload: FluxAI):
|
|
148 |
url = "https://randydev-ryuzaki-api.hf.space/api/v1/uploadfile/"
|
149 |
files = {"file": open(file_path, "rb")}
|
150 |
response_uploaded = requests.post(url, files=files).json()
|
151 |
-
|
152 |
example_test = "Explain how this picture looks like."
|
153 |
x = GeminiLatest(api_keys=GOOGLE_API_KEY)
|
154 |
response = x.get_response_image(example_test, file_path)
|
155 |
return SuccessResponse(
|
156 |
status="True",
|
157 |
-
randydev={"url":
|
158 |
)
|
159 |
else:
|
160 |
return StreamingResponse(io.BytesIO(image_bytes), media_type="image/jpeg")
|
|
|
148 |
url = "https://randydev-ryuzaki-api.hf.space/api/v1/uploadfile/"
|
149 |
files = {"file": open(file_path, "rb")}
|
150 |
response_uploaded = requests.post(url, files=files).json()
|
151 |
+
get_url = response_uploaded.get("url")
|
152 |
example_test = "Explain how this picture looks like."
|
153 |
x = GeminiLatest(api_keys=GOOGLE_API_KEY)
|
154 |
response = x.get_response_image(example_test, file_path)
|
155 |
return SuccessResponse(
|
156 |
status="True",
|
157 |
+
randydev={"url": get_url, "caption": response}
|
158 |
)
|
159 |
else:
|
160 |
return StreamingResponse(io.BytesIO(image_bytes), media_type="image/jpeg")
|