Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,6 +27,7 @@ from huggingface_hub import hf_hub_download
|
|
27 |
model = create_model('./models/cldm_v21_512_latctrl_coltrans.yaml').cpu()
|
28 |
ckpt = hf_hub_download(repo_id="xywwww/scene_diffusion", filename="checkpoints/epoch=25-step=112553.ckpt")
|
29 |
model.load_state_dict(load_state_dict(ckpt), strict=False)
|
|
|
30 |
ddim_sampler = DDIMSampler(model)
|
31 |
|
32 |
|
@@ -38,8 +39,8 @@ def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resoluti
|
|
38 |
# detected_map = apply_canny(img, low_threshold, high_threshold)
|
39 |
# detected_map = HWC3(detected_map)
|
40 |
|
41 |
-
|
42 |
-
control = torch.from_numpy(img.copy()).float() / 255.0
|
43 |
control = torch.stack([control for _ in range(num_samples)], dim=0)
|
44 |
control = einops.rearrange(control, 'b h w c -> b c h w').clone()
|
45 |
control = control.to(memory_format=torch.contiguous_format).float()
|
|
|
27 |
model = create_model('./models/cldm_v21_512_latctrl_coltrans.yaml').cpu()
|
28 |
ckpt = hf_hub_download(repo_id="xywwww/scene_diffusion", filename="checkpoints/epoch=25-step=112553.ckpt")
|
29 |
model.load_state_dict(load_state_dict(ckpt), strict=False)
|
30 |
+
model = model.cuda()
|
31 |
ddim_sampler = DDIMSampler(model)
|
32 |
|
33 |
|
|
|
39 |
# detected_map = apply_canny(img, low_threshold, high_threshold)
|
40 |
# detected_map = HWC3(detected_map)
|
41 |
|
42 |
+
control = torch.from_numpy(img.copy()).float().cuda() / 255.0
|
43 |
+
#control = torch.from_numpy(img.copy()).float() / 255.0
|
44 |
control = torch.stack([control for _ in range(num_samples)], dim=0)
|
45 |
control = einops.rearrange(control, 'b h w c -> b c h w').clone()
|
46 |
control = control.to(memory_format=torch.contiguous_format).float()
|