hysts HF staff commited on
Commit
8ae4526
1 Parent(s): afddbfd
Files changed (2) hide show
  1. app.py +2 -5
  2. settings.py +3 -0
app.py CHANGED
@@ -2,8 +2,6 @@
2
 
3
  from __future__ import annotations
4
 
5
- import os
6
-
7
  import gradio as gr
8
  import torch
9
 
@@ -21,15 +19,14 @@ from app_segmentation import create_demo as create_demo_segmentation
21
  from app_shuffle import create_demo as create_demo_shuffle
22
  from app_softedge import create_demo as create_demo_softedge
23
  from model import Model
24
- from settings import ALLOW_CHANGING_BASE_MODEL, SHOW_DUPLICATE_BUTTON
 
25
 
26
  DESCRIPTION = '# ControlNet v1.1'
27
 
28
  if not torch.cuda.is_available():
29
  DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
30
 
31
- DEFAULT_MODEL_ID = os.getenv('DEFAULT_MODEL_ID',
32
- 'runwayml/stable-diffusion-v1-5')
33
  model = Model(base_model_id=DEFAULT_MODEL_ID, task_name='Canny')
34
 
35
  with gr.Blocks(css='style.css') as demo:
 
2
 
3
  from __future__ import annotations
4
 
 
 
5
  import gradio as gr
6
  import torch
7
 
 
19
  from app_shuffle import create_demo as create_demo_shuffle
20
  from app_softedge import create_demo as create_demo_softedge
21
  from model import Model
22
+ from settings import (ALLOW_CHANGING_BASE_MODEL, DEFAULT_MODEL_ID,
23
+ SHOW_DUPLICATE_BUTTON)
24
 
25
  DESCRIPTION = '# ControlNet v1.1'
26
 
27
  if not torch.cuda.is_available():
28
  DESCRIPTION += '\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>'
29
 
 
 
30
  model = Model(base_model_id=DEFAULT_MODEL_ID, task_name='Canny')
31
 
32
  with gr.Blocks(css='style.css') as demo:
settings.py CHANGED
@@ -1,5 +1,8 @@
1
  import os
2
 
 
 
 
3
  ALLOW_CHANGING_BASE_MODEL = os.getenv('SPACE_ID') != 'hysts/ControlNet-v1-1'
4
  SHOW_DUPLICATE_BUTTON = os.getenv('SHOW_DUPLICATE_BUTTON') == '1'
5
 
 
1
  import os
2
 
3
+ DEFAULT_MODEL_ID = os.getenv('DEFAULT_MODEL_ID',
4
+ 'runwayml/stable-diffusion-v1-5')
5
+
6
  ALLOW_CHANGING_BASE_MODEL = os.getenv('SPACE_ID') != 'hysts/ControlNet-v1-1'
7
  SHOW_DUPLICATE_BUTTON = os.getenv('SHOW_DUPLICATE_BUTTON') == '1'
8