ehristoforu commited on
Commit
87ccafd
·
verified ·
1 Parent(s): ad0d335

Update page4.py

Browse files
Files changed (1) hide show
  1. page4.py +2 -5
page4.py CHANGED
@@ -25,16 +25,13 @@ def query_model(text_input):
25
  return response.content
26
 
27
  def sdxl():
28
- st.write("ForgeImage")
29
  text_input = st.text_input("Enter your prompt:", "Astronaut riding a horse")
30
 
31
- generated_image = None # Инициализация переменной
32
 
33
  if st.button("Create"):
34
  image_bytes = query_model(text_input)
35
  generated_image = Image.open(io.BytesIO(image_bytes))
36
 
37
- if generated_image is not None: # Проверка, что переменная существует
38
  st.image(generated_image, use_column_width=True)
39
-
40
- sdxl()
 
25
  return response.content
26
 
27
  def sdxl():
 
28
  text_input = st.text_input("Enter your prompt:", "Astronaut riding a horse")
29
 
30
+ generated_image = None
31
 
32
  if st.button("Create"):
33
  image_bytes = query_model(text_input)
34
  generated_image = Image.open(io.BytesIO(image_bytes))
35
 
36
+ if generated_image is not None:
37
  st.image(generated_image, use_column_width=True)