mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-06-07 19:15:08 +01:00
Add grouping to model list
This commit is contained in:
parent
4272e1d40e
commit
ac388b0f4e
@ -98,7 +98,7 @@ def cancel_job() -> None:
|
||||
def create():
|
||||
if request.method == "POST":
|
||||
prompt = request.form.get("prompt")
|
||||
model = request.form.get("model", "Random")
|
||||
model = request.form.get("model") or "Random"
|
||||
|
||||
if not prompt:
|
||||
prompt = create_prompt_on_openwebui(user_config["comfyui"]["prompt"])
|
||||
@ -130,7 +130,6 @@ def create_image_endpoint() -> str:
|
||||
"""
|
||||
|
||||
models = load_models_from_config()
|
||||
models.insert(0, "Random")
|
||||
|
||||
return render_template(
|
||||
"create_image.html", models=models
|
||||
|
@ -128,12 +128,20 @@
|
||||
|
||||
<button onclick="randomPrompt()">Random Prompt</button>
|
||||
|
||||
|
||||
<!-- new model selector -->
|
||||
<select id="model-select">
|
||||
{% for m in models %}
|
||||
<option value="{{ m }}">{{ m.rsplit('.', 1)[0] }}</option>
|
||||
{% endfor %}
|
||||
<option value="" selected>Random</option>
|
||||
<!-- Group: FLUX -->
|
||||
<optgroup label="FLUX">
|
||||
{% for m in models if 'flux' in m|lower %}
|
||||
<option value="{{ m }}">{{ m.rsplit('.', 1)[0] }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
<!-- Group: SDXL -->
|
||||
<optgroup label="SDXL">
|
||||
{% for m in models if 'flux' not in m|lower %}
|
||||
<option value="{{ m }}">{{ m.rsplit('.', 1)[0] }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user