MCPcopy Create free account
hub / github.com/ModelTC/LightX2V / image_to_base64

Function image_to_base64

scripts/server/post_i2v.py:7–11  ·  view source on GitHub ↗

Convert an image file to base64 string

(image_path)

Source from the content-addressed store, hash-verified

5
6
7def image_to_base64(image_path):
8 """Convert an image file to base64 string"""
9 with open(image_path, "rb") as f:
10 image_data = f.read()
11 return base64.b64encode(image_data).decode("utf-8")
12
13
14if __name__ == "__main__":

Callers 1

post_i2v.pyFile · 0.70

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected