import requests
import base64
# Read your source image
with open("input.jpg", "rb") as f:
image_data = base64.b64encode(f.read()).decode()
response = requests.post(
"https://geoff.ai/api/v1/image/transform",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
},
json={
"image": image_data,
"prompt": "Convert to watercolor painting style",
"strength": 0.7,
},
)
# Save result
result_data = base64.b64decode(response.json()["data"]["image"])
with open("output.jpg", "wb") as f:
f.write(result_data)