Spaces:
Running
on
Zero
Running
on
Zero
File size: 5,741 Bytes
4e5b0ef |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>AI Image Generator</title>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: system-ui, -apple-system, sans-serif;
}
body {
background: #f9fafb;
min-height: 100vh;
padding: 2rem;
}
.container {
max-width: 900px;
margin: 0 auto;
}
header {
text-align: center;
margin-bottom: 2rem;
}
h1 {
font-size: 2.5rem;
margin-bottom: 1rem;
color: #4f46e5;
animation: fadeIn 0.5s ease-in;
}
.description {
color: #6b7280;
font-size: 1.1rem;
margin-bottom: 0.5rem;
animation: fadeIn 0.5s ease-in 0.2s backwards;
}
.iframe-container {
background: white;
padding: 2rem;
border-radius: 1rem;
box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
margin-bottom: 2rem;
animation: slideUp 0.5s ease-out 0.4s backwards;
}
iframe {
width: 100%;
border: none;
border-radius: 0.5rem;
background: white;
}
.tips {
background: #f0f9ff;
padding: 1.5rem;
border-radius: 0.5rem;
margin-top: 2rem;
border: 1px solid #bae6fd;
animation: fadeIn 0.5s ease-in 0.6s backwards;
}
.tips h2 {
color: #0369a1;
font-size: 1.25rem;
margin-bottom: 1rem;
}
.tips ul {
list-style-position: inside;
color: #0c4a6e;
}
.tips li {
margin-bottom: 0.5rem;
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@media (max-width: 900px) {
body {
padding: 1rem;
}
h1 {
font-size: 2rem;
}
.iframe-container {
padding: 1rem;
}
iframe {
height: 600px;
}
}
.loader {
display: flex;
justify-content: center;
align-items: center;
height: 450px;
background: #f9fafb;
border-radius: 0.5rem;
}
.loader-spinner {
width: 50px;
height: 50px;
border: 5px solid #f3f3f3;
border-top: 5px solid #4f46e5;
border-radius: 50%;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
</style>
</head>
<body>
<div class="container">
<header>
<h1>AI Image Generator</h1>
<p class="description">Create amazing AI-generated images with Stable Diffusion</p>
<p class="description">Powered by Black Forest Labs</p>
</header>
<main>
<div class="iframe-container">
<div id="loader" class="loader">
<div class="loader-spinner"></div>
</div>
<iframe
id="generatorFrame"
src="https://black-forest-labs-flux-1-dev.hf.space"
frameborder="0"
width="850"
height="450"
style="display: none;"
onload="frameLoaded()"
></iframe>
</div>
<div class="tips">
<h2>Tips for Best Results</h2>
<ul>
<li>Be specific in your descriptions - include details about style, mood, and composition</li>
<li>Try adding artistic styles like "oil painting", "watercolor", or "digital art"</li>
<li>Include lighting descriptions like "sunset", "studio lighting", or "moonlight"</li>
<li>Experiment with different perspectives: "close-up", "aerial view", or "wide angle"</li>
<li>Add quality enhancers like "highly detailed", "4K", or "professional photography"</li>
</ul>
</div>
</main>
</div>
<script>
function frameLoaded() {
const frame = document.getElementById('generatorFrame');
const loader = document.getElementById('loader');
// Hide loader and show iframe
loader.style.display = 'none';
frame.style.display = 'block';
// Adjust iframe height for mobile
if (window.innerWidth <= 900) {
frame.style.height = '600px';
}
}
// Handle window resize
window.addEventListener('resize', () => {
const frame = document.getElementById('generatorFrame');
if (window.innerWidth <= 900) {
frame.style.height = '600px';
} else {
frame.style.height = '450px';
}
});
</script>
</body>
</html> |