Spaces:
Sleeping
Sleeping
# 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) | |