import streamlit as st from PIL import Image from inference import inference import io def main(): st.title("Image Display App") # Button to trigger image generation if st.button('Generate Image'): # Call the function from inference.py image = inference() # Convert Pillow image to bytes for display in Streamlit img_buffer = io.BytesIO() image.save(img_buffer, format="PNG") img_buffer.seek(0) # Display the image st.image(img_buffer, caption='Generated Image', use_column_width=True) if __name__ == "__main__": main()