ironjr commited on
Commit
2b4369c
1 Parent(s): 1af3890

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -82,14 +82,15 @@ opt.width = 1920
82
  opt.model = None
83
  opt.bootstrap_steps = 1
84
  opt.seed = -1
85
- opt.device = 0
86
  # opt.port = 8000
87
 
88
 
89
  ### Global variables and data structures
90
 
91
- device = f'cuda:{opt.device}' if opt.device >= 0 else 'cpu'
92
- # device = 'cuda'
 
93
 
94
 
95
  model_dict = {
@@ -101,7 +102,7 @@ model_dict = {
101
  }
102
 
103
  models = {
104
- k: StableMultiDiffusionPipeline(device, sd_version='1.5', hf_key=v)
105
  for k, v in model_dict.items()
106
  }
107
 
 
82
  opt.model = None
83
  opt.bootstrap_steps = 1
84
  opt.seed = -1
85
+ # opt.device = 0
86
  # opt.port = 8000
87
 
88
 
89
  ### Global variables and data structures
90
 
91
+ # device = f'cuda:{opt.device}' if opt.device >= 0 else 'cpu'
92
+ device = 'cuda' if torch.cuda.is_available() else 'cpu'
93
+ print(device)
94
 
95
 
96
  model_dict = {
 
102
  }
103
 
104
  models = {
105
+ k: StableMultiDiffusionPipeline(device, dtype=torch.float32, sd_version='1.5', hf_key=v).cuda()
106
  for k, v in model_dict.items()
107
  }
108