sdxl-detector2 / index.html
goldenbrown's picture
Update index.html (#1)
af4e59d verified
raw
history blame
1.74 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Image Checker</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<div class="container">
<h1>AI Image Checker</h1>
<form id="image-checker-form" enctype="multipart/form-data">
<div class="file-input">
<label for="image-upload">Upload an image to check if it's AI-generated:</label>
<input type="file" id="image-upload" name="image" accept="image/*" required>
</div>
<button type="submit">Check Image</button>
</form>
<div id="result" class="result"></div>
</div>
<script>
const form = document.getElementById('image-checker-form');
const resultDiv = document.getElementById('result');
form.addEventListener('submit', async (e) => {
e.preventDefault();
const formData = new FormData(form);
resultDiv.textContent = 'Checking...';
try {
const response = await fetch('your_model_endpoint', {
method: 'POST',
body: formData
});
const result = await response.json();
if (result.is_ai_generated) {
resultDiv.textContent = "This image is AI-generated.";
} else {
resultDiv.textContent = "This image is not AI-generated.";
}
} catch (error) {
resultDiv.textContent = "Error occurred while checking the image.";
}
});
</script>
</body>
</html>