Robert001 commited on
Commit
7152199
1 Parent(s): 9fcaa10

first commit

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -77,7 +77,14 @@ def inpainting(img, res, rand_h, rand_h_1, rand_w, rand_w_1):
77
 
78
 
79
  model = create_model('./models/cldm_v15_unicontrol.yaml').cpu()
80
- model_path = 'https://huggingface.co/Robert001/UniControl-Model/resolve/main/unicontrol_v1.1.ckpt'
 
 
 
 
 
 
 
81
  model.load_state_dict(load_state_dict(model_path, location='cuda'), strict=False)
82
  model = model.cuda()
83
  ddim_sampler = DDIMSampler(model)
 
77
 
78
 
79
  model = create_model('./models/cldm_v15_unicontrol.yaml').cpu()
80
+ model_url = 'https://huggingface.co/Robert001/UniControl-Model/resolve/main/unicontrol_v1.1.ckpt'
81
+ ckpts_path='./'
82
+ model_path = os.path.join(ckpts_path, "unicontrol_v1.1.ckpt")
83
+
84
+ if not os.path.exists(model_path):
85
+ from basicsr.utils.download_util import load_file_from_url
86
+ load_file_from_url(model_url, model_dir=ckpts_path)
87
+
88
  model.load_state_dict(load_state_dict(model_path, location='cuda'), strict=False)
89
  model = model.cuda()
90
  ddim_sampler = DDIMSampler(model)