I’m creating a server side action that calls the Replicate API. These are the parameters I’m sending via the GET call:
let requestBody = {
version: "9283608cc6b7be6b65a8e44983db012355fde4132009bf99d976b2f0896856a3",
input: {
img: 'https://scontent-lhr8-1.xx.fbcdn.net/v/t1.6435-9/57308609_10157305731489319_5665168481692155904_n.jpg?_nc_cat=103&ccb=1-7&_nc_sid=8bfeb9&_nc_ohc=h0fyo5bFEgwAX8l_YeC&_nc_oc=AQkOlIwT9pAlEeKnaRxXypwWe1ky5IUS76lQEoPXTx4uZXx3BmwDinUB4E_4JX6F3z0&_nc_ht=scontent-lhr8-1.xx&oh=00_AfD6taAuCkGD_A6Ou_ylPv6Fuv7hm9K3__X22luzBAvfhw&oe=65182469',
scale: 2,
version: 'v1.4',
}
};
You’ll notice the “img” input is the actual URL of an image. This works fine. When I run the action in my test app…
…the prediction gets processed in Replicate. This is the output, which I’m very happy with:
However, whenever I obviously want to make the image URL dynamic. But when I try to set the image value to “PictureUploaderA’s value’s URL”:
and change my plugin code accordingly:
let requestBody = {
version: "9283608cc6b7be6b65a8e44983db012355fde4132009bf99d976b2f0896856a3",
input: {
img: properties.image,
scale: 2,
version: 'v1.4',
}
};
It doesn’t work. The call is not being made successfully.
This is the error code I’m getting:
{"detail":"- input.img: Does not match format 'uri'\n","status":422,"title":"Input validation failed","invalid_fields":[{"type":"format","field":"input.img","description":"Does not match format 'uri'"}]}
Anyone have any idea what I can do to fix this error? Looks like I need to convert the URL to a uri somehow?
Any assistance would be much appreciated