Shankarm08 commited on
Commit
f59ffa4
·
verified ·
1 Parent(s): 43fef18

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -2
app.py CHANGED
@@ -6,6 +6,7 @@ import io
6
  # Load the pre-trained model
7
  pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
8
 
 
9
  # Create a Streamlit interface
10
  st.title("Image Generation Model")
11
  st.write("Enter a prompt for the image generation model:")
@@ -16,12 +17,10 @@ if st.button("Generate Image"):
16
  with st.spinner("Generating image..."):
17
  # Generate the image
18
  image = pipeline(prompt).images[0]
19
-
20
  # Convert the image to bytes
21
  buf = io.BytesIO()
22
  image.save(buf, format='JPEG')
23
  img_bytes = buf.getvalue()
24
-
25
  # Display the generated image
26
  st.write("Generated image:")
27
  st.image(img_bytes, caption="Generated image", use_column_width=True)
 
6
  # Load the pre-trained model
7
  pipeline = DiffusionPipeline.from_pretrained("runwayml/stable-diffusion-v1-5")
8
 
9
+
10
  # Create a Streamlit interface
11
  st.title("Image Generation Model")
12
  st.write("Enter a prompt for the image generation model:")
 
17
  with st.spinner("Generating image..."):
18
  # Generate the image
19
  image = pipeline(prompt).images[0]
 
20
  # Convert the image to bytes
21
  buf = io.BytesIO()
22
  image.save(buf, format='JPEG')
23
  img_bytes = buf.getvalue()
 
24
  # Display the generated image
25
  st.write("Generated image:")
26
  st.image(img_bytes, caption="Generated image", use_column_width=True)