Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
@@ -470,9 +470,33 @@ def gemini_pro(item: GeminiPro):
|
|
470 |
status="False", randydev={"message": contact_support}
|
471 |
)
|
472 |
|
|
|
473 |
{BING_IMAGES}
|
474 |
|
475 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
@app.post("/UFoP/dalle3xl")
|
477 |
def dalle_3xl(item: Dalle3XL, api_key: None = Depends(validate_api_key)):
|
478 |
API_URL = SOURCE_DALLE3XL_URL
|
|
|
470 |
status="False", randydev={"message": contact_support}
|
471 |
)
|
472 |
|
473 |
+
|
474 |
{BING_IMAGES}
|
475 |
|
476 |
|
477 |
+
@app.post("/Bing/Dall-E-3")
|
478 |
+
def bing_dalle(item: BingDalle):
|
479 |
+
try:
|
480 |
+
set_cookies(
|
481 |
+
".bing.com",
|
482 |
+
{
|
483 |
+
"_U": item.cookie
|
484 |
+
},
|
485 |
+
)
|
486 |
+
except requests.exceptions.RequestException:
|
487 |
+
raise HTTPException(status_code=500, detail="Invalid cookie string, check your cookie string and try again")
|
488 |
+
|
489 |
+
try:
|
490 |
+
response = BingImages.images.generate(
|
491 |
+
prompt=item.prompt,
|
492 |
+
model=item.model,
|
493 |
+
)
|
494 |
+
return {"status": "true", "sukuna": {"url": response.data[0].url}}
|
495 |
+
|
496 |
+
except BaseException as e:
|
497 |
+
return {"status": "false", "message": f"Something went wrong: {e}"}
|
498 |
+
|
499 |
+
|
500 |
@app.post("/UFoP/dalle3xl")
|
501 |
def dalle_3xl(item: Dalle3XL, api_key: None = Depends(validate_api_key)):
|
502 |
API_URL = SOURCE_DALLE3XL_URL
|