img / app.py
Doubleupai's picture
create app.py
1928e0b verified
raw
history blame
436 Bytes
# Image Generator with Streamlit
```python
import streamlit as st
from PIL import Image
import requests
from io import BytesIO
st.title("Image Generator")
prompt = st.text_input("Enter your prompt:")
if st.button("Generate Image"):
response = requests.get(f"https://api.example.com/generate?prompt={prompt}")
img = Image.open(BytesIO(response.content))
st.image(img, caption="Generated Image", use_column_width=True)