Spaces:
Build error

pratyyush commited on
Commit
e071ccb
·
verified ·
1 Parent(s): 998cc50

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -40,23 +40,23 @@ def colorizer_fn(input_img):
40
  else:
41
  return None
42
 
43
- # ✅ Custom CSS for Fixed Output Image Display
44
  custom_css = """
45
  body, .gradio-container { background-color: black !important; color: white !important; }
46
- .gr-box { width: 100% !important; }
47
- img { max-width: 800px !important; max-height: 600px !important; object-fit: contain; } /* Fixed output size */
48
  footer {display: none !important;} /* Hide footer */
49
  button[title="Share"] { display: none !important; } /* Hides the Share button */
50
  """
51
 
52
  # Gradio Interface (Image uploader + Slider output)
53
  with gr.Blocks(css=custom_css) as demo:
54
- gr.Markdown("# AI Image Colorizer with Slider")
55
 
56
  # File uploader
57
  image_input = gr.File(label="Select Image", file_types=[".png", ".jpg", ".jpeg"])
58
 
59
- # Image Slider for comparison
60
  output = ImageSlider(label="Old vs Colorized Image", type="filepath")
61
 
62
  # Process image when uploaded
 
40
  else:
41
  return None
42
 
43
+ # ✅ Custom CSS to make images fit the full output box
44
  custom_css = """
45
  body, .gradio-container { background-color: black !important; color: white !important; }
46
+ .gr-box { width: 100% !important; height: 100% !important; }
47
+ img { width: 100% !important; height: 100% !important; object-fit: cover !important; } /* Stretch images to fit */
48
  footer {display: none !important;} /* Hide footer */
49
  button[title="Share"] { display: none !important; } /* Hides the Share button */
50
  """
51
 
52
  # Gradio Interface (Image uploader + Slider output)
53
  with gr.Blocks(css=custom_css) as demo:
54
+ gr.Markdown("# AI Image Colorizer with Full-Sized Slider")
55
 
56
  # File uploader
57
  image_input = gr.File(label="Select Image", file_types=[".png", ".jpg", ".jpeg"])
58
 
59
+ # Image Slider for comparison with full-size images
60
  output = ImageSlider(label="Old vs Colorized Image", type="filepath")
61
 
62
  # Process image when uploaded