I am trying to:
- Upload a picture to a Next.js app
- Run it through
cjwbw/real-esrgan:d0ee3d708c9b911f122a4ad90046c5d26a0293b99476d697f6bb7f2e251ce2d4
- Then return the enhanced image
Does anybody know how to do that?
I am trying to:
cjwbw/real-esrgan:d0ee3d708c9b911f122a4ad90046c5d26a0293b99476d697f6bb7f2e251ce2d4
Does anybody know how to do that?
2
Answers
from what I am able to understand you are trying to use replicate model for high-resolution images.
To achieve the steps you mentioned you’ll need to set up a server in your Next.js app to handle the image processing using Docker or if you want to use Node.js try going through these docs
Step 1:
setup next js application and handle image upload.
Step 2:
To process the image and return it as a response
Hope this helps :).
Use a file input and send the output value to the esrgan api and retrieve the enhanced image from the api response
Select the image using the input, and now you can send the selected image
Or you can use a ref instead of the id by using the
useRef
react hook and assigning a ref to the input and get the file from the input ref….send the selected image to the api