gaur3009 commited on
Commit
8fde5fd
·
verified ·
1 Parent(s): 5e08392

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -15
app.py CHANGED
@@ -104,21 +104,17 @@ def change_dress_color(img, color_prompt):
104
  print(f"Error: {e}")
105
  return img
106
 
107
- # Gradio UI
108
- with gr.Blocks() as demo:
109
- gr.Markdown("## 🎨 AI Dress Recolorer - Prompt Based")
110
- gr.Markdown("Upload an image and type a color (e.g., 'lavender', 'light green', 'royal blue').")
111
-
112
- with gr.Row():
113
- with gr.Column():
114
- input_image = gr.Image(type="pil", label="Upload Image")
115
- color_input = gr.Textbox(label="Enter Dress Color", placeholder="e.g. crimson, lavender, sky blue")
116
- recolor_btn = gr.Button("Apply New Color")
117
-
118
- with gr.Column():
119
- output_image = gr.Image(type="pil", label="Recolored Result")
120
-
121
- recolor_btn.click(fn=change_dress_color, inputs=[input_image, color_input], outputs=output_image)
122
 
123
  if __name__ == "__main__":
124
  demo.launch()
 
104
  print(f"Error: {e}")
105
  return img
106
 
107
+ # Fixed Gradio UI using Interface instead of Blocks
108
+ demo = gr.Interface(
109
+ fn=change_dress_color,
110
+ inputs=[
111
+ gr.Image(type="pil", label="Upload Image"),
112
+ gr.Textbox(label="Enter Dress Color", placeholder="e.g. crimson, lavender, sky blue")
113
+ ],
114
+ outputs=gr.Image(type="pil", label="Recolored Result"),
115
+ title="🎨 AI Dress Recolorer - Prompt Based",
116
+ description="Upload an image and type a color (e.g., 'lavender', 'light green', 'royal blue')."
117
+ )
 
 
 
 
118
 
119
  if __name__ == "__main__":
120
  demo.launch()