Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ def download_image(prompt, index):
|
|
16 |
def add_text_to_image(image_path, text):
|
17 |
img = Image.open(image_path)
|
18 |
draw = ImageDraw.Draw(img)
|
19 |
-
font = ImageFont.load_default() # You can load a custom font if
|
20 |
# Wrap text for multiple lines
|
21 |
lines = textwrap.fill(text, width=40)
|
22 |
draw.text((10, 10), lines, font=font, fill="white")
|
@@ -39,7 +39,8 @@ def visualize_story_lines(story):
|
|
39 |
|
40 |
# Gradio interface
|
41 |
def visualize_story_images(story):
|
42 |
-
|
|
|
43 |
|
44 |
iface = gr.Interface(fn=visualize_story_images, inputs="text", outputs="image")
|
45 |
-
iface.launch()
|
|
|
16 |
def add_text_to_image(image_path, text):
|
17 |
img = Image.open(image_path)
|
18 |
draw = ImageDraw.Draw(img)
|
19 |
+
font = ImageFont.load_default() # You can load a custom font if needed
|
20 |
# Wrap text for multiple lines
|
21 |
lines = textwrap.fill(text, width=40)
|
22 |
draw.text((10, 10), lines, font=font, fill="white")
|
|
|
39 |
|
40 |
# Gradio interface
|
41 |
def visualize_story_images(story):
|
42 |
+
images = visualize_story_lines(story)
|
43 |
+
return images[0] # Return first image for now
|
44 |
|
45 |
iface = gr.Interface(fn=visualize_story_images, inputs="text", outputs="image")
|
46 |
+
iface.launch(share=True)
|