Spaces:
Running
Running
Commit
·
d785842
1
Parent(s):
d9ea04d
Refactor generate_image function to return image URL directly instead of base64 encoding
Browse files- post_blog.py +2 -5
post_blog.py
CHANGED
@@ -25,11 +25,8 @@ def generate_image(title, summary, category):
|
|
25 |
if extracted_summary is None:
|
26 |
extracted_summary = title
|
27 |
url = f"https://image.pollinations.ai/prompt/{title}%20%3A%20{extracted_summary}?width=1280&height=720&seed=623862700&nologo=true&model=turbo"
|
28 |
-
|
29 |
-
|
30 |
-
image = encoded_image.decode('utf-8')
|
31 |
-
image_url = f"data:image/png;base64,{image}"
|
32 |
-
return image_url
|
33 |
|
34 |
def generate_post_html(title, summary, mindmap, category, citation):
|
35 |
title = title.replace("{", r"{{").replace("}", r"}}")
|
|
|
25 |
if extracted_summary is None:
|
26 |
extracted_summary = title
|
27 |
url = f"https://image.pollinations.ai/prompt/{title}%20%3A%20{extracted_summary}?width=1280&height=720&seed=623862700&nologo=true&model=turbo"
|
28 |
+
requests.get(url).content
|
29 |
+
return url
|
|
|
|
|
|
|
30 |
|
31 |
def generate_post_html(title, summary, mindmap, category, citation):
|
32 |
title = title.replace("{", r"{{").replace("}", r"}}")
|