mirror of
https://github.com/karl0ss/ai_image_frame_server.git
synced 2025-06-08 03:25:06 +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():
|
def create():
|
||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
prompt = request.form.get("prompt")
|
prompt = request.form.get("prompt")
|
||||||
model = request.form.get("model", "Random")
|
model = request.form.get("model") or "Random"
|
||||||
|
|
||||||
if not prompt:
|
if not prompt:
|
||||||
prompt = create_prompt_on_openwebui(user_config["comfyui"]["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 = load_models_from_config()
|
||||||
models.insert(0, "Random")
|
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"create_image.html", models=models
|
"create_image.html", models=models
|
||||||
|
@ -128,12 +128,20 @@
|
|||||||
|
|
||||||
<button onclick="randomPrompt()">Random Prompt</button>
|
<button onclick="randomPrompt()">Random Prompt</button>
|
||||||
|
|
||||||
|
|
||||||
<!-- new model selector -->
|
|
||||||
<select id="model-select">
|
<select id="model-select">
|
||||||
{% for m in models %}
|
<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>
|
<option value="{{ m }}">{{ m.rsplit('.', 1)[0] }}</option>
|
||||||
{% endfor %}
|
{% 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>
|
</select>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user