Compare commits

...

4 Commits

Author SHA1 Message Date
2a9a226dd1 bump version 2025-06-04 10:03:59 +01:00
3f2c59c5bb add mobile better mobile support 2025-06-04 10:03:44 +01:00
55ccd71383 fix the double generation 2025-06-04 10:03:30 +01:00
4b62b5cd07 was sending prompt to positive and negative 2025-06-04 10:03:17 +01:00
5 changed files with 54 additions and 31 deletions

View File

@ -1,5 +1,5 @@
[tool.bumpversion]
current_version = "0.1.8"
current_version = "0.1.9"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)"
serialize = ["{major}.{minor}.{patch}"]
search = "{current_version}"

View File

@ -4,6 +4,8 @@ from flask import (
send_from_directory,
request,
jsonify,
redirect,
url_for
)
import os
import time
@ -92,26 +94,28 @@ def cancel_job() -> None:
@app.route("/create", methods=["GET", "POST"])
def create() -> str:
"""Handles image creation requests.
Args:
None
Returns:
str: Redirect to the main page or a JSON response.
"""
prompt = request.form.get("prompt") if request.method == "POST" else None
model = request.form.get("model") if request.method == "POST" else "Random"
def create():
if request.method == "POST":
prompt = request.form.get("prompt")
model = request.form.get("model", "Random")
if not prompt:
prompt = create_prompt_on_openwebui(user_config["comfyui"]["prompt"])
# Start generation in background
threading.Thread(target=lambda: create_image(prompt, model)).start()
# store prompt in query string temporarily
return redirect(url_for("image_queued", prompt=prompt))
# For GET requests, just show the form to enter prompt
return render_template("create_image.html", models=load_models_from_config())
if prompt is None:
prompt = create_prompt_on_openwebui(user_config["comfyui"]["prompt"])
def create_image_in_background():
create_image(prompt, model)
threading.Thread(target=create_image_in_background).start()
return render_template('image_queued.html', prompt=prompt)
@app.route("/image_queued")
def image_queued():
prompt = request.args.get("prompt", "No prompt provided.")
return render_template("image_queued.html", prompt=prompt)
def scheduled_task() -> None:
"""Executes the scheduled image generation task."""

View File

@ -64,7 +64,7 @@ def generate_image(
file_name: str,
comfy_prompt: str,
workflow_path: str = "./workflow_sdxl.json",
prompt_node: str = "CLIP Text Encode (Prompt)",
prompt_node: str = "Positive",
seed_node: str = "KSampler",
seed_param: str = "seed",
save_node: str = "Save Image",

View File

@ -57,15 +57,6 @@
/* NEW: allow scrolling */
}
/* Optional: Adjust height for smaller screens */
@media (max-width: 768px) {
.prompt {
max-height: 25vh;
/* even smaller on mobile */
}
}
.button-group {
display: flex;
gap: 20px;
@ -102,6 +93,34 @@
pointer-events: none;
opacity: 0.6;
}
@media (max-width: 768px) {
.image-container {
max-width: 100vw;
max-height: 50vh;
}
img {
max-width: 100%;
max-height: 100%;
}
.prompt {
max-height: 20vh;
font-size: 14px;
padding: 10px 15px;
}
.button-group {
flex-direction: column;
gap: 10px;
}
.button-link {
font-size: 14px;
padding: 8px 16px;
}
}
</style>
<script>
setInterval(() => {

View File

@ -59,7 +59,7 @@
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
"title": "Positive"
}
},
"7": {
@ -72,7 +72,7 @@
},
"class_type": "CLIPTextEncode",
"_meta": {
"title": "CLIP Text Encode (Prompt)"
"title": "Negative"
}
},
"8": {