MCPcopy Create free account
hub / github.com/thygate/stable-diffusion-webui-depthmap-script / encode_to_base64

Function encode_to_base64

scripts/depthmap_api.py:22–30  ·  view source on GitHub ↗
(image)

Source from the content-addressed store, hash-verified

20
21
22def encode_to_base64(image):
23 if type(image) is str:
24 return image
25 elif type(image) is Image.Image:
26 return api.encode_pil_to_base64(image)
27 elif type(image) is np.ndarray:
28 return encode_np_to_base64(image)
29 else:
30 return ""
31
32
33def encode_np_to_base64(image):

Callers 1

processFunction · 0.85

Calls 1

encode_np_to_base64Function · 0.85

Tested by

no test coverage detected