phyloforfun commited on
Commit
a3d159a
1 Parent(s): ab9dab7

file upload gallery

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -568,8 +568,11 @@ def display_image_gallery():
568
  # Loop through each image in the input list
569
  for image_path in st.session_state['input_list']:
570
  # Convert the image to base64 (assuming you have this utility function)
571
- img_file = Image.open(image_path).thumbnail((120, 120), Image.Resampling.LANCZOS)
572
- base64_image = image_to_base64(img_file)
 
 
 
573
 
574
  # Embed the image with the determined width in the custom div
575
  img_html = f"""
@@ -1170,7 +1173,7 @@ def content_tab_settings():
1170
  if selected_version not in versions:
1171
  selected_version = default_version
1172
  st.session_state.config['leafmachine']['project']['prompt_version'] = st.selectbox("Prompt Version", versions, index=versions.index(selected_version),label_visibility='collapsed')
1173
- st.markdown("Several prompts are provided. Visit the 'Prompt Builder' tab to upload your own prompt. If you would like to make your prompt available to others or have the prompt in the dropdown by default, [please submit the yaml through this form.]()")
1174
 
1175
  ### Input Images Local
1176
  with col_local_1:
 
568
  # Loop through each image in the input list
569
  for image_path in st.session_state['input_list']:
570
  # Convert the image to base64 (assuming you have this utility function)
571
+ img = Image.open(image_path)
572
+ img.thumbnail((120, 120), Image.Resampling.LANCZOS) # This modifies 'img' in place
573
+
574
+ # Convert the image to base64
575
+ base64_image = image_to_base64(img)
576
 
577
  # Embed the image with the determined width in the custom div
578
  img_html = f"""
 
1173
  if selected_version not in versions:
1174
  selected_version = default_version
1175
  st.session_state.config['leafmachine']['project']['prompt_version'] = st.selectbox("Prompt Version", versions, index=versions.index(selected_version),label_visibility='collapsed')
1176
+ st.markdown("Several prompts are provided. Visit the 'Prompt Builder' tab to upload your own prompt. If you would like to make your prompt available to others or have the prompt in the dropdown by default, [please submit the yaml through this form.](https://forms.gle/d1sHV5Y7Y5NxMQzM9)")
1177
 
1178
  ### Input Images Local
1179
  with col_local_1: