Image Uploads
Upload images for image-to-image and image-to-video tasks.
Methods
1. Direct URL
Reference any publicly accessible image:
{ "prompt": "convert to watercolor", "image": "https://example.com/photo.jpg"}2. Data URI
Embed image data directly:
{ "prompt": "convert to watercolor", "image": "data:image/jpeg;base64,/9j/4AAQSkZJRg..."}3. Upload Endpoint
Endpoint: POST /uploads
Upload to Weyl CDN first, then reference:
# 1. Uploadcurl -X POST "https://api.render.weyl.ai/uploads" \ -H "Authorization: Bearer $WEYL_API_KEY" \ -F "file=@portrait.jpg"
# Response:# { "url": "https://cdn.render.weyl.ai/u/xyz.jpg" }
# 2. Use in generationcurl -X POST "https://sync.render.weyl.ai/image/flux/dev/i2i?format=1024" \ -H "Authorization: Bearer $WEYL_API_KEY" \ -d '{ "prompt": "watercolor style", "image": "https://cdn.render.weyl.ai/u/xyz.jpg" }'Image Requirements
Formats
- Supported: JPEG, PNG, WebP
- Max size: 20 MB
- Max dimensions: 4096×4096
Recommendations
- Use WebP for best compression
- Keep under 2048×2048 for faster upload
- Ensure proper aspect ratio for target format
Upload Limits
- Max file size: 20 MB
- Rate limit: 100 uploads/min
- Retention: 24 hours (use in generation within 24h)
Python Example
import requests
# Upload imagewith open('portrait.jpg', 'rb') as f: resp = requests.post( 'https://api.render.weyl.ai/uploads', headers={'Authorization': f'Bearer {API_KEY}'}, files={'file': f} ) image_url = resp.json()['url']
# Use in generationresp = requests.post( 'https://sync.render.weyl.ai/image/flux/dev/i2i?format=1024', headers={'Authorization': f'Bearer {API_KEY}'}, json={ 'prompt': 'watercolor style', 'image': image_url })