From 20d4bd5b72c0edcd9442c30acb64c79f44a2318c Mon Sep 17 00:00:00 2001 From: William Gill Date: Sun, 19 Apr 2026 17:09:42 -0500 Subject: [PATCH] Image Studio: switch base model to qwen3.5:9b (non-abliterated) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The abliterated 9B was the source of the tool-call format mangling (both Native XML leaks and Default Python-syntax leaks). Standard qwen3.5:9b is the same family, same 9B size (6.6 GB), vision-capable and native tool calling actually works. The image content uncensored-ness was always going to come from the SDXL checkpoints in ComfyUI — the LLM is just a dispatcher. Picking a well-behaved tool-caller for that role doesn't compromise output content. Updated: - image_studio.json base_model_id → qwen3.5:9b - init-models.sh: pulls qwen3.5:9b as a standard registry pull, in addition to the existing abliterated 9B (which stays for other chat models) - image_studio.md setup table + vision section explaining why we chose standard over abliterated for the dispatcher role function_calling stays as 'default' and tool_choice as 'required' for now — they don't hurt with a reliable tool-caller and operators can flip back to native + drop tool_choice once they verify it works for them (which also removes the need for a separate Task Model for title generation). Co-Authored-By: Claude Opus 4.7 (1M context) --- deployments/ai-stack/init-models.sh | 5 +++ .../openwebui-models/image_studio.json | 2 +- .../ai-stack/openwebui-models/image_studio.md | 31 +++++++++++-------- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/deployments/ai-stack/init-models.sh b/deployments/ai-stack/init-models.sh index 374973d..572809b 100644 --- a/deployments/ai-stack/init-models.sh +++ b/deployments/ai-stack/init-models.sh @@ -55,6 +55,11 @@ pull() { # mirror-ollama-model.sh, upload to S3, then list them here. s3_pull "huihui_ai/qwen3.5-abliterated:9b" "qwen3.5-abliterated-9b.tgz" +# Standard non-abliterated Qwen 3.5 9B — 6.6 GB, vision + native tool +# calling. Used as the Image Studio dispatcher (the abliterated 9B above +# is fine for chat but mangles native tool-call formatting). +pull "qwen3.5:9b" + # ─── Direct registry pulls ────────────────────────────────────────────────── for model in dolphin3:8b llama3.1:8b ministral-3:8b mistral-nemo:12b qwen3.6:latest; do pull "$model" diff --git a/deployments/ai-stack/openwebui-models/image_studio.json b/deployments/ai-stack/openwebui-models/image_studio.json index 5be45e6..2501365 100644 --- a/deployments/ai-stack/openwebui-models/image_studio.json +++ b/deployments/ai-stack/openwebui-models/image_studio.json @@ -1,7 +1,7 @@ [ { "id": "image-studio", - "base_model_id": "huihui_ai/qwen3.5-abliterated:9b", + "base_model_id": "qwen3.5:9b", "name": "Image Studio", "params": { "system": "/no_think\n\nYou are an image-tool dispatcher. You do not respond in prose. Every user message MUST result in exactly one tool call.\n\nROUTING:\n- If the user attached an image (including images you previously generated in this chat) → call edit_image(prompt=..., ...)\n- Otherwise → call generate_image(prompt=..., ...)\nBoth tools take `prompt` as the first argument — same name on both. Do NOT invent `edit_instruction`.\n\nFire the tool on the FIRST message, with no preamble. Do not write a 'plan', 'approach', 'steps', 'breakdown', or any explanation before calling. Do not ask clarifying questions. Do not say what you are about to do. If the request is vague, pick reasonable defaults and call the tool — the user iterates after.\n\nSTYLES (pick one):\n photo photorealistic photo / portrait / cinematic\n juggernaut alternate photoreal — sharper, more saturated\n pony anime, cartoon, manga, stylised illustration\n general catch-all when nothing else fits\n furry-nai anthropomorphic, NAI-trained mix\n furry-noob anthropomorphic, NoobAI base\n furry-il anthropomorphic, Illustrious base (default for any furry/anthro request)\n\nSTYLE FOR edit_image — pick in this order:\n- The image was generated by you earlier in this chat → omit `style`, the tool auto-inherits from the previous call.\n- The user just UPLOADED an image → look at it and pick the style that matches what you see (anthropomorphic furry/scaly/feathered character → furry-il, pony score-tag art → pony, photo / portrait → photo or juggernaut, anime → pony, ambiguous → general). Then keep using that style for subsequent edits in the same chat.\n- Always pick for the DESIRED OUTPUT, but for normal edits the desired output IS the input style — only override when the user explicitly wants a style change ('turn this anime into a photo').\n\nedit_image has TWO MODES — pick based on whether the change is local or global:\n- LOCAL change (\"change the ball to a basketball\", \"add a hat to the dog\", \"remove the bird\", \"recolor the car red\") → set `mask_text` to a brief noun phrase naming the region (\"the ball\", \"the dog\", \"the bird\", \"the car\"). Only that region is repainted; rest stays pixel-perfect.\n- GLOBAL change (\"make this a sunset\", \"turn this into anime\", \"restyle as oil painting\") → leave mask_text unset. The whole image is reimagined.\nALWAYS prefer LOCAL when the user names a specific object, person, or region. GLOBAL is only for whole-image style/lighting transformations.\n\nDenoise:\n- LOCAL (mask_text set): default 1.0. Drop to 0.6–0.8 only for subtle local edits that should retain some original structure.\n- GLOBAL (no mask_text): default 0.7. Use 0.3–0.5 for subtle restyle, 0.85–1.0 for radical reimagining.\n\nPick style for the DESIRED OUTPUT, not the input image.\n\nWrite rich, descriptive prompts (subject, action, environment, lighting, mood, framing). Do NOT add quality tags like 'masterpiece', 'best quality', 'score_9', 'absurdres' — the tool prepends the correct tags per style. Do NOT set sampler, CFG, steps, scheduler — the tool picks them.\n\nAFTER the tool returns, write at most one short PLAIN-ENGLISH sentence noting your style/mode choice and offering one iteration idea. The image is already shown to the user.\n\nNEVER, after the tool returns:\n- echo or repeat the tool call (no `edit_image(prompt=..., ...)`, no ``, no JSON, no parameter listings)\n- describe what's in the image\n- list the arguments you used\n- enumerate styles, denoise, mask_text, etc.\nThose details are visible in the collapsible 'View Result from edit_image' tool-result block — the user can expand it if they care. Your follow-up message is for HUMAN conversation, not bookkeeping.", diff --git a/deployments/ai-stack/openwebui-models/image_studio.md b/deployments/ai-stack/openwebui-models/image_studio.md index a832dc8..28d2062 100644 --- a/deployments/ai-stack/openwebui-models/image_studio.md +++ b/deployments/ai-stack/openwebui-models/image_studio.md @@ -38,7 +38,7 @@ prompts. Verify after import: | Field | Value | | ----- | ----- | | Name | `Image Studio` | -| Base Model | `huihui_ai/qwen3.5-abliterated:9b` (vision-capable, 256K context, abliterated). Pull via `init-models.sh` first. | +| Base Model | `qwen3.5:9b` (6.6 GB, vision + native tool calling). Pull via `init-models.sh` first. The abliterated variant of the same model breaks tool-call format adherence; this is the standard build. | | Description | `Image generation and routing across SDXL checkpoints.` | | System Prompt | Paste the block from [System prompt](#system-prompt) below. | | Tools | enable **only** `smart_image_gen` | @@ -176,20 +176,25 @@ suggestions return, and autocomplete lights up. The shipped preset sets `meta.capabilities.vision: true` so Open WebUI allows users to attach images to chats with this model. Two paths: -### Default — `huihui_ai/qwen3.5-abliterated:9b` +### Default — `qwen3.5:9b` -The shipped preset uses Qwen 3.5 abliterated 9B as the base — vision- -capable, 256K context, no censorship hedging. Preseed via -`init-models.sh` (an `s3_pull` line is already in place; see -[Mirroring models to S3](../README.md#mirroring-models-to-s3) for the -mirror workflow). +The shipped preset uses standard (non-abliterated) Qwen 3.5 9B as +the base — vision-capable, 256K context, native tool calling +working. Preseed via `init-models.sh`. -**Important Qwen 3.x quirk:** thinking mode is on by default and -breaks native function calling — the model "thinks" about how to use -the tool instead of just calling it. The shipped system prompt starts -with `/no_think` to suppress this. If the model still plans instead -of firing the tool, also set `enable_thinking: false` in **Advanced -Params → Custom Parameters** (API-level enforcement). +**Why not the abliterated 9B?** The abliteration process mangles the +function-call template, causing the model to either refuse to call +tools or emit malformed `` XML that Open WebUI's parser +can't recognise. Image generation doesn't actually need an +uncensored LLM — the SDXL checkpoints in ComfyUI are what produce +image content, and they're already uncensored. The LLM's only role +here is to call the right tool with the right args; the standard +build does that more reliably. + +**Qwen 3.x quirk:** thinking mode is on by default. The shipped +system prompt starts with `/no_think` to suppress it. If the model +still plans instead of firing the tool, set +`enable_thinking: false` in **Advanced Params → Custom Parameters**. ### Alternatives