awacke1 commited on
Commit
a032262
1 Parent(s): 96d11b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -22
app.py CHANGED
@@ -380,29 +380,31 @@ image_urls = [
380
  "https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/Djx-k4WOxzlXEQPzllP3r.png"
381
  ]
382
 
383
- # Select a random URL from the list
384
- selected_image_url = random.choice(image_urls)
385
-
386
- # Get the base64 encoded string of the selected image
387
- st.write(selected_image_url)
388
- try:
389
- selected_image_base64 = get_image_as_base64(selected_image_url)
390
-
391
- if selected_image_base64 is not None:
392
- with st.sidebar:
393
- st.markdown("""### Graphic Novel AI""")
394
- # Display the image
395
- st.markdown(f"![image](data:image/png;base64,{selected_image_base64})")
396
-
397
- # Create and display the download link
398
- download_link = create_download_link("downloaded_image.png", selected_image_base64)
399
- st.markdown(download_link, unsafe_allow_html=True)
400
- else:
401
- st.sidebar.write("Failed to load the image.")
402
- except:
403
- st.write('Sidebar Fail - Check your Images')
404
- # ---- Art Card Sidebar with random selection of image.
405
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
406
 
407
 
408
  # Ensure the directory for storing scores exists
 
380
  "https://cdn-uploads.huggingface.co/production/uploads/620630b603825909dcbeba35/Djx-k4WOxzlXEQPzllP3r.png"
381
  ]
382
 
383
+ UseSidebarArtCard=False
384
+ if UseSidebarArtCard:
385
+ # Select a random URL from the list
386
+ selected_image_url = random.choice(image_urls)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
387
 
388
+ # Get the base64 encoded string of the selected image
389
+ st.write(selected_image_url)
390
+ try:
391
+ selected_image_base64 = get_image_as_base64(selected_image_url)
392
+
393
+ if selected_image_base64 is not None:
394
+ with st.sidebar:
395
+ st.markdown("""### Graphic Novel AI""")
396
+ # Display the image
397
+ st.markdown(f"![image](data:image/png;base64,{selected_image_base64})")
398
+
399
+ # Create and display the download link
400
+ download_link = create_download_link("downloaded_image.png", selected_image_base64)
401
+ st.markdown(download_link, unsafe_allow_html=True)
402
+ else:
403
+ st.sidebar.write("Failed to load the image.")
404
+ except:
405
+ st.write('Sidebar Fail - Check your Images')
406
+ # ---- Art Card Sidebar with random selection of image.
407
+
408
 
409
 
410
  # Ensure the directory for storing scores exists