Spaces:
Sleeping
Sleeping
File size: 896 Bytes
656d47c 27fea1c 656d47c 27fea1c 656d47c 27fea1c |
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 |
# app.py
import streamlit as st
from main import generate_image_from_text, upscale_image_stable_diffusion, further_upscale_image
def main():
st.title("Image Generation and Upscaling")
st.write("Enter a text prompt and an image will be generated and upscaled.")
prompt = st.text_input("Enter a textual prompt to generate an image...")
if prompt:
st.success("Generating image from text prompt...")
image_bytes = generate_image_from_text(prompt)
st.success("Upscaling image with stable-diffusion-x4-latent-upscaler...")
upscaled_image_bytes = upscale_image_stable_diffusion(image_bytes)
st.success("Further upscaling image with GFPGAN...")
img = further_upscale_image(upscaled_image_bytes)
st.image(img, caption='Upscaled Image', use_column_width=True)
if __name__ == "__main__":
main()
|