randydev commited on
Commit
70b712d
1 Parent(s): 7838dbc

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +3 -2
main.py CHANGED
@@ -595,8 +595,9 @@ def bing_dalle(item: BingDalle, api_key: None = Depends(validate_api_key)):
595
  return SuccessResponse(status="False", randydev={"data": f"Error: {e}"})
596
 
597
  def get_image_urls(query):
598
-     response = requests.get("https://ufoptg-ufop-api.hf.space/dall-e-3/prompt=" + query, headers=headers).json()
599
-     return [response[f"S{i}-Image"] for i in range(1, 5)]
 
600
 
601
  @app.post("/ryuzaki/dalle3xl")
602
  def dalle_3xl(
 
595
  return SuccessResponse(status="False", randydev={"data": f"Error: {e}"})
596
 
597
  def get_image_urls(query):
598
+ headers = {"accept":"application/json", "Content-Type": "application/json"}
599
+ response = requests.get("https://ufoptg-ufop-api.hf.space/dall-e-3/prompt=" + query, headers=headers).json()
600
+ return [response[f"S{i}-Image"] for i in range(1, 5)]
601
 
602
  @app.post("/ryuzaki/dalle3xl")
603
  def dalle_3xl(