Spaces:
Running
Running
Improve image quality
Browse files- globales.py +10 -11
- herramientas.py +5 -12
globales.py
CHANGED
|
@@ -1,9 +1,18 @@
|
|
| 1 |
import autenticacion
|
| 2 |
|
| 3 |
#previo = "Una fotografía de un plato blanco con "
|
| 4 |
-
previo = "A
|
|
|
|
| 5 |
llave, servidor, hora_renovacion = autenticacion.defineAmbiente()
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
# espacio = [
|
| 9 |
# "black-forest-labs/FLUX.1-dev",
|
|
@@ -13,13 +22,3 @@ llave, servidor, hora_renovacion = autenticacion.defineAmbiente()
|
|
| 13 |
# #"stabilityai/stable-diffusion"
|
| 14 |
|
| 15 |
# ]
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
#espacio = "black-forest-labs/FLUX.1-dev"
|
| 19 |
-
inferencia = "black-forest-labs/FLUX.1-dev"
|
| 20 |
-
inferencia_backup = "black-forest-labs/FLUX.1-schnell"
|
| 21 |
-
proveedor = "hf-inference" #falai
|
| 22 |
-
proveedor_back = "fal-ai"
|
| 23 |
-
work_cost = 1 #Los segundos que cuesta la generación de una imagen, para control de la capa gratuita.
|
| 24 |
-
inference_cost = 1
|
| 25 |
-
quota = 1500
|
|
|
|
| 1 |
import autenticacion
|
| 2 |
|
| 3 |
#previo = "Una fotografía de un plato blanco con "
|
| 4 |
+
#previo = "A photograph of a white plate with a visually appealing culinary dish of "
|
| 5 |
+
previo = "A pic of a white plate with a appealing culinary dish of "
|
| 6 |
llave, servidor, hora_renovacion = autenticacion.defineAmbiente()
|
| 7 |
|
| 8 |
+
#espacio = "black-forest-labs/FLUX.1-dev"
|
| 9 |
+
inferencia = "black-forest-labs/FLUX.1-dev"
|
| 10 |
+
inferencia_backup = "black-forest-labs/FLUX.1-schnell"
|
| 11 |
+
proveedor = "hf-inference" #falai
|
| 12 |
+
proveedor_back = "fal-ai"
|
| 13 |
+
work_cost = 1 #Los segundos que cuesta la generación de una imagen, para control de la capa gratuita.
|
| 14 |
+
inference_cost = 1
|
| 15 |
+
quota = 1500
|
| 16 |
|
| 17 |
# espacio = [
|
| 18 |
# "black-forest-labs/FLUX.1-dev",
|
|
|
|
| 22 |
# #"stabilityai/stable-diffusion"
|
| 23 |
|
| 24 |
# ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
herramientas.py
CHANGED
|
@@ -73,7 +73,6 @@ def modificaModeloActual(nuevo_modelo):
|
|
| 73 |
problemas con el actual.
|
| 74 |
"""
|
| 75 |
|
| 76 |
-
modelo_actual = conexion_firebase.obtenDato('nowme', servidor, 'modelo_actual')
|
| 77 |
conexion_firebase.editaDato('nowme', servidor, 'modelo_actual', nuevo_modelo)
|
| 78 |
|
| 79 |
|
|
@@ -119,15 +118,14 @@ def imprimeTimeNowFixed16h():
|
|
| 119 |
mexico_city_aware_dt.year,
|
| 120 |
mexico_city_aware_dt.month,
|
| 121 |
mexico_city_aware_dt.day,
|
| 122 |
-
16,
|
| 123 |
-
0,
|
| 124 |
-
0
|
| 125 |
)
|
| 126 |
)
|
| 127 |
|
| 128 |
# 5. Formatear la fecha y hora
|
| 129 |
formatted_time = fixed_time_dt.strftime("%Y-%m-%d %H:%M:%S")
|
| 130 |
-
|
| 131 |
return formatted_time
|
| 132 |
|
| 133 |
def siEsDiaSiguienteRenueva():
|
|
@@ -147,19 +145,14 @@ def siEsDiaSiguienteRenueva():
|
|
| 147 |
fecha_registro = datetime_obj_1.date()
|
| 148 |
print("Primera extracción: ", fecha_registro)
|
| 149 |
fecha_actual = datetime_obj_2.date()
|
| 150 |
-
print("Segunda extracción: ", fecha_actual)
|
| 151 |
-
|
| 152 |
-
# Experimento de extracción de horas:
|
| 153 |
-
hora_registro = datetime_obj_1.time()
|
| 154 |
-
print("Hora Primera extracción: ", hora_registro)
|
| 155 |
|
| 156 |
# Verificar si las fechas son diferentes
|
| 157 |
resultado = fecha_actual > fecha_registro
|
| 158 |
print("Resultado de resta de fechas: ", resultado)
|
| 159 |
|
| 160 |
print("Las fechas son del tipo: ", type(fecha_registro))
|
| 161 |
-
diferencia = fecha_actual - fecha_registro
|
| 162 |
-
print("Diferencia.days es: ", diferencia.days)
|
| 163 |
|
| 164 |
if resultado == True:
|
| 165 |
print("El resultado es True, aquí checaríamos la hora.")
|
|
|
|
| 73 |
problemas con el actual.
|
| 74 |
"""
|
| 75 |
|
|
|
|
| 76 |
conexion_firebase.editaDato('nowme', servidor, 'modelo_actual', nuevo_modelo)
|
| 77 |
|
| 78 |
|
|
|
|
| 118 |
mexico_city_aware_dt.year,
|
| 119 |
mexico_city_aware_dt.month,
|
| 120 |
mexico_city_aware_dt.day,
|
| 121 |
+
16,
|
| 122 |
+
0,
|
| 123 |
+
0
|
| 124 |
)
|
| 125 |
)
|
| 126 |
|
| 127 |
# 5. Formatear la fecha y hora
|
| 128 |
formatted_time = fixed_time_dt.strftime("%Y-%m-%d %H:%M:%S")
|
|
|
|
| 129 |
return formatted_time
|
| 130 |
|
| 131 |
def siEsDiaSiguienteRenueva():
|
|
|
|
| 145 |
fecha_registro = datetime_obj_1.date()
|
| 146 |
print("Primera extracción: ", fecha_registro)
|
| 147 |
fecha_actual = datetime_obj_2.date()
|
| 148 |
+
print("Segunda extracción: ", fecha_actual)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 149 |
|
| 150 |
# Verificar si las fechas son diferentes
|
| 151 |
resultado = fecha_actual > fecha_registro
|
| 152 |
print("Resultado de resta de fechas: ", resultado)
|
| 153 |
|
| 154 |
print("Las fechas son del tipo: ", type(fecha_registro))
|
| 155 |
+
diferencia = fecha_actual - fecha_registro
|
|
|
|
| 156 |
|
| 157 |
if resultado == True:
|
| 158 |
print("El resultado es True, aquí checaríamos la hora.")
|