Ruining Li commited on
Commit
23f2fb5
1 Parent(s): 96bacab

Adapt to HF ZeroGPU

Browse files
Files changed (1) hide show
  1. app.py +5 -0
app.py CHANGED
@@ -230,6 +230,11 @@ def generate_image(model, image_processor, vae, clip_model, clip_vit, diffusion,
230
  gr.Warning("Please preprocess the image first.")
231
  return None
232
 
 
 
 
 
 
233
  with torch.no_grad():
234
  torch.manual_seed(seed)
235
  np.random.seed(seed)
 
230
  gr.Warning("Please preprocess the image first.")
231
  return None
232
 
233
+ model = model.to("cuda")
234
+ vae = vae.to("cuda")
235
+ clip_model = clip_model.to("cuda")
236
+ clip_vit = clip_vit.to("cuda")
237
+
238
  with torch.no_grad():
239
  torch.manual_seed(seed)
240
  np.random.seed(seed)