Compare commits

..

No commits in common. "2a9a226dd17e88bb88fa0d487fd5b147d8730ca5" and "b8322e1fd8eeec3c3b5481254033472a0e58c58d" have entirely different histories.

5 changed files with 31 additions and 54 deletions

View File

@ -1,5 +1,5 @@
[tool.bumpversion] [tool.bumpversion]
current_version = "0.1.9" current_version = "0.1.8"
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}"

View File

@ -4,8 +4,6 @@ from flask import (
send_from_directory, send_from_directory,
request, request,
jsonify, jsonify,
redirect,
url_for
) )
import os import os
import time import time
@ -94,28 +92,26 @@ def cancel_job() -> None:
@app.route("/create", methods=["GET", "POST"]) @app.route("/create", methods=["GET", "POST"])
def create(): def create() -> str:
if request.method == "POST": """Handles image creation requests.
prompt = request.form.get("prompt") Args:
model = request.form.get("model", "Random") None
Returns:
if not prompt: str: Redirect to the main page or a JSON response.
prompt = create_prompt_on_openwebui(user_config["comfyui"]["prompt"]) """
prompt = request.form.get("prompt") if request.method == "POST" else None
# Start generation in background model = request.form.get("model") if request.method == "POST" else "Random"
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())
@app.route("/image_queued") if prompt is None:
def image_queued(): prompt = create_prompt_on_openwebui(user_config["comfyui"]["prompt"])
prompt = request.args.get("prompt", "No prompt provided.")
return render_template("image_queued.html", prompt=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)
def scheduled_task() -> None: def scheduled_task() -> None:
"""Executes the scheduled image generation task.""" """Executes the scheduled image generation task."""

View File

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

View File

@ -57,6 +57,15 @@
/* NEW: allow scrolling */ /* NEW: allow scrolling */
} }
/* Optional: Adjust height for smaller screens */
@media (max-width: 768px) {
.prompt {
max-height: 25vh;
/* even smaller on mobile */
}
}
.button-group { .button-group {
display: flex; display: flex;
gap: 20px; gap: 20px;
@ -93,34 +102,6 @@
pointer-events: none; pointer-events: none;
opacity: 0.6; 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> </style>
<script> <script>
setInterval(() => { setInterval(() => {

View File

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