Spaces:
Sleeping
Sleeping
# app.py | |
import streamlit as st | |
import main | |
def app(): | |
st.title("Image Generator and Upscaler") | |
text_prompt = st.text_input("Enter your text prompt") | |
clipdrop_api_key = st.text_input("Enter your ClipDrop API Key", type="password") | |
stability_api_key = st.text_input("Enter your Stability API Key", type="password") | |
replicate_api_token = st.text_input("Enter your Replicate API Token", type="password") | |
if st.button("Generate and Upscale Image"): | |
if text_prompt and clipdrop_api_key and stability_api_key and replicate_api_token: | |
final_img = main.generate_and_upscale_image( | |
text_prompt, clipdrop_api_key, stability_api_key, replicate_api_token | |
) | |
if final_img is not None: | |
st.image(final_img) | |
else: | |
st.write("An error occurred. Please try again.") | |
else: | |
st.write("Please enter all required fields.") | |
if __name__ == "__main__": | |
app() | |