Update app.py
Browse files
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.
|
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)
|
|
|
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)
|