mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-10-25 20:54:02 +01:00
Compare commits
No commits in common. "1abba32f18dff67da34a38781152f38c2caf8fc6" and "bb641672f77640ad5a5eee512585686aa33101f3" have entirely different histories.
1abba32f18
...
bb641672f7
@ -1,5 +1,5 @@
|
|||||||
[tool.bumpversion]
|
[tool.bumpversion]
|
||||||
current_version = "0.1.3"
|
current_version = "0.1.1"
|
||||||
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
|
||||||
serialize = ["{major}.{minor}.{patch}"]
|
serialize = ["{major}.{minor}.{patch}"]
|
||||||
search = "{current_version}"
|
search = "{current_version}"
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -7,5 +7,4 @@ dist/
|
|||||||
user_config.cfg
|
user_config.cfg
|
||||||
output/
|
output/
|
||||||
prompts_log.jsonl
|
prompts_log.jsonl
|
||||||
publish.sh
|
publish.sh
|
||||||
test.py
|
|
||||||
@ -9,7 +9,7 @@ import os
|
|||||||
import time
|
import time
|
||||||
import threading
|
import threading
|
||||||
from apscheduler.schedulers.background import BackgroundScheduler
|
from apscheduler.schedulers.background import BackgroundScheduler
|
||||||
from libs.generic import load_config, load_recent_prompts, get_details_from_png, get_current_version
|
from libs.generic import load_config, load_recent_prompts, get_details_from_png
|
||||||
from libs.comfyui import cancel_current_job, create_image
|
from libs.comfyui import cancel_current_job, create_image
|
||||||
from libs.ollama import create_prompt_on_openwebui
|
from libs.ollama import create_prompt_on_openwebui
|
||||||
|
|
||||||
@ -30,14 +30,11 @@ def index() -> str:
|
|||||||
|
|
||||||
prompt = get_details_from_png(image_path)["p"]
|
prompt = get_details_from_png(image_path)["p"]
|
||||||
|
|
||||||
version = get_current_version()
|
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"index.html",
|
"index.html",
|
||||||
image=image_filename,
|
image=image_filename,
|
||||||
prompt=prompt,
|
prompt=prompt,
|
||||||
reload_interval=user_config["frame"]["reload_interval"],
|
reload_interval=user_config["frame"]["reload_interval"],
|
||||||
version=version
|
|
||||||
)
|
)
|
||||||
|
|
||||||
@app.route("/images", methods=["GET"])
|
@app.route("/images", methods=["GET"])
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
import subprocess
|
|
||||||
import configparser
|
import configparser
|
||||||
import logging
|
import logging
|
||||||
import sys
|
import sys
|
||||||
@ -82,22 +81,6 @@ def get_details_from_png(path):
|
|||||||
print(f"Error reading metadata from {path}: {e}")
|
print(f"Error reading metadata from {path}: {e}")
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
def get_current_version():
|
|
||||||
try:
|
|
||||||
# Run the command and capture the output
|
|
||||||
result = subprocess.run(
|
|
||||||
['bump-my-version', 'show', 'current_version'],
|
|
||||||
stdout=subprocess.PIPE,
|
|
||||||
stderr=subprocess.PIPE,
|
|
||||||
text=True, # to get string output instead of bytes
|
|
||||||
check=True # raises exception if command fails
|
|
||||||
)
|
|
||||||
version = result.stdout.strip()
|
|
||||||
return version
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
print("Error running bump-my-version:", e)
|
|
||||||
return None
|
|
||||||
|
|
||||||
|
|
||||||
user_config = load_config()
|
user_config = load_config()
|
||||||
output_folder = user_config["comfyui"]["output_dir"]
|
output_folder = user_config["comfyui"]["output_dir"]
|
||||||
@ -102,13 +102,10 @@
|
|||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Back button fixed top right */
|
.button-group {
|
||||||
.home-button {
|
display: flex;
|
||||||
position: fixed;
|
justify-content: center;
|
||||||
top: 20px;
|
margin-top: 2rem;
|
||||||
right: 20px;
|
|
||||||
z-index: 500;
|
|
||||||
/* lower than lightbox (999) */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.button-link {
|
.button-link {
|
||||||
@ -169,13 +166,15 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<a href="/" class="button-link home-button">Home</a>
|
|
||||||
|
|
||||||
<h1>Image Archive</h1>
|
<h1>Image Archive</h1>
|
||||||
|
|
||||||
<!-- Empty gallery container; images will be loaded incrementally -->
|
<!-- Empty gallery container; images will be loaded incrementally -->
|
||||||
<div class="gallery" id="gallery"></div>
|
<div class="gallery" id="gallery"></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">
|
||||||
<span class="close" onclick="closeLightbox()">×</span>
|
<span class="close" onclick="closeLightbox()">×</span>
|
||||||
@ -199,7 +198,7 @@
|
|||||||
const batchSize = 6; // images to load per batch
|
const batchSize = 6; // images to load per batch
|
||||||
let loadedCount = 0;
|
let loadedCount = 0;
|
||||||
let currentIndex = 0;
|
let currentIndex = 0;
|
||||||
const detailsCache = {}; // Cache for image details
|
const detailsCache = {}; // Cache for image details
|
||||||
|
|
||||||
function createImageElement(image) {
|
function createImageElement(image) {
|
||||||
const img = document.createElement('img');
|
const img = document.createElement('img');
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
<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">
|
||||||
<title>AI Image of the Day</title>
|
<title>AI Image of the Day</title>
|
||||||
<style>
|
<style>
|
||||||
* {
|
* {
|
||||||
@ -21,7 +21,6 @@
|
|||||||
background: black;
|
background: black;
|
||||||
color: white;
|
color: white;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
position: relative; /* So fixed elements inside work well */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-container {
|
.image-container {
|
||||||
@ -75,19 +74,6 @@
|
|||||||
.button-link:hover {
|
.button-link:hover {
|
||||||
background: #555;
|
background: #555;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* New style for version number */
|
|
||||||
.version {
|
|
||||||
position: fixed;
|
|
||||||
bottom: 8px;
|
|
||||||
right: 12px;
|
|
||||||
color: #666;
|
|
||||||
font-size: 12px;
|
|
||||||
font-family: monospace;
|
|
||||||
user-select: none;
|
|
||||||
pointer-events: none;
|
|
||||||
opacity: 0.6;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
@ -99,7 +85,7 @@
|
|||||||
<body>
|
<body>
|
||||||
{% if image %}
|
{% if image %}
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<img src="{{ url_for('images', filename=image) }}" alt="Latest Image" />
|
<img src="{{ url_for('images', filename=image) }}" alt="Latest Image">
|
||||||
</div>
|
</div>
|
||||||
{% if prompt %}
|
{% if prompt %}
|
||||||
<div class="prompt">{{ prompt }}</div>
|
<div class="prompt">{{ prompt }}</div>
|
||||||
@ -111,9 +97,4 @@
|
|||||||
{% else %}
|
{% else %}
|
||||||
<p>No images found</p>
|
<p>No images found</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
</body>
|
||||||
<!-- Version number at bottom right -->
|
|
||||||
<div class="version">v{{ version }}</div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
Loading…
x
Reference in New Issue
Block a user