Spaces:
Running
Running
salomonsky
commited on
Commit
•
c05358b
1
Parent(s):
e60811a
Update app.py
Browse files
app.py
CHANGED
@@ -65,7 +65,6 @@ async def gen(prompt, basemodel, width, height, scales, steps, seed, upscale_fac
|
|
65 |
image_path = DATA_PATH / f"image_{seed}.jpg"
|
66 |
image.save(image_path, format="JPEG")
|
67 |
|
68 |
-
# Save the prompt used in a text file
|
69 |
prompt_file_path = DATA_PATH / f"prompt_{seed}.txt"
|
70 |
with open(prompt_file_path, "w") as prompt_file:
|
71 |
prompt_file.write(combined_prompt)
|
@@ -142,14 +141,22 @@ if st.sidebar.button("Mejorar prompt"):
|
|
142 |
if st.sidebar.button("Generar Imagen"):
|
143 |
with st.spinner("Generando imagen..."):
|
144 |
result = run_gen()
|
145 |
-
image_paths = result[0]
|
146 |
-
prompt_file = result[1]
|
|
|
|
|
147 |
|
148 |
if image_paths:
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
files, usage = get_storage()
|
155 |
st.text(usage)
|
|
|
65 |
image_path = DATA_PATH / f"image_{seed}.jpg"
|
66 |
image.save(image_path, format="JPEG")
|
67 |
|
|
|
68 |
prompt_file_path = DATA_PATH / f"prompt_{seed}.txt"
|
69 |
with open(prompt_file_path, "w") as prompt_file:
|
70 |
prompt_file.write(combined_prompt)
|
|
|
141 |
if st.sidebar.button("Generar Imagen"):
|
142 |
with st.spinner("Generando imagen..."):
|
143 |
result = run_gen()
|
144 |
+
image_paths = result[0]
|
145 |
+
prompt_file = result[1]
|
146 |
+
|
147 |
+
st.write(f"Image paths: {image_paths}")
|
148 |
|
149 |
if image_paths:
|
150 |
+
if Path(image_paths).exists():
|
151 |
+
st.image(image_paths, caption="Imagen Generada")
|
152 |
+
else:
|
153 |
+
st.error("El archivo de imagen no existe.")
|
154 |
+
|
155 |
+
if prompt_file and Path(prompt_file).exists():
|
156 |
+
prompt_text = Path(prompt_file).read_text()
|
157 |
+
st.write(f"Prompt utilizado: {prompt_text}")
|
158 |
+
else:
|
159 |
+
st.write("El archivo del prompt no está disponible.")
|
160 |
|
161 |
files, usage = get_storage()
|
162 |
st.text(usage)
|