Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- auto_diffusers.log +0 -0
- gradio_app.py +39 -11
auto_diffusers.log
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
gradio_app.py
CHANGED
@@ -282,7 +282,7 @@ def create_gradio_interface():
|
|
282 |
background: #f0c5b8 !important;
|
283 |
}
|
284 |
|
285 |
-
/* Modal Overlay -
|
286 |
.modal-overlay {
|
287 |
position: fixed !important;
|
288 |
top: 0 !important;
|
@@ -297,6 +297,11 @@ def create_gradio_interface():
|
|
297 |
box-sizing: border-box !important;
|
298 |
}
|
299 |
|
|
|
|
|
|
|
|
|
|
|
300 |
/* Modal Content */
|
301 |
.modal-content {
|
302 |
background: #fefcfa !important;
|
@@ -751,7 +756,7 @@ def create_gradio_interface():
|
|
751 |
</script>
|
752 |
|
753 |
<script>
|
754 |
-
// Fix CodeMirror text selection after page loads
|
755 |
document.addEventListener('DOMContentLoaded', function() {
|
756 |
setTimeout(function() {
|
757 |
// Find all CodeMirror editors
|
@@ -775,22 +780,45 @@ def create_gradio_interface():
|
|
775 |
e.stopPropagation();
|
776 |
});
|
777 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
778 |
}, 1000);
|
779 |
});
|
780 |
</script>
|
781 |
|
782 |
<style>
|
783 |
|
784 |
-
/*
|
|
|
|
|
|
|
785 |
button.label-wrap > span:first-child,
|
786 |
-
|
787 |
-
|
788 |
-
font-size: 1.1rem !important;
|
789 |
font-weight: 900 !important;
|
790 |
-
color: #
|
791 |
font-family: 'Georgia', serif !important;
|
792 |
line-height: 1.3 !important;
|
793 |
-
text-shadow: 0 1px 2px rgba(0,0,0,0.
|
794 |
letter-spacing: 0.5px !important;
|
795 |
text-transform: none !important;
|
796 |
}
|
@@ -1634,13 +1662,13 @@ def create_gradio_interface():
|
|
1634 |
return (full_code, full_code, False, gr.update(visible=True), actual_prompt,
|
1635 |
gr.update(open=False), gr.update(open=False)) # display_code, stored_code, reset_collapsed_state, show_button, prompt, close_hardware_accordion, close_model_accordion
|
1636 |
|
1637 |
-
# Modal functions
|
1638 |
def show_modal(prompt):
|
1639 |
-
return gr.update(visible=True), prompt
|
1640 |
|
1641 |
def hide_modal():
|
1642 |
print("Close modal button clicked!") # Debug
|
1643 |
-
return gr.update(visible=False), ""
|
1644 |
|
1645 |
# Generate button click
|
1646 |
generate_btn.click(
|
|
|
282 |
background: #f0c5b8 !important;
|
283 |
}
|
284 |
|
285 |
+
/* Modal Overlay - simple approach */
|
286 |
.modal-overlay {
|
287 |
position: fixed !important;
|
288 |
top: 0 !important;
|
|
|
297 |
box-sizing: border-box !important;
|
298 |
}
|
299 |
|
300 |
+
/* Show as flex only when visible class is present */
|
301 |
+
.modal-overlay.visible {
|
302 |
+
display: flex !important;
|
303 |
+
}
|
304 |
+
|
305 |
/* Modal Content */
|
306 |
.modal-content {
|
307 |
background: #fefcfa !important;
|
|
|
756 |
</script>
|
757 |
|
758 |
<script>
|
759 |
+
// Fix CodeMirror text selection and accordion titles after page loads
|
760 |
document.addEventListener('DOMContentLoaded', function() {
|
761 |
setTimeout(function() {
|
762 |
// Find all CodeMirror editors
|
|
|
780 |
e.stopPropagation();
|
781 |
});
|
782 |
});
|
783 |
+
|
784 |
+
// Fix accordion title font sizes - focus on first span only
|
785 |
+
const accordionButtons = document.querySelectorAll('button.label-wrap, button[class*="label-wrap"]');
|
786 |
+
accordionButtons.forEach(button => {
|
787 |
+
// Find and style the text span (first span child) - this is the most important part
|
788 |
+
const textSpan = button.querySelector('span:first-child');
|
789 |
+
if (textSpan) {
|
790 |
+
textSpan.style.fontSize = '1.5rem';
|
791 |
+
textSpan.style.fontWeight = '900';
|
792 |
+
textSpan.style.fontFamily = 'Georgia, serif';
|
793 |
+
textSpan.style.color = '#2d1810';
|
794 |
+
textSpan.style.textShadow = '0 1px 2px rgba(0,0,0,0.2)';
|
795 |
+
textSpan.style.letterSpacing = '0.5px';
|
796 |
+
textSpan.style.lineHeight = '1.3';
|
797 |
+
|
798 |
+
// Force override any existing styles
|
799 |
+
textSpan.style.setProperty('font-size', '1.5rem', 'important');
|
800 |
+
textSpan.style.setProperty('font-weight', '900', 'important');
|
801 |
+
textSpan.style.setProperty('font-family', 'Georgia, serif', 'important');
|
802 |
+
}
|
803 |
+
});
|
804 |
}, 1000);
|
805 |
});
|
806 |
</script>
|
807 |
|
808 |
<style>
|
809 |
|
810 |
+
/* Specific accordion title styling - target the first span */
|
811 |
+
button.label-wrap span:first-child,
|
812 |
+
button.label-wrap.svelte-1w6vloh span:first-child,
|
813 |
+
.label-wrap span:first-child,
|
814 |
button.label-wrap > span:first-child,
|
815 |
+
button[class*="label-wrap"] span:first-child {
|
816 |
+
font-size: 1.5rem !important;
|
|
|
817 |
font-weight: 900 !important;
|
818 |
+
color: #2d1810 !important;
|
819 |
font-family: 'Georgia', serif !important;
|
820 |
line-height: 1.3 !important;
|
821 |
+
text-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
|
822 |
letter-spacing: 0.5px !important;
|
823 |
text-transform: none !important;
|
824 |
}
|
|
|
1662 |
return (full_code, full_code, False, gr.update(visible=True), actual_prompt,
|
1663 |
gr.update(open=False), gr.update(open=False)) # display_code, stored_code, reset_collapsed_state, show_button, prompt, close_hardware_accordion, close_model_accordion
|
1664 |
|
1665 |
+
# Modal functions with CSS class control
|
1666 |
def show_modal(prompt):
|
1667 |
+
return gr.update(visible=True, elem_classes="modal-overlay visible"), prompt
|
1668 |
|
1669 |
def hide_modal():
|
1670 |
print("Close modal button clicked!") # Debug
|
1671 |
+
return gr.update(visible=False, elem_classes="modal-overlay"), ""
|
1672 |
|
1673 |
# Generate button click
|
1674 |
generate_btn.click(
|