Spaces:
Runtime error
Runtime error
Zhenyu Li
commited on
Commit
·
365aa43
1
Parent(s):
e773e71
update
Browse files
app.py
CHANGED
@@ -96,10 +96,6 @@ overwrite_kwargs['model_cfg_path'] = args.model_cfg_path
|
|
96 |
overwrite_kwargs["model"] = args.model
|
97 |
config_depth = get_config_user(args.model, **overwrite_kwargs)
|
98 |
config_depth["pretrained_resource"] = ''
|
99 |
-
depth_model = build_model(config_depth)
|
100 |
-
depth_model = load_ckpt(depth_model, args.ckp_path)
|
101 |
-
depth_model.eval()
|
102 |
-
depth_model.to(DEVICE)
|
103 |
|
104 |
|
105 |
controlnet_ckp = hf_hub_download(repo_id="zhyever/PatchFusion", filename="control_sd15_depth.pth")
|
@@ -135,6 +131,12 @@ def rescale(A, lbound=-1, ubound=1):
|
|
135 |
def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, mode, patch_number, resolution, patch_size):
|
136 |
with torch.no_grad():
|
137 |
w, h = input_image.size
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
detected_map = predict_depth(depth_model, input_image, mode, patch_number, resolution, patch_size, device=DEVICE)
|
139 |
|
140 |
del depth_model # after using the depth model, free the mem
|
|
|
96 |
overwrite_kwargs["model"] = args.model
|
97 |
config_depth = get_config_user(args.model, **overwrite_kwargs)
|
98 |
config_depth["pretrained_resource"] = ''
|
|
|
|
|
|
|
|
|
99 |
|
100 |
|
101 |
controlnet_ckp = hf_hub_download(repo_id="zhyever/PatchFusion", filename="control_sd15_depth.pth")
|
|
|
131 |
def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, ddim_steps, guess_mode, strength, scale, seed, eta, mode, patch_number, resolution, patch_size):
|
132 |
with torch.no_grad():
|
133 |
w, h = input_image.size
|
134 |
+
|
135 |
+
depth_model = build_model(config_depth)
|
136 |
+
depth_model = load_ckpt(depth_model, args.ckp_path)
|
137 |
+
depth_model.eval()
|
138 |
+
depth_model.to(DEVICE)
|
139 |
+
|
140 |
detected_map = predict_depth(depth_model, input_image, mode, patch_number, resolution, patch_size, device=DEVICE)
|
141 |
|
142 |
del depth_model # after using the depth model, free the mem
|