Aklavya commited on
Commit
04fd516
·
verified ·
1 Parent(s): 9d826f6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -5
app.py CHANGED
@@ -74,12 +74,18 @@ def generate(
74
  }
75
 
76
  images = model(**options).images
77
- image_paths = [save_image(img) for img in images]
 
 
 
 
 
 
78
  return image_paths, seed
79
 
80
  with gr.Blocks(theme="soft") as demo:
81
  # Centered text "SNAPSCRIBE" at the top of the screen
82
- gr.Markdown("<h1 style='text-align:center; color:white; font-weight:bold; font-size: 30px; text-decoration:underline;'>SNAPSCRIBE</h1>")
83
 
84
  with gr.Row():
85
  with gr.Column(scale=3):
@@ -91,7 +97,7 @@ with gr.Blocks(theme="soft") as demo:
91
  run_button = gr.Button("Generate Image")
92
  gr.Markdown("Developed using the RealVisXL_V5.0_Lightning model.", elem_id="model_info")
93
  with gr.Column(scale=7):
94
- result = gr.Gallery(label="Generated Images", columns=2, height=600) # Increased height by 120%
95
 
96
  run_button.click(
97
  fn=generate,
@@ -107,8 +113,8 @@ with gr.Blocks(theme="soft") as demo:
107
  left: 0;
108
  bottom: 0;
109
  width: 100%;
110
- background-color: #0B0F19;
111
- color: white;
112
  text-align: center;
113
  }
114
  </style>
 
74
  }
75
 
76
  images = model(**options).images
77
+ image_paths = []
78
+ for img in images:
79
+ # Save the image and create a caption (we use the filename as the caption)
80
+ image_path = save_image(img)
81
+ caption = os.path.basename(image_path) # Use the filename as the caption
82
+ image_paths.append((image_path, caption)) # Add the image and caption as a tuple
83
+
84
  return image_paths, seed
85
 
86
  with gr.Blocks(theme="soft") as demo:
87
  # Centered text "SNAPSCRIBE" at the top of the screen
88
+ gr.Markdown("<h1 style='text-align:center; color:white; font-weight:bold; text-decoration:underline;'>SNAPSCRIBE</h1>")
89
 
90
  with gr.Row():
91
  with gr.Column(scale=3):
 
97
  run_button = gr.Button("Generate Image")
98
  gr.Markdown("Developed using the RealVisXL_V5.0_Lightning model.", elem_id="model_info")
99
  with gr.Column(scale=7):
100
+ result = gr.Gallery(label="Generated Images", columns=2, height=1224) # Increased height by 120%
101
 
102
  run_button.click(
103
  fn=generate,
 
113
  left: 0;
114
  bottom: 0;
115
  width: 100%;
116
+ background-color: white;
117
+ color: black;
118
  text-align: center;
119
  }
120
  </style>