Tobias Geisler commited on
Commit
5784688
·
1 Parent(s): 6504b4e
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -16,7 +16,7 @@ def generate_image(hair_color, mood, eye_color):
16
  print("Prompt:", prompt)
17
 
18
  try:
19
- response = client.images.create(
20
  model="dall-e-3",
21
  prompt=prompt,
22
  size="1024x1024", # Choose from "1024x1024", "1024x1792", or "1792x1024"
@@ -25,7 +25,7 @@ def generate_image(hair_color, mood, eye_color):
25
  )
26
 
27
  # Get the image URL from the response
28
- image_url = response['data'][0]['url']
29
 
30
  return prompt, image_url
31
  except Exception as e:
 
16
  print("Prompt:", prompt)
17
 
18
  try:
19
+ response = client.images.generate(
20
  model="dall-e-3",
21
  prompt=prompt,
22
  size="1024x1024", # Choose from "1024x1024", "1024x1792", or "1792x1024"
 
25
  )
26
 
27
  # Get the image URL from the response
28
+ image_url = response.data[0].url
29
 
30
  return prompt, image_url
31
  except Exception as e: