Mobil-DataLab commited on
Commit
991f305
1 Parent(s): 6aa35ae

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +27 -2
app.py CHANGED
@@ -44,6 +44,31 @@ def generate_image(image, prompt, seed, random_seed, low_thresh, high_thresh, gu
44
 
45
  return result, seed
46
 
47
- # Interfaz de usuario Gradio
48
  with gr.Blocks() as demo:
49
- gr.Markdown("# Generador de Imágenes con FLUX.1 Canny-dev 🚀")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
  return result, seed
46
 
47
+ # Interfaz Gradio
48
  with gr.Blocks() as demo:
49
+ gr.Markdown("# Generador de Imágenes con FLUX.1 Canny 🚀")
50
+
51
+ with gr.Row():
52
+ image_input = gr.Image(type="pil", label="Sube tu imagen de control")
53
+ result_image = gr.Image(label="Imagen Generada")
54
+
55
+ with gr.Row():
56
+ prompt = gr.Textbox(label="Prompt", placeholder="Describe la imagen que deseas generar...")
57
+ generate_button = gr.Button("Generar Imagen")
58
+
59
+ with gr.Accordion("Configuración Avanzada", open=False):
60
+ seed = gr.Slider(label="Seed", minimum=0, maximum=MAX_SEED, step=1, value=0)
61
+ random_seed = gr.Checkbox(label="Randomizar Seed", value=True)
62
+ low_thresh = gr.Slider(label="Umbral Bajo Canny", minimum=0, maximum=255, step=1, value=50)
63
+ high_thresh = gr.Slider(label="Umbral Alto Canny", minimum=0, maximum=255, step=1, value=200)
64
+ guidance_scale = gr.Slider(label="Guidance Scale", minimum=1.0, maximum=30.0, step=0.1, value=7.5)
65
+ num_inference_steps = gr.Slider(label="Pasos de Inferencia", minimum=1, maximum=50, step=1, value=20)
66
+
67
+ generate_button.click(
68
+ generate_image,
69
+ inputs=[image_input, prompt, seed, random_seed, low_thresh, high_thresh, guidance_scale, num_inference_steps],
70
+ outputs=[result_image, seed]
71
+ )
72
+
73
+ if __name__ == "__main__":
74
+ demo.launch()