prithivMLmods commited on
Commit
2f5b910
·
verified ·
1 Parent(s): 01a33b5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -2
app.py CHANGED
@@ -17,10 +17,25 @@ from diffusers import StableDiffusionXLPipeline, EulerAncestralDiscreteScheduler
17
  #html_file_url = "https://prithivhamster.vercel.app/"
18
  #html_content = f'<iframe src="{html_file_url}" style="width:100%; height:400px; border:none"></iframe>'
19
 
20
- DESCRIPTIONx = """## STABLE HAMSTER
21
 
22
  """
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  css = '''
25
  .gradio-container{max-width: 560px !important}
26
  h1{text-align:center}
@@ -136,7 +151,7 @@ def generate(
136
  image_paths = [save_image(img) for img in images]
137
  return image_paths, seed
138
  #Main gr.Block
139
- with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
140
  gr.Markdown(DESCRIPTIONx)
141
  with gr.Group():
142
  with gr.Row():
 
17
  #html_file_url = "https://prithivhamster.vercel.app/"
18
  #html_content = f'<iframe src="{html_file_url}" style="width:100%; height:400px; border:none"></iframe>'
19
 
20
+ DESCRIPTIONx = """## STABLE HAMSTER 🐹
21
 
22
  """
23
 
24
+ js_func = """
25
+
26
+ function () {
27
+ const url = new URL(window.location);
28
+ if (url.searchParams.get('__theme') !== 'dark') {
29
+ url.searchParams.set('__theme', 'dark');
30
+ window.location.href = url.href;
31
+ }
32
+ }
33
+
34
+ """
35
+
36
+
37
+
38
+
39
  css = '''
40
  .gradio-container{max-width: 560px !important}
41
  h1{text-align:center}
 
151
  image_paths = [save_image(img) for img in images]
152
  return image_paths, seed
153
  #Main gr.Block
154
+ with gr.Blocks(css=css, theme="bethecloud/storj_theme", js=js_func) as demo:
155
  gr.Markdown(DESCRIPTIONx)
156
  with gr.Group():
157
  with gr.Row():