Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
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()
|