BowoZZZ commited on
Commit
dbb5fcf
·
verified ·
1 Parent(s): 92c2304

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -14,12 +14,12 @@ def query(payload):
14
  return response.content
15
 
16
  # Check for 'text' parameter in URL
17
- query_params = st.experimental_get_query_params()
18
- prompt_from_url = query_params.get('text', None)
19
 
20
  if prompt_from_url:
21
  # If 'text' parameter is present, generate and display the image only
22
- prompt = prompt_from_url[0]
23
  image_bytes = query({"inputs": prompt})
24
  image = Image.open(io.BytesIO(image_bytes))
25
  st.image(image, caption="Generated Image", use_container_width=True)
 
14
  return response.content
15
 
16
  # Check for 'text' parameter in URL
17
+ query_params = st.query_params
18
+ prompt_from_url = query_params.get('text')
19
 
20
  if prompt_from_url:
21
  # If 'text' parameter is present, generate and display the image only
22
+ prompt = prompt_from_url
23
  image_bytes = query({"inputs": prompt})
24
  image = Image.open(io.BytesIO(image_bytes))
25
  st.image(image, caption="Generated Image", use_container_width=True)