Skip to content

Instantly share code, notes, and snippets.

@uday-cohere
uday-cohere / img2img.py
Last active October 16, 2022 07:46
dev.paint.cohere.ai samples
# Image to Image API
import requests
import base64
# give a path to an image on disk
image = open('init.png', 'rb').read()
bytes = base64.b64encode(image)
bytestr = bytes.decode('utf-8')