replicate / replicate-go

Go client for Replicate
https://replicate.com
Apache License 2.0
65 stars 9 forks source link

{"detail":"Failed to parse request body as JSON: EOF","status":400} #24

Closed hktalent closed 9 months ago

hktalent commented 10 months ago
image

{"input":{"img":"data:image/jpeg;base64,/9j/4A....","scale":4,"version":"v1.4"},"is_training":false,"version":"6129309904ce4debfde78de5c209bce0022af40e197e132f08be8ccce3050393"}
mattt commented 9 months ago

@hktalent It looks like Replicate's API is rejecting the request because the base64-encoded image data URI is malformed or (more likely) too large. Consider uploading your image to a URL and passing that instead.

hktalent commented 9 months ago

@mattt Okay, I understand. Can you give me an example of replicating a temporary image? Thank you so much

mattt commented 9 months ago

@hktalent You can find plenty of examples for uploading files to AWS S3 / Cloudflare R2, services like upload.io, or to your own server using SFTP. It all depends on your particular requirements. So long as you can get a public HTTPS URL to an asset, you can pass that as a string input to your model.