Spaces:
Running
Running
salomonsky
commited on
Commit
•
c62ce13
1
Parent(s):
cf3ba40
Update app.py
Browse files
app.py
CHANGED
@@ -153,13 +153,13 @@ def login_form():
|
|
153 |
st.error("Credenciales incorrectas. Intenta de nuevo.")
|
154 |
|
155 |
def upload_image_to_gallery():
|
156 |
-
uploaded_image = st.file_uploader("Sube una imagen a la galería", type=["jpg", "jpeg", "png"])
|
157 |
if uploaded_image:
|
158 |
image = Image.open(uploaded_image)
|
159 |
image_path = save_image(image, f"{uploaded_image.name}")
|
160 |
if image_path:
|
161 |
save_prompt("uploaded by user")
|
162 |
-
st.success(f"Imagen subida: {image_path}")
|
163 |
|
164 |
def main():
|
165 |
st.set_page_config(layout="wide")
|
@@ -171,14 +171,18 @@ def main():
|
|
171 |
st.title("Flux +Upscale +Prompt Enhancer +FaceSwap")
|
172 |
generated_image_path = st.session_state.get('generated_image_path')
|
173 |
st.header("Generador de Imágenes")
|
|
|
|
|
174 |
prompt = st.sidebar.text_area("Descripción de la imagen", height=150, max_chars=500)
|
175 |
format_option = st.sidebar.selectbox("Formato", ["9:16", "16:9"])
|
176 |
model_option = st.sidebar.selectbox("Modelo", ["black-forest-labs/FLUX.1-schnell", "black-forest-labs/FLUX.1-dev"])
|
177 |
prompt_checkbox = st.sidebar.checkbox("Prompt Enhancer")
|
178 |
upscale_checkbox = st.sidebar.checkbox("Escalar imagen")
|
179 |
width, height = (720, 1280) if format_option == "9:16" else (1280, 720)
|
180 |
-
upload_image_to_gallery()
|
181 |
|
|
|
|
|
|
|
182 |
if prompt_checkbox:
|
183 |
with st.spinner("Mejorando el prompt..."):
|
184 |
try:
|
|
|
153 |
st.error("Credenciales incorrectas. Intenta de nuevo.")
|
154 |
|
155 |
def upload_image_to_gallery():
|
156 |
+
uploaded_image = st.sidebar.file_uploader("Sube una imagen a la galería", type=["jpg", "jpeg", "png"])
|
157 |
if uploaded_image:
|
158 |
image = Image.open(uploaded_image)
|
159 |
image_path = save_image(image, f"{uploaded_image.name}")
|
160 |
if image_path:
|
161 |
save_prompt("uploaded by user")
|
162 |
+
st.sidebar.success(f"Imagen subida: {image_path}")
|
163 |
|
164 |
def main():
|
165 |
st.set_page_config(layout="wide")
|
|
|
171 |
st.title("Flux +Upscale +Prompt Enhancer +FaceSwap")
|
172 |
generated_image_path = st.session_state.get('generated_image_path')
|
173 |
st.header("Generador de Imágenes")
|
174 |
+
|
175 |
+
# Mover la subida de imagen a la barra lateral
|
176 |
prompt = st.sidebar.text_area("Descripción de la imagen", height=150, max_chars=500)
|
177 |
format_option = st.sidebar.selectbox("Formato", ["9:16", "16:9"])
|
178 |
model_option = st.sidebar.selectbox("Modelo", ["black-forest-labs/FLUX.1-schnell", "black-forest-labs/FLUX.1-dev"])
|
179 |
prompt_checkbox = st.sidebar.checkbox("Prompt Enhancer")
|
180 |
upscale_checkbox = st.sidebar.checkbox("Escalar imagen")
|
181 |
width, height = (720, 1280) if format_option == "9:16" else (1280, 720)
|
|
|
182 |
|
183 |
+
# Subir imagen desde la barra lateral
|
184 |
+
upload_image_to_gallery()
|
185 |
+
|
186 |
if prompt_checkbox:
|
187 |
with st.spinner("Mejorando el prompt..."):
|
188 |
try:
|