Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -332,31 +332,31 @@ def create_download_link(filename, base64_str):
|
|
332 |
|
333 |
# List of image URLs
|
334 |
image_urls = [
|
335 |
-
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/
|
336 |
-
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/
|
337 |
-
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/_ANl0q3ZGDa9CxQqpUmYP.png",
|
338 |
-
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/SIGnnyVv7eLu8NnrtxdQP.png",
|
339 |
-
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/5u06M9ue8FXK6Dsi2SF-I.png",
|
340 |
-
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/gTmhCUdpPaIJcmNXceDi4.png"
|
341 |
]
|
342 |
|
343 |
# Select a random URL from the list
|
344 |
selected_image_url = random.choice(image_urls)
|
345 |
|
346 |
# Get the base64 encoded string of the selected image
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
|
|
|
|
|
|
|
|
360 |
# ---- Art Card Sidebar with random selection of image.
|
361 |
|
362 |
|
|
|
332 |
|
333 |
# List of image URLs
|
334 |
image_urls = [
|
335 |
+
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/W1omJItftG3OkW9sj-Ckb.png",
|
336 |
+
"https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/Djx-k4WOxzlXEQPzllP3r.png"
|
|
|
|
|
|
|
|
|
337 |
]
|
338 |
|
339 |
# Select a random URL from the list
|
340 |
selected_image_url = random.choice(image_urls)
|
341 |
|
342 |
# Get the base64 encoded string of the selected image
|
343 |
+
st.write(selected_image_url)
|
344 |
+
try:
|
345 |
+
selected_image_base64 = get_image_as_base64(selected_image_url)
|
346 |
+
|
347 |
+
if selected_image_base64 is not None:
|
348 |
+
with st.sidebar:
|
349 |
+
st.markdown("""### Graphic Novel AI""")
|
350 |
+
# Display the image
|
351 |
+
st.markdown(f"![image](data:image/png;base64,{selected_image_base64})")
|
352 |
+
|
353 |
+
# Create and display the download link
|
354 |
+
download_link = create_download_link("downloaded_image.png", selected_image_base64)
|
355 |
+
st.markdown(download_link, unsafe_allow_html=True)
|
356 |
+
else:
|
357 |
+
st.sidebar.write("Failed to load the image.")
|
358 |
+
except:
|
359 |
+
st.write('Sidebar Fail - Check your Images')
|
360 |
# ---- Art Card Sidebar with random selection of image.
|
361 |
|
362 |
|