Text to Image

Generate an image from a text prompt.
curl --request POST \
  --url https://geoff.ai/api/v1/image/generate \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "prompt": "A futuristic city skyline at dusk, cyberpunk style",
    "width": 1024,
    "height": 1024
  }'

Image to Image

Transform an existing image using a prompt.
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)