AdamOswald1 commited on
Commit
39eeea1
1 Parent(s): 433968a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -0
app.py CHANGED
@@ -139,7 +139,10 @@ def inference(model_name, prompt, guidance, steps, n_images=1, width=512, height
139
  if seed == 0:
140
  seed = random.randint(0, 2147483647)
141
 
 
142
  generator = torch.Generator('cuda').manual_seed(seed)
 
 
143
 
144
  try:
145
  if img is not None:
 
139
  if seed == 0:
140
  seed = random.randint(0, 2147483647)
141
 
142
+ if torch.cuda.is_available():
143
  generator = torch.Generator('cuda').manual_seed(seed)
144
+ else:
145
+ generator = torch.Generator().manual_seed(seed)
146
 
147
  try:
148
  if img is not None: