Spaces:
Sleeping
Sleeping
File size: 990 Bytes
8bb6a15 656d47c 5f0e6f8 8bb6a15 5f0e6f8 8bb6a15 5f0e6f8 8bb6a15 5f0e6f8 8bb6a15 5f0e6f8 8bb6a15 5f0e6f8 8bb6a15 5f0e6f8 |
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
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()
|