MCPcopy
hub / github.com/huchenlei/ComfyUI-layerdiffuse / high_quality_resize

Function high_quality_resize

lib_layerdiffusion/utils.py:31–41  ·  view source on GitHub ↗
(x, size)

Source from the content-addressed store, hash-verified

29
30
31def high_quality_resize(x, size):
32 if x.shape[0] != size[1] or x.shape[1] != size[0]:
33 if (size[0] * size[1]) < (x.shape[0] * x.shape[1]):
34 interpolation = cv2.INTER_AREA
35 else:
36 interpolation = cv2.INTER_LANCZOS4
37
38 y = cv2.resize(x, size, interpolation=interpolation)
39 else:
40 y = x
41 return y
42
43
44def crop_and_resize_image(detected_map, resize_mode, h, w):

Callers 1

crop_and_resize_imageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected