Spaces:
Running
Running
<!-- templates/play.html --> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Image Generator</title> | |
<style> | |
body { | |
font-family: Arial, sans-serif; | |
margin: 20px; | |
} | |
form { | |
max-width: 600px; | |
margin: 0 auto; | |
} | |
label { | |
display: block; | |
margin-top: 10px; | |
} | |
input[type="text"], | |
input[type="number"] { | |
width: 100%; | |
padding: 8px; | |
margin-top: 5px; | |
} | |
button { | |
margin-top: 10px; | |
padding: 10px 15px; | |
background-color: #007bff; | |
color: white; | |
border: none; | |
cursor: pointer; | |
} | |
button:hover { | |
background-color: #0056b3; | |
} | |
img { | |
max-width: 100%; | |
margin-top: 20px; | |
} | |
</style> | |
</head> | |
<body> | |
<h1>Image Generator</h1> | |
<form method="POST"> | |
<label for="prompt">Prompt:</label> | |
<input type="text" id="prompt" name="prompt" required> | |
<label for="width">Width:</label> | |
<input type="number" id="width" name="width" value="512" min="64" step="8" required> | |
<label for="height">Height:</label> | |
<input type="number" id="height" name="height" value="512" min="64" step="8" required> | |
<label for="seed">Seed:</label> | |
<input type="number" id="seed" name="seed" value="22" required> | |
<label for="model">Model:</label> | |
<input type="text" id="model" name="model" value="black-forest-labs_FLUX.1-dev" required> | |
<label for="key">API Key (optional):</label> | |
<input type="text" id="key" name="key"> | |
<button type="submit">Generate Image</button> | |
</form> | |
{% if image %} | |
<img src="data:image/png;base64,{{ image }}" alt="Generated Image"> | |
{% endif %} | |
</body> | |
</html> | |