Spaces:
Sleeping
Sleeping
File size: 962 Bytes
8bb6a15 656d47c c17fbdc 8bb6a15 c17fbdc 8bb6a15 c17fbdc 8bb6a15 c17fbdc 8bb6a15 c17fbdc 8bb6a15 c17fbdc |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# app.py
import streamlit as st
from main import generate_and_upscale_image
st.title('Text to Image Generator and Upscaler')
clipdrop_api_key = st.secrets['CLIPDROP_API_KEY']
stability_api_key = st.secrets['STABILITY_API_KEY']
replicate_api_token = st.secrets['REPLICATE_API_TOKEN']
download_path = st.text_input('Enter the download path', value='')
text_prompt = st.text_input('Enter your text prompt', value='')
if st.button('Generate and Upscale Image'):
if text_prompt and download_path:
try:
generate_and_upscale_image(
text_prompt,
clipdrop_api_key,
stability_api_key,
replicate_api_token,
download_path
)
st.success('Image saved successfully at the specified download path.')
except Exception as e:
st.error(f"An error occurred: {e}")
else:
st.error('Please ensure all fields are filled.') |