pikto commited on
Commit
d39883f
·
1 Parent(s): 29d1318

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -0
app.py CHANGED
@@ -5,6 +5,34 @@ from theme_dropdown import create_theme_dropdown # noqa: F401
5
 
6
  dropdown, js = create_theme_dropdown()
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  models = [
9
  {"name": "Stable Diffusion 2", "url": "stabilityai/stable-diffusion-2-1"},
10
  {"name": "stability AI", "url": "stabilityai/stable-diffusion-2-1-base"},
 
5
 
6
  dropdown, js = create_theme_dropdown()
7
 
8
+ with gr.Blocks(theme='nota-ai/theme') as demo:
9
+ with gr.Row().style(equal_height=True):
10
+ with gr.Column(scale=10):
11
+ gr.Markdown(
12
+ """
13
+ # Theme preview: `theme`
14
+ To use this theme, set `theme='nota-ai/theme'` in `gr.Blocks()` or `gr.Interface()`.
15
+ You can append an `@` and a semantic version expression, e.g. @>=1.0.0,<2.0.0 to pin to a given version
16
+ of this theme.
17
+ """
18
+ )
19
+ with gr.Column(scale=3):
20
+ with gr.Box():
21
+ dropdown.render()
22
+ toggle_dark = gr.Button(value="Toggle Dark").style(full_width=True)
23
+
24
+ dropdown.change(None, dropdown, None, _js=js)
25
+ toggle_dark.click(
26
+ None,
27
+ _js="""
28
+ () => {
29
+ document.body.classList.toggle('dark');
30
+ document.querySelector('gradio-app').style.backgroundColor = 'var(--color-background-primary)'
31
+ }
32
+ """,
33
+ )
34
+
35
+
36
  models = [
37
  {"name": "Stable Diffusion 2", "url": "stabilityai/stable-diffusion-2-1"},
38
  {"name": "stability AI", "url": "stabilityai/stable-diffusion-2-1-base"},