Compare commits

..

No commits in common. "fa59f3cfebaaffa7bae80da8804f46c2bc3d1601" and "57bb0fed5be79a9fc1d5faccf5b4a80b57be5178" have entirely different histories.

7 changed files with 9 additions and 27 deletions

View File

@ -1,5 +1,5 @@
[tool.bumpversion] [tool.bumpversion]
current_version = "0.3.3" current_version = "0.3.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}"]
replace = "{new_version}" replace = "{new_version}"

View File

@ -4,7 +4,7 @@ FROM python:3.11-slim
# Set the working directory in the container # Set the working directory in the container
WORKDIR /app WORKDIR /app
# Set version label # Set version label
ARG VERSION="0.3.3" ARG VERSION="0.3.1"
LABEL version=$VERSION LABEL version=$VERSION
# Copy project files into the container # Copy project files into the container

View File

@ -18,13 +18,6 @@ user_config = load_config()
app = Flask(__name__) app = Flask(__name__)
app.secret_key = os.environ.get("SECRET_KEY") app.secret_key = os.environ.get("SECRET_KEY")
# Make version available to all templates
from libs.generic import get_current_version
@app.context_processor
def inject_version():
version = get_current_version()
return dict(version=version)
# Inject config into routes that need it # Inject config into routes that need it
create_routes.init_app(user_config) create_routes.init_app(user_config)
auth_routes.init_app(user_config) auth_routes.init_app(user_config)
@ -46,16 +39,7 @@ from libs.comfyui import create_image
def scheduled_task(): def scheduled_task():
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')}")
# Generate a random prompt using either OpenWebUI or OpenRouter create_image(None)
from libs.generic import create_prompt_with_random_model
prompt = create_prompt_with_random_model("Generate a random detailed prompt for stable diffusion.")
if prompt:
# Select a random model
import random
model = "Random Image Model"
create_image(prompt, model)
else:
print("Failed to generate a prompt for the scheduled task.")
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":

View File

@ -145,11 +145,7 @@ def create_image(prompt: str | None = None, model: str = "Random Image Model") -
"""Generate an image with a chosen workflow (Random, FLUX*, or SDXL*).""" """Generate an image with a chosen workflow (Random, FLUX*, or SDXL*)."""
if prompt is None: if prompt is None:
# Generate a random prompt using either OpenWebUI or OpenRouter logging.error("No prompt provided.")
from libs.generic import create_prompt_with_random_model
prompt = create_prompt_with_random_model("Generate a random detailed prompt for stable diffusion.")
if not prompt:
logging.error("Failed to generate a prompt.")
return return
if not prompt: if not prompt:

View File

@ -110,7 +110,7 @@ def get_current_version():
return version return version
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print("Error running bump-my-version:", e) print("Error running bump-my-version:", e)
return "unknown" return None
def load_models_from_config(): def load_models_from_config():
flux_models = load_config()["comfyui:flux"]["models"].split(",") flux_models = load_config()["comfyui:flux"]["models"].split(",")

View File

@ -11,10 +11,12 @@ def index():
image_filename = "./image.png" image_filename = "./image.png"
image_path = os.path.join(image_folder, image_filename) image_path = os.path.join(image_folder, image_filename)
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,
) )

View File

@ -12,7 +12,7 @@
<!-- Version number at bottom right --> <!-- Version number at bottom right -->
<div class="version"> <div class="version">
<a href="{{ url_for('settings_route.config_editor') }}">{% if version and version != 'unknown' %}v{{ version }}{% else %}v?.?.?{% endif %}</a> <a href="{{ url_for('settings_route.config_editor') }}">v{{ version }}</a>
</div> </div>
{% block scripts %}{% endblock %} {% block scripts %}{% endblock %}