Rebuilt routes_enhance.py / image_oasis.js enhancer pipeline ported from the test node: kept auto-GPU-layer sizing, targeted VRAM free, and OOM-to-CPU fallback; dropped output-tag wrapping, think-suppression, chat-template kwargs, revert button, and think toggle. New User Prompt field above Enhanced Prompt; Enhance re-enhances from User Prompt on every click. LLM stays loaded between enhancements and unloads at image-gen start via stage_load.py hook. profiles.json drives model-specific output cleanup. Fixed cache invalidation (auto_gpu_layers running before cache check), missing flash_attn=True, and n_ctx/max_tokens mismatch (now 8192/2048). Preset save/load now excludes user_prompt alongside positive/negative/seed/refs. CHANGELOG, README, help_content updated for v1.2.
46 lines
1.8 KiB
JSON
46 lines
1.8 KiB
JSON
{
|
|
"_comment": "Cleanup profiles for the Image Oasis prompt enhancer. Auto-resolved per request from the model filename; first match wins, no match falls back to 'universal'. Rule edits to existing profiles take effect on the next click; new profile entries also load on the next click (no restart needed since the enhancer no longer surfaces a profile picker).",
|
|
|
|
"universal": [
|
|
{"op": "regex_sub", "pattern": "(?s)<think>.*?</think>", "replace": ""},
|
|
{"op": "regex_sub", "pattern": "(?s)^.*?</think>\\s*", "replace": ""},
|
|
{"op": "regex_sub", "pattern": "\\[/?(?:INST|OUT)\\]|<</?SYS>>", "replace": ""},
|
|
{"op": "strip"}
|
|
],
|
|
|
|
"profiles": {
|
|
"qwen35-orphan-think": {
|
|
"description": "Qwen3.5 emits 'Thinking process: ... </think>' with no opening tag because the chat template prefilled <think>. Strip everything up to and including the orphan close.",
|
|
"match": "(?i)qwen3[._]?5",
|
|
"rules": [
|
|
{"op": "regex_sub", "pattern": "(?s)^.*?</think>\\s*", "replace": ""},
|
|
{"op": "strip"}
|
|
]
|
|
},
|
|
|
|
"qwen3-think-block": {
|
|
"description": "Qwen3 emits a full <think>...</think> block before the answer.",
|
|
"match": "(?i)qwen3(?![._]?5)",
|
|
"rules": [
|
|
{"op": "regex_sub", "pattern": "(?s)<think>.*?</think>", "replace": ""},
|
|
{"op": "strip"}
|
|
]
|
|
},
|
|
|
|
"wizardlm-llama-tokens": {
|
|
"description": "WizardLM-2 leaks Llama-template tokens ([OUT], <<SYS>>, <</SYS>>) and prepends blank lines.",
|
|
"match": "(?i)wizardlm",
|
|
"rules": [
|
|
{"op": "regex_sub", "pattern": "\\[/?(?:INST|OUT)\\]|<</?SYS>>", "replace": ""},
|
|
{"op": "strip"}
|
|
]
|
|
},
|
|
|
|
"passthrough": {
|
|
"description": "Explicit no-op for known-clean models (SuperGemma, Mistral, Llama 3.3, Qwen2.5).",
|
|
"match": "(?i)(supergemma|mistral|llama-?3\\.3|qwen2\\.5)",
|
|
"rules": []
|
|
}
|
|
}
|
|
}
|