Spaces:
Sleeping
Sleeping
| <html> | |
| <head> | |
| <title>Image Enhancer</title> | |
| <style> | |
| body { font-family: Arial; padding: 40px; } | |
| img { max-width: 400px; margin-top: 20px; } | |
| </style> | |
| </head> | |
| <body> | |
| <h2>Real-ESRGAN Image Enhancer</h2> | |
| <input type="file" id="fileInput"> | |
| <button onclick="upload()">Enhance</button> | |
| <br> | |
| <img id="result"/> | |
| <script> | |
| async function upload() { | |
| const file = document.getElementById("fileInput").files[0]; | |
| if (!file) return alert("Select image"); | |
| const form = new FormData(); | |
| form.append("file", file); | |
| const res = await fetch("/enhance", { | |
| method: "POST", | |
| body: form | |
| }); | |
| const blob = await res.blob(); | |
| document.getElementById("result").src = URL.createObjectURL(blob); | |
| } | |
| </script> | |
| </body> | |
| </html> | |