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