mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-09-09 15:53:16 +01:00
Compare commits
No commits in common. "0ccebcf03778e902948efed1c63bbdc7946c9c6f" and "aef0afe753fa2d45db8ae70361e1faba94f316f1" have entirely different histories.
0ccebcf037
...
aef0afe753
@ -111,17 +111,6 @@ def scheduled_task() -> None:
|
|||||||
print(f"Executing scheduled task at {time.strftime('%Y-%m-%d %H:%M:%S')}")
|
print(f"Executing scheduled task at {time.strftime('%Y-%m-%d %H:%M:%S')}")
|
||||||
create_image(None)
|
create_image(None)
|
||||||
|
|
||||||
@app.route("/create_image", methods=["GET"])
|
|
||||||
def create_image_endpoint() -> str:
|
|
||||||
"""
|
|
||||||
Renders the create image template with image and prompt.
|
|
||||||
"""
|
|
||||||
|
|
||||||
return render_template(
|
|
||||||
"create_image.html"
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if user_config["frame"]["auto_regen"] == "True":
|
if user_config["frame"]["auto_regen"] == "True":
|
||||||
if os.environ.get("WERKZEUG_RUN_MAIN") == "true":
|
if os.environ.get("WERKZEUG_RUN_MAIN") == "true":
|
||||||
|
@ -1,89 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Create An Image</title>
|
|
||||||
<style>
|
|
||||||
* {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
}
|
|
||||||
body {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
height: 100vh;
|
|
||||||
background: black;
|
|
||||||
color: white;
|
|
||||||
font-family: Arial, sans-serif;
|
|
||||||
padding: 20px;
|
|
||||||
}
|
|
||||||
textarea {
|
|
||||||
width: 80vw;
|
|
||||||
height: 200px;
|
|
||||||
border-radius: 10px;
|
|
||||||
padding: 15px;
|
|
||||||
font-size: 16px;
|
|
||||||
font-family: monospace;
|
|
||||||
resize: none;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
background: #111;
|
|
||||||
color: #eee;
|
|
||||||
border: 1px solid #333;
|
|
||||||
}
|
|
||||||
.button-group {
|
|
||||||
display: flex;
|
|
||||||
gap: 20px;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
background: #333;
|
|
||||||
color: white;
|
|
||||||
border: none;
|
|
||||||
padding: 10px 20px;
|
|
||||||
border-radius: 8px;
|
|
||||||
font-size: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.3s;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
background: #555;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1 style="margin-bottom: 20px;">Create An Image</h1>
|
|
||||||
<textarea id="prompt-box" placeholder="Enter your custom prompt here..."></textarea>
|
|
||||||
<div class="button-group">
|
|
||||||
<button onclick="location.href='/'">Back</button>
|
|
||||||
<button onclick="sendPrompt()">Send Prompt</button>
|
|
||||||
<button onclick="location.href='/create'">Random Prompt</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
function sendPrompt() {
|
|
||||||
const prompt = document.getElementById('prompt-box').value;
|
|
||||||
const formData = new URLSearchParams();
|
|
||||||
formData.append('prompt', prompt);
|
|
||||||
|
|
||||||
fetch('/create', {
|
|
||||||
method: 'POST',
|
|
||||||
headers: {
|
|
||||||
'Content-Type': 'application/x-www-form-urlencoded',
|
|
||||||
},
|
|
||||||
body: formData.toString()
|
|
||||||
}).then(response => {
|
|
||||||
if (response.redirected) {
|
|
||||||
window.location.href = response.url;
|
|
||||||
} else {
|
|
||||||
alert("Image creation request sent.");
|
|
||||||
}
|
|
||||||
}).catch(error => {
|
|
||||||
alert("Error sending prompt: " + error);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
@ -11,25 +10,21 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: white;
|
color: white;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
padding: 2rem;
|
padding: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1 {
|
h1 {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery {
|
.gallery {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
|
grid-template-columns: repeat(auto-fill, minmax(500px, 1fr));
|
||||||
gap: 20px;
|
gap: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery img {
|
.gallery img {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
@ -37,7 +32,6 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
transition: transform 0.2s ease;
|
transition: transform 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.gallery img:hover {
|
.gallery img:hover {
|
||||||
transform: scale(1.02);
|
transform: scale(1.02);
|
||||||
}
|
}
|
||||||
@ -56,13 +50,11 @@
|
|||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
z-index: 999;
|
z-index: 999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lightbox img {
|
.lightbox img {
|
||||||
max-width: 90%;
|
max-width: 90%;
|
||||||
max-height: 80%;
|
max-height: 80%;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.lightbox .close {
|
.lightbox .close {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
@ -71,7 +63,6 @@
|
|||||||
color: white;
|
color: white;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow {
|
.arrow {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
@ -81,11 +72,9 @@
|
|||||||
user-select: none;
|
user-select: none;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow.left {
|
.arrow.left {
|
||||||
left: 20px;
|
left: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.arrow.right {
|
.arrow.right {
|
||||||
right: 20px;
|
right: 20px;
|
||||||
}
|
}
|
||||||
@ -101,46 +90,17 @@
|
|||||||
text-align: left;
|
text-align: left;
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-group {
|
|
||||||
display: flex;
|
|
||||||
justify-content: center;
|
|
||||||
margin-top: 2rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-link {
|
|
||||||
background: #333;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 10px 20px;
|
|
||||||
border-radius: 8px;
|
|
||||||
font-size: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.3s;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-link:hover {
|
|
||||||
background: #555;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<h1>Image Archive</h1>
|
<h1>Image Archive</h1>
|
||||||
<div class="gallery">
|
<div class="gallery">
|
||||||
{% for image in images %}
|
{% for image in images %}
|
||||||
<!-- <img src="{{ url_for('images', filename=image.thumbnail_filename) }}" alt="Image" loading="lazy" onclick="openLightbox({{ loop.index0 }})"> -->
|
<!-- <img src="{{ url_for('images', filename=image.thumbnail_filename) }}" alt="Image" loading="lazy" onclick="openLightbox({{ loop.index0 }})"> -->
|
||||||
<img src="{{ url_for('images', filename='thumbnails/' + image.filename) }}"
|
<img src="{{ url_for('images', filename='thumbnails/' + image.filename) }}" data-fullsrc="{{ url_for('images', filename=image.filename) }}" onclick="openLightbox({{ loop.index0 }})">
|
||||||
data-fullsrc="{{ url_for('images', filename=image.filename) }}" onclick="openLightbox({{ loop.index0 }})">
|
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="button-group">
|
|
||||||
<a href="/" class="button-link">Back</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Lightbox -->
|
<!-- Lightbox -->
|
||||||
<div class="lightbox" id="lightbox">
|
<div class="lightbox" id="lightbox">
|
||||||
@ -185,5 +145,4 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -1,6 +1,5 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
@ -11,7 +10,6 @@
|
|||||||
padding: 0;
|
padding: 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
@ -22,7 +20,6 @@
|
|||||||
color: white;
|
color: white;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-container {
|
.image-container {
|
||||||
max-width: 90vw;
|
max-width: 90vw;
|
||||||
max-height: 80vh;
|
max-height: 80vh;
|
||||||
@ -31,7 +28,6 @@
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
max-height: 100%;
|
max-height: 100%;
|
||||||
@ -39,7 +35,6 @@
|
|||||||
border-radius: 20px;
|
border-radius: 20px;
|
||||||
box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
|
box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
|
||||||
}
|
}
|
||||||
|
|
||||||
.prompt {
|
.prompt {
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
font-family: monospace;
|
font-family: monospace;
|
||||||
@ -50,30 +45,6 @@
|
|||||||
max-width: 80vw;
|
max-width: 80vw;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-group {
|
|
||||||
display: flex;
|
|
||||||
gap: 20px;
|
|
||||||
margin-top: 15px;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-link {
|
|
||||||
background: #333;
|
|
||||||
color: white;
|
|
||||||
text-decoration: none;
|
|
||||||
padding: 10px 20px;
|
|
||||||
border-radius: 8px;
|
|
||||||
font-size: 16px;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.3s;
|
|
||||||
display: inline-block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button-link:hover {
|
|
||||||
background: #555;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
@ -81,7 +52,6 @@
|
|||||||
}, {{ reload_interval }}); // Refresh every X ms
|
}, {{ reload_interval }}); // Refresh every X ms
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
{% if image %}
|
{% if image %}
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
@ -89,12 +59,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{% if prompt %}
|
{% if prompt %}
|
||||||
<div class="prompt">{{ prompt }}</div>
|
<div class="prompt">{{ prompt }}</div>
|
||||||
<div class="button-group">
|
<a href="/images" id="archive-link">Archive</a>
|
||||||
<a href="/images" class="button-link">Archive</a>
|
|
||||||
<a href="/create_image" class="button-link">Create Image</a>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<p>No images found</p>
|
<p>No images found</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</body>
|
</body>
|
||||||
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user