hysts HF staff commited on
Commit
7642b02
1 Parent(s): 5187b16
Files changed (2) hide show
  1. app.py +3 -2
  2. style.css +7 -0
app.py CHANGED
@@ -15,8 +15,6 @@ from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
15
  DESCRIPTION = '# zeroscope v2'
16
  if not torch.cuda.is_available():
17
  DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
18
- if (SPACE_ID := os.getenv('SPACE_ID')) is not None:
19
- DESCRIPTION += f'\n<p>For faster inference without waiting in queue, you may duplicate the space and upgrade to GPU in settings. <a href="https://huggingface.co/spaces/{SPACE_ID}?duplicate=true"><img style="display: inline; margin-top: 0em; margin-bottom: 0em" src="https://bit.ly/3gLdBN6" alt="Duplicate Space" /></a></p>'
20
 
21
  MAX_NUM_FRAMES = int(os.getenv('MAX_NUM_FRAMES', '200'))
22
  DEFAULT_NUM_FRAMES = min(MAX_NUM_FRAMES,
@@ -68,6 +66,9 @@ examples = [
68
 
69
  with gr.Blocks(css='style.css') as demo:
70
  gr.Markdown(DESCRIPTION)
 
 
 
71
  with gr.Box():
72
  with gr.Row():
73
  prompt = gr.Text(label='Prompt',
 
15
  DESCRIPTION = '# zeroscope v2'
16
  if not torch.cuda.is_available():
17
  DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
 
 
18
 
19
  MAX_NUM_FRAMES = int(os.getenv('MAX_NUM_FRAMES', '200'))
20
  DEFAULT_NUM_FRAMES = min(MAX_NUM_FRAMES,
 
66
 
67
  with gr.Blocks(css='style.css') as demo:
68
  gr.Markdown(DESCRIPTION)
69
+ gr.DuplicateButton(value='Duplicate Space for private use',
70
+ elem_id='duplicate-button',
71
+ visible=os.getenv('SHOW_DUPLICATE_BUTTON') == '1')
72
  with gr.Box():
73
  with gr.Row():
74
  prompt = gr.Text(label='Prompt',
style.css CHANGED
@@ -2,6 +2,13 @@ h1 {
2
  text-align: center;
3
  }
4
 
 
 
 
 
 
 
 
5
  #component-0 {
6
  max-width: 730px;
7
  margin: auto;
 
2
  text-align: center;
3
  }
4
 
5
+ #duplicate-button {
6
+ margin: auto;
7
+ color: #fff;
8
+ background: #1565c0;
9
+ border-radius: 100vh;
10
+ }
11
+
12
  #component-0 {
13
  max-width: 730px;
14
  margin: auto;