Integrate Qwen image prompt enhancers

This commit is contained in:
Mikei386
2026-09-21 14:51:29 +02:00
parent b832157226
commit 5106d0d2ed
5 changed files with 403 additions and 10 deletions
@@ -27,6 +27,10 @@ LABEL_KEY = "com.mike-ai.llama-profile"
IMAGE_LABEL_KEY = "com.mike-ai.image-worker"
IMAGE_WORKER = os.environ.get("IMAGE_WORKER", "image")
RESTORE_WORKER = os.environ.get("RESTORE_WORKER", "restore")
IMAGE_PROMPT_I2I_WORKER = os.environ.get(
"IMAGE_PROMPT_I2I_WORKER", "image-prompt-i2i").strip()
IMAGE_PROMPT_T2I_WORKER = os.environ.get(
"IMAGE_PROMPT_T2I_WORKER", "image-prompt-t2i").strip()
FLUX_STANDBY_WORKER = os.environ.get(
"FLUX_STANDBY_WORKER", "flux-standby").strip()
TTS_LABEL_KEY = "com.mike-ai.tts-worker"
@@ -102,7 +106,12 @@ def image_container(kind: str = IMAGE_WORKER) -> dict:
def image_containers() -> list[dict]:
"""All allowlisted GPU workers that must never overlap an LLM."""
allowed = {IMAGE_WORKER, RESTORE_WORKER}
allowed = {
IMAGE_WORKER,
RESTORE_WORKER,
IMAGE_PROMPT_I2I_WORKER,
IMAGE_PROMPT_T2I_WORKER,
}
if FLUX_STANDBY_WORKER:
allowed.add(FLUX_STANDBY_WORKER)
return [item for item in labelled_containers(IMAGE_LABEL_KEY)
@@ -363,7 +372,13 @@ def stop_inference() -> dict:
def set_image_worker(running: bool, kind: str = IMAGE_WORKER) -> dict:
if kind not in {IMAGE_WORKER, RESTORE_WORKER, FLUX_STANDBY_WORKER}:
if kind not in {
IMAGE_WORKER,
RESTORE_WORKER,
FLUX_STANDBY_WORKER,
IMAGE_PROMPT_I2I_WORKER,
IMAGE_PROMPT_T2I_WORKER,
}:
raise ValueError("worker is not allowlisted")
with LOCK:
item = image_container(kind)
@@ -799,6 +814,10 @@ class Handler(BaseHTTPRequestHandler):
worker_paths = {
"/workers/image/start": (IMAGE_WORKER, True),
"/workers/image/stop": (IMAGE_WORKER, False),
"/workers/image-prompt-i2i/start": (IMAGE_PROMPT_I2I_WORKER, True),
"/workers/image-prompt-i2i/stop": (IMAGE_PROMPT_I2I_WORKER, False),
"/workers/image-prompt-t2i/start": (IMAGE_PROMPT_T2I_WORKER, True),
"/workers/image-prompt-t2i/stop": (IMAGE_PROMPT_T2I_WORKER, False),
"/workers/restore/start": (RESTORE_WORKER, True),
"/workers/restore/stop": (RESTORE_WORKER, False),
"/workers/flux-standby/start": (FLUX_STANDBY_WORKER, True),