renyuxi commited on
Commit
8062689
1 Parent(s): 0515e2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -1
app.py CHANGED
@@ -18,6 +18,17 @@ from scheduling_tcd import TCDScheduler
18
 
19
  torch.backends.cuda.matmul.allow_tf32 = True
20
 
 
 
 
 
 
 
 
 
 
 
 
21
  class timer:
22
  def __init__(self, method_name="timed process"):
23
  self.method = method_name
@@ -40,7 +51,7 @@ pipe.load_lora_weights("ByteDance/Hyper-SD", weight_name="Hyper-SD15-1step-lora.
40
  pipe.to("cuda")
41
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config, timestep_spacing ="trailing")
42
 
43
- with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
44
  with gr.Column():
45
  with gr.Row():
46
  with gr.Column():
 
18
 
19
  torch.backends.cuda.matmul.allow_tf32 = True
20
 
21
+ js_func = """
22
+ function refresh() {
23
+ const url = new URL(window.location);
24
+
25
+ if (url.searchParams.get('__theme') !== 'dark') {
26
+ url.searchParams.set('__theme', 'dark');
27
+ window.location.href = url.href;
28
+ }
29
+ }
30
+ """
31
+
32
  class timer:
33
  def __init__(self, method_name="timed process"):
34
  self.method = method_name
 
51
  pipe.to("cuda")
52
  pipe.scheduler = TCDScheduler.from_config(pipe.scheduler.config, timestep_spacing ="trailing")
53
 
54
+ with gr.Blocks(js=js_func) as demo:
55
  with gr.Column():
56
  with gr.Row():
57
  with gr.Column():