Kvikontent commited on
Commit
76d108c
1 Parent(s): 36e845c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -13,10 +13,11 @@ model = st.sidebar.selectbox("Choose Model", ("prodia", "pollinations", "Dall-e
13
 
14
  prompt = st.sidebar.text_input("Prompt", "")
15
 
16
- if model == "prodia" or model == "pollinations":
17
- try:
18
- resp = Client.create_generation(model, prompt)
19
- image = Image.open(BytesIO(resp))
20
- st.image(image, caption="Generated Image")
21
- except Exception as e:
22
- st.error(str(e))
 
 
13
 
14
  prompt = st.sidebar.text_input("Prompt", "")
15
 
16
+ if prompt:
17
+ if model == "prodia" or model == "pollinations":
18
+ try:
19
+ resp = Client.create_generation(model, prompt)
20
+ image = Image.open(BytesIO(resp))
21
+ st.image(image, caption="Generated Image")
22
+ except Exception as e:
23
+ st.error(str(e))