Zaiiida commited on
Commit
a50031d
·
verified ·
1 Parent(s): 1eb4ae1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -46
app.py CHANGED
@@ -52,20 +52,25 @@ examples = [
52
  "A border collie lying in some Fall leaves as the forest trees change colors",
53
  ]
54
 
55
- # Custom CSS to modify the colors and loading animation
56
- css = """
57
  body {
58
  background-color: #17181B;
59
  color: #AEB3B8;
60
  }
61
  button {
62
- background-color: #333136;
63
- color: #AEB3B8;
64
- border: 1px solid #393637;
65
  }
66
  button:hover {
67
- background-color: #393637;
68
- color: #FFFFFF;
 
 
 
 
 
69
  }
70
  .footer, footer {
71
  display: none !important;
@@ -74,46 +79,14 @@ button:hover {
74
  margin: 0 auto;
75
  max-width: 640px;
76
  }
77
-
78
- /* Custom loading animation */
79
- .gradio-container .loading {
80
- background: none;
81
- }
82
- .gradio-container .loading::after {
83
- content: '';
84
- display: block;
85
- width: 40px;
86
- height: 40px;
87
- margin: 0 auto;
88
- border: 5px solid #AEB3B8;
89
- border-top-color: transparent;
90
- border-radius: 50%;
91
- animation: spin 1s linear infinite;
92
- }
93
-
94
- @keyframes spin {
95
- to { transform: rotate(360deg); }
96
- }
97
-
98
- /* Remove any orange highlights */
99
- input[type="range"]::-webkit-slider-thumb {
100
- background: #17181B;
101
- }
102
- input[type="range"]::-moz-range-thumb {
103
- background: #17181B;
104
- }
105
- input[type="range"]::-ms-thumb {
106
- background: #17181B;
107
- }
108
- input[type="checkbox"]:checked {
109
- background-color: #5271FF;
110
- }
111
  """
112
 
113
- with gr.Blocks(css=css) as demo:
 
 
 
114
  with gr.Column(elem_id="col-container"):
115
- #gr.Markdown("[Stable Diffusion 3.5 Large (8B) (generation takes about 45 seconds)](https://huggingface.co/stabilityai/stable-diffusion-3.5-large)")
116
- gr.Markdown("Promt")
117
 
118
  with gr.Row():
119
  prompt = gr.Text(
@@ -189,7 +162,7 @@ with gr.Blocks(css=css) as demo:
189
  cache_mode="lazy"
190
  )
191
 
192
- # Use click method for the button and submit for the text field
193
  run_button.click(
194
  fn=infer,
195
  inputs=[
@@ -220,4 +193,4 @@ with gr.Blocks(css=css) as demo:
220
  )
221
 
222
  if __name__ == "__main__":
223
- demo.launch(server_name="0.0.0.0", server_port=7860, share=True, show_api=False)
 
52
  "A border collie lying in some Fall leaves as the forest trees change colors",
53
  ]
54
 
55
+ # Обновленный CSS
56
+ custom_css = """
57
  body {
58
  background-color: #17181B;
59
  color: #AEB3B8;
60
  }
61
  button {
62
+ background-color: #5271FF;
63
+ color: #FFFFFF;
64
+ border: none;
65
  }
66
  button:hover {
67
+ background-color: #395BB5;
68
+ }
69
+ input[type="range"] {
70
+ accent-color: #5271FF;
71
+ }
72
+ input[type="checkbox"]:checked {
73
+ background-color: #5271FF;
74
  }
75
  .footer, footer {
76
  display: none !important;
 
79
  margin: 0 auto;
80
  max-width: 640px;
81
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
82
  """
83
 
84
+ with gr.Blocks() as demo:
85
+ # Добавляем стили в начале с помощью gr.HTML()
86
+ gr.HTML(f"<style>{custom_css}</style>")
87
+
88
  with gr.Column(elem_id="col-container"):
89
+ gr.Markdown("Prompt")
 
90
 
91
  with gr.Row():
92
  prompt = gr.Text(
 
162
  cache_mode="lazy"
163
  )
164
 
165
+ # Используем метод click для кнопки и submit для текстового поля
166
  run_button.click(
167
  fn=infer,
168
  inputs=[
 
193
  )
194
 
195
  if __name__ == "__main__":
196
+ demo.launch(server_name="0.0.0.0", server_port=7860, share=True, show_api=False)