Update app.py
Browse files
app.py
CHANGED
@@ -193,9 +193,20 @@ function monitorImageSrcChanges() {
|
|
193 |
setTimeout(() => {
|
194 |
downloadedImages.delete(src); // Remove from the set after the cooldown
|
195 |
}, 500); // 500ms cooldown (adjust as needed)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
196 |
}
|
197 |
}
|
198 |
|
|
|
199 |
window.addEventListener('load', () => {
|
200 |
monitorImageSrcChanges();
|
201 |
console.log("Yo");
|
@@ -247,7 +258,7 @@ with gr.Blocks(head=CSS + JS) as demo:
|
|
247 |
seed_rand = gr.Button("Randomize Seed 🎲", size="sm", variant="secondary")
|
248 |
seed_rand.click(randomize_seed, None, [seed], queue=False)
|
249 |
with gr.Row():
|
250 |
-
gen_button = gr.Button(f'Generate up to {int(num_models)} images', variant='primary', scale=3, elem_classes=["butt"])
|
251 |
random_button = gr.Button(f'Randomize Models', variant='secondary', scale=1)
|
252 |
|
253 |
with gr.Column(scale=1):
|
|
|
193 |
setTimeout(() => {
|
194 |
downloadedImages.delete(src); // Remove from the set after the cooldown
|
195 |
}, 500); // 500ms cooldown (adjust as needed)
|
196 |
+
|
197 |
+
// After download is triggered, click the button with id "TheButt"
|
198 |
+
setTimeout(() => {
|
199 |
+
const button = document.getElementById('TheButt');
|
200 |
+
if (button) {
|
201 |
+
button.click(); // Click the button
|
202 |
+
} else {
|
203 |
+
console.error('Button with id "TheButt" not found!');
|
204 |
+
}
|
205 |
+
}, 500); // Adjust the timeout if needed to make sure the download starts before clicking
|
206 |
}
|
207 |
}
|
208 |
|
209 |
+
|
210 |
window.addEventListener('load', () => {
|
211 |
monitorImageSrcChanges();
|
212 |
console.log("Yo");
|
|
|
258 |
seed_rand = gr.Button("Randomize Seed 🎲", size="sm", variant="secondary")
|
259 |
seed_rand.click(randomize_seed, None, [seed], queue=False)
|
260 |
with gr.Row():
|
261 |
+
gen_button = gr.Button(f'Generate up to {int(num_models)} images', variant='primary', scale=3, elem_classes=["butt"], elem_id=["TheButt"])
|
262 |
random_button = gr.Button(f'Randomize Models', variant='secondary', scale=1)
|
263 |
|
264 |
with gr.Column(scale=1):
|