abdullahfurquan commited on
Commit
0700f80
·
verified ·
1 Parent(s): fef29d4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -20,10 +20,8 @@ image_generation_tool = load_tool("agents-course/text-to-image", trust_remote_co
20
  def generate_image_tool(prompt: str) -> str:
21
  """Generates an image from text and returns the file path."""
22
  try:
23
- image = image_generation_tool(prompt) # Get PIL Image
24
- file_path = "generated_image.jpg"
25
- image.save(file_path) # Save it
26
- return file_path # Return the file path
27
  except Exception as e:
28
  return f"Error generating image: {str(e)}"
29
 
 
20
  def generate_image_tool(prompt: str) -> str:
21
  """Generates an image from text and returns the file path."""
22
  try:
23
+ image = image_generation_tool(prompt)
24
+ return image # Return the file path
 
 
25
  except Exception as e:
26
  return f"Error generating image: {str(e)}"
27